xref: /csrg-svn/sys/sparc/include/signal.h (revision 69209)
155126Storek /*
263320Sbostic  * Copyright (c) 1992, 1993
363320Sbostic  *	The Regents of the University of California.  All rights reserved.
455126Storek  *
555126Storek  * This software was developed by the Computer Systems Engineering group
655126Storek  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
755126Storek  * contributed to Berkeley.
855126Storek  *
955501Sbostic  * All advertising materials mentioning features or use of this software
1055501Sbostic  * must display the following acknowledgement:
1155501Sbostic  *	This product includes software developed by the University of
1259210Storek  *	California, Lawrence Berkeley Laboratory.
1355501Sbostic  *
1455126Storek  * %sccs.include.redist.c%
1555126Storek  *
16*69209Smckusick  *	@(#)signal.h	8.2 (Berkeley) 05/03/95
1755126Storek  *
1859210Storek  * from: $Header: signal.h,v 1.5 92/11/26 02:04:46 torek Exp $
1955126Storek  */
2055126Storek 
2155126Storek #ifndef LOCORE
2260072Storek typedef int sig_atomic_t;
2360072Storek 
24*69209Smckusick #if !defined(_POSIX_SOURCE) && !defined(_ANSI_SOURCE)
2555126Storek /*
2655126Storek  * Information pushed on stack when a signal is delivered.
2755126Storek  * This is used by the kernel to restore state following
2855126Storek  * execution of the signal handler.  It is also made available
2955126Storek  * to the handler to allow it to restore state properly if
3055126Storek  * a non-standard exit is performed.
3155126Storek  *
3255126Storek  * All machines must have an sc_onstack and sc_mask.
3355126Storek  */
3455126Storek struct sigcontext {
3555126Storek 	int	sc_onstack;		/* sigstack state to restore */
3655126Storek 	int	sc_mask;		/* signal mask to restore */
3755126Storek 	/* begin machine dependent portion */
3855126Storek 	int	sc_sp;			/* %sp to restore */
3955126Storek 	int	sc_pc;			/* pc to restore */
4055126Storek 	int	sc_npc;			/* npc to restore */
4155126Storek 	int	sc_psr;			/* psr to restore */
4255126Storek 	int	sc_g1;			/* %g1 to restore */
4355126Storek 	int	sc_o0;			/* %o0 to restore */
4455126Storek };
45*69209Smckusick #endif
4655126Storek #else /* LOCORE */
4755126Storek #define	SC_SP_OFFSET	8
4855126Storek #define	SC_PC_OFFSET	12
4955126Storek #define	SC_NPC_OFFSET	16
5055126Storek #define	SC_PSR_OFFSET	20
5155126Storek #define	SC_G1_OFFSET	24
5255126Storek #define	SC_O0_OFFSET	28
5355126Storek #endif /* LOCORE */
5455126Storek 
55*69209Smckusick #if !defined(_POSIX_SOURCE) && !defined(_ANSI_SOURCE)
5655126Storek /*
5755126Storek  * `Code' arguments to signal handlers.  The names, and the funny numbering.
5855126Storek  * are defined so as to match up with what SunOS uses; I have no idea why
5955126Storek  * they did the numbers that way, except maybe to match up with the 68881.
6055126Storek  */
6155126Storek #define	FPE_INTOVF_TRAP		0x01	/* integer overflow */
6255126Storek #define	FPE_INTDIV_TRAP		0x14	/* integer divide by zero */
6355126Storek #define	FPE_FLTINEX_TRAP	0xc4	/* inexact */
6455126Storek #define	FPE_FLTDIV_TRAP		0xc8	/* divide by zero */
6555126Storek #define	FPE_FLTUND_TRAP		0xcc	/* underflow */
6655126Storek #define	FPE_FLTOPERR_TRAP	0xd0	/* operand error */
6755126Storek #define	FPE_FLTOVF_TRAP		0xd4	/* overflow */
68*69209Smckusick #endif
69