1 #ifndef _UAPI_ASM_GENERIC_SIGINFO_H
2 #define _UAPI_ASM_GENERIC_SIGINFO_H
4 #include <linux/compiler.h>
5 #include <linux/types.h>
9 void __user
*sival_ptr
;
13 * This is the size (including padding) of the part of the
14 * struct siginfo that is before the union.
16 #ifndef __ARCH_SI_PREAMBLE_SIZE
17 #define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
20 #define SI_MAX_SIZE 128
22 #define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int))
25 #ifndef __ARCH_SI_UID_T
26 #define __ARCH_SI_UID_T __kernel_uid32_t
30 * The default "si_band" type is "long", as specified by POSIX.
31 * However, some architectures want to override this to "int"
32 * for historical compatibility reasons, so we allow that.
34 #ifndef __ARCH_SI_BAND_T
35 #define __ARCH_SI_BAND_T long
38 #ifndef __ARCH_SI_CLOCK_T
39 #define __ARCH_SI_CLOCK_T __kernel_clock_t
42 #ifndef __ARCH_SI_ATTRIBUTES
43 #define __ARCH_SI_ATTRIBUTES
46 #ifndef HAVE_ARCH_SIGINFO_T
48 typedef struct siginfo
{
54 int _pad
[SI_PAD_SIZE
];
58 __kernel_pid_t _pid
; /* sender's pid */
59 __ARCH_SI_UID_T _uid
; /* sender's uid */
64 __kernel_timer_t _tid
; /* timer id */
65 int _overrun
; /* overrun count */
66 char _pad
[sizeof( __ARCH_SI_UID_T
) - sizeof(int)];
67 sigval_t _sigval
; /* same as below */
68 int _sys_private
; /* not to be passed to user */
71 /* POSIX.1b signals */
73 __kernel_pid_t _pid
; /* sender's pid */
74 __ARCH_SI_UID_T _uid
; /* sender's uid */
80 __kernel_pid_t _pid
; /* which child */
81 __ARCH_SI_UID_T _uid
; /* sender's uid */
82 int _status
; /* exit code */
83 __ARCH_SI_CLOCK_T _utime
;
84 __ARCH_SI_CLOCK_T _stime
;
87 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
89 void __user
*_addr
; /* faulting insn/memory ref. */
90 #ifdef __ARCH_SI_TRAPNO
91 int _trapno
; /* TRAP # which caused the signal */
93 short _addr_lsb
; /* LSB of the reported address */
102 __ARCH_SI_BAND_T _band
; /* POLL_IN, POLL_OUT, POLL_MSG */
108 void __user
*_call_addr
; /* calling user insn */
109 int _syscall
; /* triggering system call number */
110 unsigned int _arch
; /* AUDIT_ARCH_* of syscall */
113 } __ARCH_SI_ATTRIBUTES siginfo_t
;
115 /* If the arch shares siginfo, then it has SIGSYS. */
116 #define __ARCH_SIGSYS
120 * How these fields are to be accessed.
122 #define si_pid _sifields._kill._pid
123 #define si_uid _sifields._kill._uid
124 #define si_tid _sifields._timer._tid
125 #define si_overrun _sifields._timer._overrun
126 #define si_sys_private _sifields._timer._sys_private
127 #define si_status _sifields._sigchld._status
128 #define si_utime _sifields._sigchld._utime
129 #define si_stime _sifields._sigchld._stime
130 #define si_value _sifields._rt._sigval
131 #define si_int _sifields._rt._sigval.sival_int
132 #define si_ptr _sifields._rt._sigval.sival_ptr
133 #define si_addr _sifields._sigfault._addr
134 #ifdef __ARCH_SI_TRAPNO
135 #define si_trapno _sifields._sigfault._trapno
137 #define si_addr_lsb _sifields._sigfault._addr_lsb
138 #define si_lower _sifields._sigfault._addr_bnd._lower
139 #define si_upper _sifields._sigfault._addr_bnd._upper
140 #define si_band _sifields._sigpoll._band
141 #define si_fd _sifields._sigpoll._fd
143 #define si_call_addr _sifields._sigsys._call_addr
144 #define si_syscall _sifields._sigsys._syscall
145 #define si_arch _sifields._sigsys._arch
157 #define __SI_CODE(T,N) (N)
162 * Digital reserves positive values for kernel-generated signals.
164 #define SI_USER 0 /* sent by kill, sigsend, raise */
165 #define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
166 #define SI_QUEUE -1 /* sent by sigqueue */
167 #define SI_TIMER __SI_CODE(__SI_TIMER,-2) /* sent by timer expiration */
168 #define SI_MESGQ __SI_CODE(__SI_MESGQ,-3) /* sent by real time mesq state change */
169 #define SI_ASYNCIO -4 /* sent by AIO completion */
170 #define SI_SIGIO -5 /* sent by queued SIGIO */
171 #define SI_TKILL -6 /* sent by tkill system call */
172 #define SI_DETHREAD -7 /* sent by execve() killing subsidiary threads */
174 #define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
175 #define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
180 #define ILL_ILLOPC (__SI_FAULT|1) /* illegal opcode */
181 #define ILL_ILLOPN (__SI_FAULT|2) /* illegal operand */
182 #define ILL_ILLADR (__SI_FAULT|3) /* illegal addressing mode */
183 #define ILL_ILLTRP (__SI_FAULT|4) /* illegal trap */
184 #define ILL_PRVOPC (__SI_FAULT|5) /* privileged opcode */
185 #define ILL_PRVREG (__SI_FAULT|6) /* privileged register */
186 #define ILL_COPROC (__SI_FAULT|7) /* coprocessor error */
187 #define ILL_BADSTK (__SI_FAULT|8) /* internal stack error */
193 #define FPE_INTDIV (__SI_FAULT|1) /* integer divide by zero */
194 #define FPE_INTOVF (__SI_FAULT|2) /* integer overflow */
195 #define FPE_FLTDIV (__SI_FAULT|3) /* floating point divide by zero */
196 #define FPE_FLTOVF (__SI_FAULT|4) /* floating point overflow */
197 #define FPE_FLTUND (__SI_FAULT|5) /* floating point underflow */
198 #define FPE_FLTRES (__SI_FAULT|6) /* floating point inexact result */
199 #define FPE_FLTINV (__SI_FAULT|7) /* floating point invalid operation */
200 #define FPE_FLTSUB (__SI_FAULT|8) /* subscript out of range */
206 #define SEGV_MAPERR (__SI_FAULT|1) /* address not mapped to object */
207 #define SEGV_ACCERR (__SI_FAULT|2) /* invalid permissions for mapped object */
208 #define SEGV_BNDERR (__SI_FAULT|3) /* failed address bound checks */
214 #define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */
215 #define BUS_ADRERR (__SI_FAULT|2) /* non-existent physical address */
216 #define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */
217 /* hardware memory error consumed on a machine check: action required */
218 #define BUS_MCEERR_AR (__SI_FAULT|4)
219 /* hardware memory error detected in process but not consumed: action optional*/
220 #define BUS_MCEERR_AO (__SI_FAULT|5)
226 #define TRAP_BRKPT (__SI_FAULT|1) /* process breakpoint */
227 #define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */
228 #define TRAP_BRANCH (__SI_FAULT|3) /* process taken branch trap */
229 #define TRAP_HWBKPT (__SI_FAULT|4) /* hardware breakpoint/watchpoint */
235 #define CLD_EXITED (__SI_CHLD|1) /* child has exited */
236 #define CLD_KILLED (__SI_CHLD|2) /* child was killed */
237 #define CLD_DUMPED (__SI_CHLD|3) /* child terminated abnormally */
238 #define CLD_TRAPPED (__SI_CHLD|4) /* traced child has trapped */
239 #define CLD_STOPPED (__SI_CHLD|5) /* child has stopped */
240 #define CLD_CONTINUED (__SI_CHLD|6) /* stopped child has continued */
246 #define POLL_IN (__SI_POLL|1) /* data input available */
247 #define POLL_OUT (__SI_POLL|2) /* output buffers available */
248 #define POLL_MSG (__SI_POLL|3) /* input message available */
249 #define POLL_ERR (__SI_POLL|4) /* i/o error */
250 #define POLL_PRI (__SI_POLL|5) /* high priority input available */
251 #define POLL_HUP (__SI_POLL|6) /* device disconnected */
257 #define SYS_SECCOMP (__SI_SYS|1) /* seccomp triggered */
261 * sigevent definitions
263 * It seems likely that SIGEV_THREAD will have to be handled from
264 * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
265 * thread manager then catches and does the appropriate nonsense.
266 * However, everything is written out here so as to not get lost.
268 #define SIGEV_SIGNAL 0 /* notify via signal */
269 #define SIGEV_NONE 1 /* other notification: meaningless */
270 #define SIGEV_THREAD 2 /* deliver via thread creation */
271 #define SIGEV_THREAD_ID 4 /* deliver to thread */
274 * This works because the alignment is ok on all current architectures
275 * but we leave open this being overridden in the future
277 #ifndef __ARCH_SIGEV_PREAMBLE_SIZE
278 #define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(sigval_t))
281 #define SIGEV_MAX_SIZE 64
282 #define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) \
285 typedef struct sigevent
{
286 sigval_t sigev_value
;
290 int _pad
[SIGEV_PAD_SIZE
];
294 void (*_function
)(sigval_t
);
295 void *_attribute
; /* really pthread_attr_t */
300 #define sigev_notify_function _sigev_un._sigev_thread._function
301 #define sigev_notify_attributes _sigev_un._sigev_thread._attribute
302 #define sigev_notify_thread_id _sigev_un._tid
305 #endif /* _UAPI_ASM_GENERIC_SIGINFO_H */