1 /*	$NetBSD: linux_siginfo.h,v 1.2 2009/06/08 11:46:07 njoly Exp $	*/
2 
3 /*-
4  * This code is derived from software contributed to The NetBSD Foundation
5  * by Eric Haszlakiewicz.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef _ARM_LINUX_SIGINFO_H
30 #define _ARM_LINUX_SIGINFO_H
31 
32 typedef union linux_sigval {
33 	int	sival_int;
34 	void	*sival_ptr;
35 } linux_sigval_t;
36 
37 #define SI_MAX_SIZE	128
38 #define SI_PAD_SIZE	((SI_MAX_SIZE/sizeof(int)) - 3)
39 
40 typedef struct linux_siginfo {
41 	int	lsi_signo;
42 	int	lsi_errno;
43 	int	lsi_code;
44 	union {
45 		int	_pad[SI_PAD_SIZE];
46 
47 		/* kill() */
48 		struct {
49 			linux_pid_t	_pid;
50 			linux_uid_t	_uid;
51 		} _kill;
52 
53 		/* POSIX.1b signals */
54 		struct {
55 			linux_pid_t	_pid;
56 			linux_uid_t	_uid;
57 			linux_sigval_t	_sigval;
58 		} _rt;
59 
60 		/* POSIX.1b timers */
61 		struct {
62 			unsigned int	_timer1;
63 			unsigned int	_timer2;
64 		} _timer;
65 
66 		/* SIGCHLD */
67 		struct {
68 			linux_pid_t	_pid;
69 			linux_uid_t	_uid;
70 			int		_status;
71 			linux_clock_t	_utime;
72 			linux_clock_t	_stime;
73 		} _sigchld;
74 
75 		/* SIGPOLL */
76 		struct {
77 			int		_band;
78 			int		_fd;
79 		} _sigpoll;
80 
81 		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
82 		struct {
83 			void		*_addr;
84 		} _sigfault;
85 	} _sidata;
86 } linux_siginfo_t;
87 
88 #endif /* !_ARM_LINUX_SIGINFO_H */
89