xref: /linux/arch/mips/include/uapi/asm/siginfo.h (revision 2ba9268dd603d23e17643437b2246acb6844953b)
1 /*
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
4  * for more details.
5  *
6  * Copyright (C) 1998, 1999, 2001, 2003 Ralf Baechle
7  * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
8  */
9 #ifndef _UAPI_ASM_SIGINFO_H
10 #define _UAPI_ASM_SIGINFO_H
11 
12 
13 #define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
14 #undef __ARCH_SI_TRAPNO /* exception code needs to fill this ...  */
15 
16 #define HAVE_ARCH_SIGINFO_T
17 
18 /*
19  * Careful to keep union _sifields from shifting ...
20  */
21 #if _MIPS_SZLONG == 32
22 #define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
23 #elif _MIPS_SZLONG == 64
24 #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
25 #else
26 #error _MIPS_SZLONG neither 32 nor 64
27 #endif
28 
29 #define __ARCH_SIGSYS
30 
31 #include <uapi/asm-generic/siginfo.h>
32 
33 /* We can't use generic siginfo_t, because our si_code and si_errno are swapped */
34 typedef struct siginfo {
35 	int si_signo;
36 	int si_code;
37 	int si_errno;
38 	int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3];
39 
40 	union {
41 		int _pad[SI_PAD_SIZE];
42 
43 		/* kill() */
44 		struct {
45 			pid_t _pid;		/* sender's pid */
46 			__ARCH_SI_UID_T _uid;	/* sender's uid */
47 		} _kill;
48 
49 		/* POSIX.1b timers */
50 		struct {
51 			timer_t _tid;		/* timer id */
52 			int _overrun;		/* overrun count */
53 			char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
54 			sigval_t _sigval;	/* same as below */
55 			int _sys_private;	/* not to be passed to user */
56 		} _timer;
57 
58 		/* POSIX.1b signals */
59 		struct {
60 			pid_t _pid;		/* sender's pid */
61 			__ARCH_SI_UID_T _uid;	/* sender's uid */
62 			sigval_t _sigval;
63 		} _rt;
64 
65 		/* SIGCHLD */
66 		struct {
67 			pid_t _pid;		/* which child */
68 			__ARCH_SI_UID_T _uid;	/* sender's uid */
69 			int _status;		/* exit code */
70 			clock_t _utime;
71 			clock_t _stime;
72 		} _sigchld;
73 
74 		/* IRIX SIGCHLD */
75 		struct {
76 			pid_t _pid;		/* which child */
77 			clock_t _utime;
78 			int _status;		/* exit code */
79 			clock_t _stime;
80 		} _irix_sigchld;
81 
82 		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
83 		struct {
84 			void __user *_addr; /* faulting insn/memory ref. */
85 #ifdef __ARCH_SI_TRAPNO
86 			int _trapno;	/* TRAP # which caused the signal */
87 #endif
88 			short _addr_lsb;
89 			struct {
90 				void __user *_lower;
91 				void __user *_upper;
92 			} _addr_bnd;
93 		} _sigfault;
94 
95 		/* SIGPOLL, SIGXFSZ (To do ...)	 */
96 		struct {
97 			__ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
98 			int _fd;
99 		} _sigpoll;
100 
101 		/* SIGSYS */
102 		struct {
103 			void __user *_call_addr; /* calling user insn */
104 			int _syscall;	/* triggering system call number */
105 			unsigned int _arch;	/* AUDIT_ARCH_* of syscall */
106 		} _sigsys;
107 	} _sifields;
108 } siginfo_t;
109 
110 /*
111  * si_code values
112  * Again these have been chosen to be IRIX compatible.
113  */
114 #undef SI_ASYNCIO
115 #undef SI_TIMER
116 #undef SI_MESGQ
117 #define SI_ASYNCIO	-2	/* sent by AIO completion */
118 #define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
119 #define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
120 
121 #include <asm-generic/siginfo.h>
122 
123 #endif /* _UAPI_ASM_SIGINFO_H */
124