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 Ralf Baechle
7 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
10 #define _ASM_SIGINFO_H
12 /* This structure matches IRIX 32/n32 ABIs for binary compatibility but
13 has Linux extensions. */
15 #define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 4)
16 #define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 4)
17 #define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
19 #define HAVE_ARCH_SIGINFO_T
20 #define HAVE_ARCH_SIGEVENT_T
23 * We duplicate the generic versions - <asm-generic/siginfo.h> is just borked
26 #define HAVE_ARCH_COPY_SIGINFO
29 #include <asm-generic/siginfo.h>
31 typedef struct siginfo
{
37 int _pad
[SI_PAD_SIZE
];
41 pid_t _pid
; /* sender's pid */
42 uid_t _uid
; /* sender's uid */
47 pid_t _pid
; /* which child */
48 uid_t _uid
; /* sender's uid */
50 int _status
; /* exit code */
56 pid_t _pid
; /* which child */
58 int _status
; /* exit code */
62 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
64 void *_addr
; /* faulting insn/memory ref. */
67 /* SIGPOLL, SIGXFSZ (To do ...) */
69 long _band
; /* POLL_IN, POLL_OUT, POLL_MSG */
75 timer_t _tid
; /* timer id */
76 int _overrun
; /* overrun count */
77 char _pad
[sizeof( __ARCH_SI_UID_T
) - sizeof(int)];
78 sigval_t _sigval
; /* same as below */
79 int _sys_private
; /* not to be passed to user */
82 /* POSIX.1b signals */
84 pid_t _pid
; /* sender's pid */
85 uid_t _uid
; /* sender's uid */
94 typedef union sigval32
{
99 typedef struct siginfo32
{
105 int _pad
[SI_PAD_SIZE32
];
109 __kernel_pid_t32 _pid
; /* sender's pid */
110 __kernel_uid_t32 _uid
; /* sender's uid */
115 __kernel_pid_t32 _pid
; /* which child */
116 __kernel_uid_t32 _uid
; /* sender's uid */
117 __kernel_clock_t32 _utime
;
118 int _status
; /* exit code */
119 __kernel_clock_t32 _stime
;
124 __kernel_pid_t32 _pid
; /* which child */
125 __kernel_clock_t32 _utime
;
126 int _status
; /* exit code */
127 __kernel_clock_t32 _stime
;
130 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
132 s32 _addr
; /* faulting insn/memory ref. */
135 /* SIGPOLL, SIGXFSZ (To do ...) */
137 int _band
; /* POLL_IN, POLL_OUT, POLL_MSG */
141 /* POSIX.1b timers */
143 unsigned int _timer1
;
144 unsigned int _timer2
;
147 /* POSIX.1b signals */
149 __kernel_pid_t32 _pid
; /* sender's pid */
150 __kernel_uid_t32 _uid
; /* sender's uid */
157 #endif /* __KERNEL__ */
161 * Again these have been choosen to be IRIX compatible.
166 #define SI_ASYNCIO -2 /* sent by AIO completion */
167 #define SI_TIMER __SI_CODE(__SI_TIMER,-3) /* sent by timer expiration */
168 #define SI_MESGQ -4 /* sent by real time mesq state change */
171 * sigevent definitions
173 * It seems likely that SIGEV_THREAD will have to be handled from
174 * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
175 * thread manager then catches and does the appropriate nonsense.
176 * However, everything is written out here so as to not get lost.
181 #define SIGEV_NONE 128 /* other notification: meaningless */
182 #define SIGEV_SIGNAL 129 /* notify via signal */
183 #define SIGEV_CALLBACK 130 /* ??? */
184 #define SIGEV_THREAD 131 /* deliver via thread creation */
186 /* XXX This one isn't yet IRIX / ABI compatible. */
187 typedef struct sigevent
{
189 sigval_t sigev_value
;
192 int _pad
[SIGEV_PAD_SIZE
];
196 void (*_function
)(sigval_t
);
197 void *_attribute
; /* really pthread_attr_t */
205 * Duplicated here because of <asm-generic/siginfo.h> braindamage ...
207 #include <linux/string.h>
209 static inline void copy_siginfo(struct siginfo
*to
, struct siginfo
*from
)
211 if (from
->si_code
< 0)
212 memcpy(to
, from
, sizeof(*to
));
214 /* _sigchld is currently the largest know union member */
215 memcpy(to
, from
, 3*sizeof(int) + sizeof(from
->_sifields
._sigchld
));
220 #endif /* _ASM_SIGINFO_H */