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