xref: /original-bsd/sys/sparc/include/signal.h (revision 909c03fb)
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  * All advertising materials mentioning features or use of this software
10  * must display the following acknowledgement:
11  *	This product includes software developed by the University of
12  *	California, Lawrence Berkeley Laboratory.
13  *
14  * %sccs.include.redist.c%
15  *
16  *	@(#)signal.h	7.3 (Berkeley) 04/20/93
17  *
18  * from: $Header: signal.h,v 1.5 92/11/26 02:04:46 torek Exp $
19  */
20 
21 #ifndef LOCORE
22 /*
23  * Information pushed on stack when a signal is delivered.
24  * This is used by the kernel to restore state following
25  * execution of the signal handler.  It is also made available
26  * to the handler to allow it to restore state properly if
27  * a non-standard exit is performed.
28  *
29  * All machines must have an sc_onstack and sc_mask.
30  */
31 struct sigcontext {
32 	int	sc_onstack;		/* sigstack state to restore */
33 	int	sc_mask;		/* signal mask to restore */
34 	/* begin machine dependent portion */
35 	int	sc_sp;			/* %sp to restore */
36 	int	sc_pc;			/* pc to restore */
37 	int	sc_npc;			/* npc to restore */
38 	int	sc_psr;			/* psr to restore */
39 	int	sc_g1;			/* %g1 to restore */
40 	int	sc_o0;			/* %o0 to restore */
41 };
42 #else /* LOCORE */
43 #define	SC_SP_OFFSET	8
44 #define	SC_PC_OFFSET	12
45 #define	SC_NPC_OFFSET	16
46 #define	SC_PSR_OFFSET	20
47 #define	SC_G1_OFFSET	24
48 #define	SC_O0_OFFSET	28
49 #endif /* LOCORE */
50 
51 /*
52  * `Code' arguments to signal handlers.  The names, and the funny numbering.
53  * are defined so as to match up with what SunOS uses; I have no idea why
54  * they did the numbers that way, except maybe to match up with the 68881.
55  */
56 #define	FPE_INTOVF_TRAP		0x01	/* integer overflow */
57 #define	FPE_INTDIV_TRAP		0x14	/* integer divide by zero */
58 #define	FPE_FLTINEX_TRAP	0xc4	/* inexact */
59 #define	FPE_FLTDIV_TRAP		0xc8	/* divide by zero */
60 #define	FPE_FLTUND_TRAP		0xcc	/* underflow */
61 #define	FPE_FLTOPERR_TRAP	0xd0	/* operand error */
62 #define	FPE_FLTOVF_TRAP		0xd4	/* overflow */
63