1
2 #ifndef _UAPI_ASM_GENERIC_SIGINFO_H
3 #define _UAPI_ASM_GENERIC_SIGINFO_H
4
5 #include <linux/compiler.h>
6 #include <linux/types.h>
7
8 typedef union sigval {
9 int sival_int;
10 void __user *sival_ptr;
11 } sigval_t;
12
13 #define SI_MAX_SIZE 128
14
15
16
17
18
19
20 #ifndef __ARCH_SI_BAND_T
21 #define __ARCH_SI_BAND_T long
22 #endif
23
24 #ifndef __ARCH_SI_CLOCK_T
25 #define __ARCH_SI_CLOCK_T __kernel_clock_t
26 #endif
27
28 #ifndef __ARCH_SI_ATTRIBUTES
29 #define __ARCH_SI_ATTRIBUTES
30 #endif
31
32 union __sifields {
33
34 struct {
35 __kernel_pid_t _pid;
36 __kernel_uid32_t _uid;
37 } _kill;
38
39
40 struct {
41 __kernel_timer_t _tid;
42 int _overrun;
43 sigval_t _sigval;
44 int _sys_private;
45 } _timer;
46
47
48 struct {
49 __kernel_pid_t _pid;
50 __kernel_uid32_t _uid;
51 sigval_t _sigval;
52 } _rt;
53
54
55 struct {
56 __kernel_pid_t _pid;
57 __kernel_uid32_t _uid;
58 int _status;
59 __ARCH_SI_CLOCK_T _utime;
60 __ARCH_SI_CLOCK_T _stime;
61 } _sigchld;
62
63
64 struct {
65 void __user *_addr;
66 #ifdef __ARCH_SI_TRAPNO
67 int _trapno;
68 #endif
69 #ifdef __ia64__
70 int _imm;
71 unsigned int _flags;
72 unsigned long _isr;
73 #endif
74
75 #define __ADDR_BND_PKEY_PAD (__alignof__(void *) < sizeof(short) ? \
76 sizeof(short) : __alignof__(void *))
77 union {
78
79
80
81
82 short _addr_lsb;
83
84 struct {
85 char _dummy_bnd[__ADDR_BND_PKEY_PAD];
86 void __user *_lower;
87 void __user *_upper;
88 } _addr_bnd;
89
90 struct {
91 char _dummy_pkey[__ADDR_BND_PKEY_PAD];
92 __u32 _pkey;
93 } _addr_pkey;
94 };
95 } _sigfault;
96
97
98 struct {
99 __ARCH_SI_BAND_T _band;
100 int _fd;
101 } _sigpoll;
102
103
104 struct {
105 void __user *_call_addr;
106 int _syscall;
107 unsigned int _arch;
108 } _sigsys;
109 };
110
111 #ifndef __ARCH_HAS_SWAPPED_SIGINFO
112 #define __SIGINFO \
113 struct { \
114 int si_signo; \
115 int si_errno; \
116 int si_code; \
117 union __sifields _sifields; \
118 }
119 #else
120 #define __SIGINFO \
121 struct { \
122 int si_signo; \
123 int si_code; \
124 int si_errno; \
125 union __sifields _sifields; \
126 }
127 #endif
128
129 typedef struct siginfo {
130 union {
131 __SIGINFO;
132 int _si_pad[SI_MAX_SIZE/sizeof(int)];
133 };
134 } __ARCH_SI_ATTRIBUTES siginfo_t;
135
136
137
138
139 #define si_pid _sifields._kill._pid
140 #define si_uid _sifields._kill._uid
141 #define si_tid _sifields._timer._tid
142 #define si_overrun _sifields._timer._overrun
143 #define si_sys_private _sifields._timer._sys_private
144 #define si_status _sifields._sigchld._status
145 #define si_utime _sifields._sigchld._utime
146 #define si_stime _sifields._sigchld._stime
147 #define si_value _sifields._rt._sigval
148 #define si_int _sifields._rt._sigval.sival_int
149 #define si_ptr _sifields._rt._sigval.sival_ptr
150 #define si_addr _sifields._sigfault._addr
151 #ifdef __ARCH_SI_TRAPNO
152 #define si_trapno _sifields._sigfault._trapno
153 #endif
154 #define si_addr_lsb _sifields._sigfault._addr_lsb
155 #define si_lower _sifields._sigfault._addr_bnd._lower
156 #define si_upper _sifields._sigfault._addr_bnd._upper
157 #define si_pkey _sifields._sigfault._addr_pkey._pkey
158 #define si_band _sifields._sigpoll._band
159 #define si_fd _sifields._sigpoll._fd
160 #define si_call_addr _sifields._sigsys._call_addr
161 #define si_syscall _sifields._sigsys._syscall
162 #define si_arch _sifields._sigsys._arch
163
164
165
166
167
168 #define SI_USER 0
169 #define SI_KERNEL 0x80
170 #define SI_QUEUE -1
171 #define SI_TIMER -2
172 #define SI_MESGQ -3
173 #define SI_ASYNCIO -4
174 #define SI_SIGIO -5
175 #define SI_TKILL -6
176 #define SI_DETHREAD -7
177 #define SI_ASYNCNL -60
178
179 #define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
180 #define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
181
182
183
184
185 #define ILL_ILLOPC 1
186 #define ILL_ILLOPN 2
187 #define ILL_ILLADR 3
188 #define ILL_ILLTRP 4
189 #define ILL_PRVOPC 5
190 #define ILL_PRVREG 6
191 #define ILL_COPROC 7
192 #define ILL_BADSTK 8
193 #define ILL_BADIADDR 9
194 #define __ILL_BREAK 10
195 #define __ILL_BNDMOD 11
196 #define NSIGILL 11
197
198
199
200
201 #define FPE_INTDIV 1
202 #define FPE_INTOVF 2
203 #define FPE_FLTDIV 3
204 #define FPE_FLTOVF 4
205 #define FPE_FLTUND 5
206 #define FPE_FLTRES 6
207 #define FPE_FLTINV 7
208 #define FPE_FLTSUB 8
209 #define __FPE_DECOVF 9
210 #define __FPE_DECDIV 10
211 #define __FPE_DECERR 11
212 #define __FPE_INVASC 12
213 #define __FPE_INVDEC 13
214 #define FPE_FLTUNK 14
215 #define FPE_CONDTRAP 15
216 #define NSIGFPE 15
217
218
219
220
221 #define SEGV_MAPERR 1
222 #define SEGV_ACCERR 2
223 #define SEGV_BNDERR 3
224 #ifdef __ia64__
225 # define __SEGV_PSTKOVF 4
226 #else
227 # define SEGV_PKUERR 4
228 #endif
229 #define SEGV_ACCADI 5
230 #define SEGV_ADIDERR 6
231 #define SEGV_ADIPERR 7
232 #define NSIGSEGV 7
233
234
235
236
237 #define BUS_ADRALN 1
238 #define BUS_ADRERR 2
239 #define BUS_OBJERR 3
240
241 #define BUS_MCEERR_AR 4
242
243 #define BUS_MCEERR_AO 5
244 #define NSIGBUS 5
245
246
247
248
249 #define TRAP_BRKPT 1
250 #define TRAP_TRACE 2
251 #define TRAP_BRANCH 3
252 #define TRAP_HWBKPT 4
253 #define TRAP_UNK 5
254 #define NSIGTRAP 5
255
256
257
258
259
260
261
262
263
264 #define CLD_EXITED 1
265 #define CLD_KILLED 2
266 #define CLD_DUMPED 3
267 #define CLD_TRAPPED 4
268 #define CLD_STOPPED 5
269 #define CLD_CONTINUED 6
270 #define NSIGCHLD 6
271
272
273
274
275 #define POLL_IN 1
276 #define POLL_OUT 2
277 #define POLL_MSG 3
278 #define POLL_ERR 4
279 #define POLL_PRI 5
280 #define POLL_HUP 6
281 #define NSIGPOLL 6
282
283
284
285
286 #define SYS_SECCOMP 1
287 #define NSIGSYS 1
288
289
290
291
292 #define EMT_TAGOVF 1
293 #define NSIGEMT 1
294
295
296
297
298
299
300
301
302
303 #define SIGEV_SIGNAL 0
304 #define SIGEV_NONE 1
305 #define SIGEV_THREAD 2
306 #define SIGEV_THREAD_ID 4
307
308
309
310
311
312 #ifndef __ARCH_SIGEV_PREAMBLE_SIZE
313 #define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(sigval_t))
314 #endif
315
316 #define SIGEV_MAX_SIZE 64
317 #define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE) \
318 / sizeof(int))
319
320 typedef struct sigevent {
321 sigval_t sigev_value;
322 int sigev_signo;
323 int sigev_notify;
324 union {
325 int _pad[SIGEV_PAD_SIZE];
326 int _tid;
327
328 struct {
329 void (*_function)(sigval_t);
330 void *_attribute;
331 } _sigev_thread;
332 } _sigev_un;
333 } sigevent_t;
334
335 #define sigev_notify_function _sigev_un._sigev_thread._function
336 #define sigev_notify_attributes _sigev_un._sigev_thread._attribute
337 #define sigev_notify_thread_id _sigev_un._tid
338
339
340 #endif