1 /*-
2  * Copyright (c) 1998 Mark Newton
3  * Copyright (c) 1994 Christos Zoulas
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 3. The name of the author may not be used to endorse or promote products
15  *    derived from this software without specific prior written permission
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * $FreeBSD: stable/9/sys/compat/svr4/svr4_siginfo.h 151463 2005-10-19 09:33:15Z davidxu $
29  */
30 
31 #ifndef	_SVR4_SIGINFO_H_
32 #define	_SVR4_SIGINFO_H_
33 
34 #define	SVR4_ILL_ILLOPC		1
35 #define	SVR4_ILL_ILLOPN		2
36 #define	SVR4_ILL_ILLADR		3
37 #define	SVR4_ILL_ILLTRP		4
38 #define	SVR4_ILL_PRVOPC		5
39 #define	SVR4_ILL_PRVREG		6
40 #define	SVR4_ILL_COPROC		7
41 #define	SVR4_ILL_BADSTK		8
42 
43 #define	SVR4_FPE_INTDIV		1
44 #define	SVR4_FPE_INTOVF		2
45 #define	SVR4_FPE_FLTDIV		3
46 #define	SVR4_FPE_FLTOVF		4
47 #define	SVR4_FPE_FLTUND		5
48 #define	SVR4_FPE_FLTRES		6
49 #define	SVR4_FPE_FLTINV		7
50 #define SVR4_FPE_FLTSUB		8
51 
52 #define	SVR4_SEGV_MAPERR	1
53 #define	SVR4_SEGV_ACCERR	2
54 
55 #define	SVR4_BUS_ADRALN		1
56 #define	SVR4_BUS_ADRERR		2
57 #define	SVR4_BUS_OBJERR		3
58 
59 #define SVR4_TRAP_BRKPT		1
60 #define SVR4_TRAP_TRACE		2
61 
62 #define SVR4_POLL_IN		1
63 #define	SVR4_POLL_OUT		2
64 #define	SVR4_POLL_MSG		3
65 #define	SVR4_POLL_ERR		4
66 #define	SVR4_POLL_PRI		5
67 
68 #define	SVR4_CLD_EXITED		1
69 #define	SVR4_CLD_KILLED		2
70 #define	SVR4_CLD_DUMPED		3
71 #define	SVR4_CLD_TRAPPED	4
72 #define	SVR4_CLD_STOPPED	5
73 #define	SVR4_CLD_CONTINUED	6
74 
75 #define SVR4_EMT_TAGOVF		1
76 
77 typedef union svr4_siginfo {
78 	char	si_pad[128];	/* Total size; for future expansion */
79 	struct {
80 		int				_signo;
81 		int				_code;
82 		int				_errno;
83 		union {
84 			struct {
85 				svr4_pid_t	_pid;
86 				svr4_clock_t	_utime;
87 				int		_status;
88 				svr4_clock_t	_stime;
89 			} _child;
90 
91 			struct {
92 				caddr_t		_addr;
93 				int		_trap;
94 			} _fault;
95 		} _reason;
96 	} _info;
97 } svr4_siginfo_t;
98 
99 #define	svr4_si_signo	_info._signo
100 #define	svr4_si_code	_info._code
101 #define	svr4_si_errno	_info._errno
102 
103 #define svr4_si_pid	_info._reason._child._pid
104 #define svr4_si_stime	_info._reason._child._stime
105 #define svr4_si_status	_info._reason._child._status
106 #define svr4_si_utime	_info._reason._child._utime
107 
108 #define svr4_si_addr	_info._reason._fault._addr
109 #define svr4_si_trap	_info._reason._fault._trap
110 
111 #endif /* !_SVR4_SIGINFO_H_ */
112