1 /* 2 * Copyright (c) 1992 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This software was developed by the Computer Systems Engineering group 6 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 7 * contributed to Berkeley. 8 * 9 * %sccs.include.redist.c% 10 * 11 * @(#)signal.h 7.1 (Berkeley) 07/13/92 12 * 13 * from: $Header: signal.h,v 1.4 92/06/17 06:10:28 torek Exp $ 14 */ 15 16 #ifndef LOCORE 17 /* 18 * Information pushed on stack when a signal is delivered. 19 * This is used by the kernel to restore state following 20 * execution of the signal handler. It is also made available 21 * to the handler to allow it to restore state properly if 22 * a non-standard exit is performed. 23 * 24 * All machines must have an sc_onstack and sc_mask. 25 */ 26 struct sigcontext { 27 int sc_onstack; /* sigstack state to restore */ 28 int sc_mask; /* signal mask to restore */ 29 /* begin machine dependent portion */ 30 int sc_sp; /* %sp to restore */ 31 int sc_pc; /* pc to restore */ 32 int sc_npc; /* npc to restore */ 33 int sc_psr; /* psr to restore */ 34 int sc_g1; /* %g1 to restore */ 35 int sc_o0; /* %o0 to restore */ 36 }; 37 #else /* LOCORE */ 38 #define SC_SP_OFFSET 8 39 #define SC_PC_OFFSET 12 40 #define SC_NPC_OFFSET 16 41 #define SC_PSR_OFFSET 20 42 #define SC_G1_OFFSET 24 43 #define SC_O0_OFFSET 28 44 #endif /* LOCORE */ 45 46 /* 47 * `Code' arguments to signal handlers. The names, and the funny numbering. 48 * are defined so as to match up with what SunOS uses; I have no idea why 49 * they did the numbers that way, except maybe to match up with the 68881. 50 */ 51 #define FPE_INTOVF_TRAP 0x01 /* integer overflow */ 52 #define FPE_INTDIV_TRAP 0x14 /* integer divide by zero */ 53 #define FPE_FLTINEX_TRAP 0xc4 /* inexact */ 54 #define FPE_FLTDIV_TRAP 0xc8 /* divide by zero */ 55 #define FPE_FLTUND_TRAP 0xcc /* underflow */ 56 #define FPE_FLTOPERR_TRAP 0xd0 /* operand error */ 57 #define FPE_FLTOVF_TRAP 0xd4 /* overflow */ 58