xref: /openbmc/linux/arch/mips/include/uapi/asm/siginfo.h (revision d8bcaabe)
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 <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 			__kernel_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 			__kernel_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 			__kernel_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 			__kernel_pid_t _pid;	/* which child */
68 			__ARCH_SI_UID_T _uid;	/* sender's uid */
69 			int _status;		/* exit code */
70 			__kernel_clock_t _utime;
71 			__kernel_clock_t _stime;
72 		} _sigchld;
73 
74 		/* IRIX SIGCHLD */
75 		struct {
76 			__kernel_pid_t _pid;	/* which child */
77 			__kernel_clock_t _utime;
78 			int _status;		/* exit code */
79 			__kernel_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 			union {
90 				/* used when si_code=SEGV_BNDERR */
91 				struct {
92 					void __user *_lower;
93 					void __user *_upper;
94 				} _addr_bnd;
95 				/* used when si_code=SEGV_PKUERR */
96 				__u32 _pkey;
97 			};
98 		} _sigfault;
99 
100 		/* SIGPOLL, SIGXFSZ (To do ...)	 */
101 		struct {
102 			__ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
103 			int _fd;
104 		} _sigpoll;
105 
106 		/* SIGSYS */
107 		struct {
108 			void __user *_call_addr; /* calling user insn */
109 			int _syscall;	/* triggering system call number */
110 			unsigned int _arch;	/* AUDIT_ARCH_* of syscall */
111 		} _sigsys;
112 	} _sifields;
113 } siginfo_t;
114 
115 /*
116  * si_code values
117  * Again these have been chosen to be IRIX compatible.
118  */
119 #undef SI_ASYNCIO
120 #undef SI_TIMER
121 #undef SI_MESGQ
122 #define SI_ASYNCIO	-2	/* sent by AIO completion */
123 #define SI_TIMER	-3	/* sent by timer expiration */
124 #define SI_MESGQ	-4	/* sent by real time mesq state change */
125 
126 #endif /* _UAPI_ASM_SIGINFO_H */
127