xref: /titanic_41/usr/src/cmd/csh/i386/signal.h (revision 4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6)
1 /*
2  * Copyright 1996 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
7 /*	  All Rights Reserved  	*/
8 
9 /*
10  * Copyright (c) 1980 Regents of the University of California.
11  * All rights reserved. The Berkeley Software License Agreement
12  * specifies the terms and conditions for redistribution.
13  */
14 
15 
16 #ifndef CSH_SIGNAL_H
17 #define CSH_SIGNAL_H
18 
19 #pragma ident	"%Z%%M%	%I%	%E% SMI"
20 
21 /*
22  * 4.3BSD signal compatibility header
23  *
24  */
25 #define sigmask(m)	(m > 32 ? 0 : (1 << ((m)-1)))
26 
27 /*
28  * 4.3BSD signal vector structure used in sigvec call.
29  */
30 struct  sigvec {
31         void    (*sv_handler)();        /* signal handler */
32         int     sv_mask;                /* signal mask to apply */
33         int     sv_flags;               /* see signal options below */
34 };
35 
36 #define SV_ONSTACK      0x0001  /* take signal on signal stack */
37 #define SV_INTERRUPT    0x0002  /* do not restart system on signal return */
38 #define SV_RESETHAND    0x0004  /* reset handler to SIG_DFL when signal taken */
39 
40 #define sv_onstack sv_flags
41 
42 /*
43  * Machine dependent deta structure
44  */
45 struct  sigcontext {
46         int     sc_onstack;             /* sigstack state to restore */
47         int     sc_mask;                /* signal mask to restore */
48 	int	sc_sp;			/* sp to restore */
49 	int	sc_pc;			/* pc to retore */
50 	int	sc_ps;			/* psl to restore */
51 	int	sc_eax;			/* eax to restore */
52 	int	sc_edx;			/* edx to restore */
53 };
54 
55 #define SI_DFLCODE	1
56 
57 #define BUS_HWERR	BUS_ADRERR	/* misc hardware error (e.g. timeout) */
58 #define BUS_ALIGN	BUS_ADRALN	/* hardware alignment error */
59 
60 #define SEGV_NOMAP	SEGV_MAPERR	/* no mapping at the fault address */
61 #define SEGV_PROT	SEGV_ACCERR	/* access exceeded protections */
62 
63 /*
64  * The SEGV_CODE(code) will be SEGV_NOMAP, SEGV_PROT, or SEGV_OBJERR.
65  * In the SEGV_OBJERR case, doing a SEGV_ERRNO(code) gives an errno value
66  * reported by the underlying file object mapped at the fault address.
67  */
68 
69 #define SIG_NOADDR	((char *)~0)
70 
71 #define	SEGV_MAKE_ERR(e) (((e) << 8) | SEGV_MAPERR)
72 
73 #endif	/* CSH_SIGNAL_H */
74