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