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