2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 1998, 1999, 2001, 2003 Ralf Baechle
7 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
10 #define _ASM_SIGINFO_H
12 #include <linux/config.h>
14 #define SIGEV_HEAD_SIZE (sizeof(long) + 2*sizeof(int))
15 #define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE-SIGEV_HEAD_SIZE) / sizeof(int))
16 #define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 4)
18 #define HAVE_ARCH_SIGINFO_T
21 * We duplicate the generic versions - <asm-generic/siginfo.h> is just borked
24 #define HAVE_ARCH_COPY_SIGINFO
27 #include <asm-generic/siginfo.h>
29 /* This structure matches the 32/n32 ABIs for source compatibility but
30 has Linux extensions. */
32 typedef struct siginfo
{
38 int _pad
[SI_PAD_SIZE
];
42 pid_t _pid
; /* sender's pid */
43 uid_t _uid
; /* sender's uid */
48 pid_t _pid
; /* which child */
49 uid_t _uid
; /* sender's uid */
50 int _status
; /* exit code */
57 pid_t _pid
; /* which child */
59 int _status
; /* exit code */
63 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
65 void *_addr
; /* faulting insn/memory ref. */
68 /* SIGPOLL, SIGXFSZ (To do ...) */
71 int _band
; /* POLL_IN, POLL_OUT, POLL_MSG */
74 long _band
; /* POLL_IN, POLL_OUT, POLL_MSG */
81 timer_t _tid
; /* timer id */
82 int _overrun
; /* overrun count */
83 char _pad
[sizeof( __ARCH_SI_UID_T
) - sizeof(int)];
84 sigval_t _sigval
; /* same as below */
85 int _sys_private
; /* not to be passed to user */
88 /* POSIX.1b signals */
90 pid_t _pid
; /* sender's pid */
91 uid_t _uid
; /* sender's uid */
98 #if defined(__KERNEL__) && defined(CONFIG_COMPAT)
100 #include <linux/compat.h>
102 #define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
104 typedef union sigval32
{
109 typedef struct siginfo32
{
115 int _pad
[SI_PAD_SIZE32
];
119 compat_pid_t _pid
; /* sender's pid */
120 compat_uid_t _uid
; /* sender's uid */
125 compat_pid_t _pid
; /* which child */
126 compat_uid_t _uid
; /* sender's uid */
127 compat_clock_t _utime
;
128 int _status
; /* exit code */
129 compat_clock_t _stime
;
134 compat_pid_t _pid
; /* which child */
135 compat_clock_t _utime
;
136 int _status
; /* exit code */
137 compat_clock_t _stime
;
140 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
142 s32 _addr
; /* faulting insn/memory ref. */
145 /* SIGPOLL, SIGXFSZ (To do ...) */
147 int _band
; /* POLL_IN, POLL_OUT, POLL_MSG */
151 /* POSIX.1b timers */
153 unsigned int _timer1
;
154 unsigned int _timer2
;
157 /* POSIX.1b signals */
159 compat_pid_t _pid
; /* sender's pid */
160 compat_uid_t _uid
; /* sender's uid */
167 #endif /* defined(__KERNEL__) && defined(CONFIG_COMPAT) */
171 * Again these have been choosen to be IRIX compatible.
176 #define SI_ASYNCIO -2 /* sent by AIO completion */
177 #define SI_TIMER __SI_CODE(__SI_TIMER,-3) /* sent by timer expiration */
178 #define SI_MESGQ __SI_CODE(__SI_MESGQ,-4) /* sent by real time mesq state change */
183 * Duplicated here because of <asm-generic/siginfo.h> braindamage ...
185 #include <linux/string.h>
187 static inline void copy_siginfo(struct siginfo
*to
, struct siginfo
*from
)
189 if (from
->si_code
< 0)
190 memcpy(to
, from
, sizeof(*to
));
192 /* _sigchld is currently the largest know union member */
193 memcpy(to
, from
, 3*sizeof(int) + sizeof(from
->_sifields
._sigchld
));
198 #endif /* _ASM_SIGINFO_H */