1 #ifndef _M68K_SIGINFO_H
2 #define _M68K_SIGINFO_H
3
4 #include <linux/types.h>
5
6 /* This is copied from asm-alpha/siginfo.h. */
7
8 typedef union sigval {
9 int sival_int;
10 void *sival_ptr;
11 } sigval_t;
12
13 #define SI_MAX_SIZE 128
14 #define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 3)
15
16 typedef struct siginfo {
17 int si_signo;
18 int si_errno;
19 int si_code;
20
21 union {
22 int _pad[SI_PAD_SIZE];
23
24 /* kill() */
25 struct {
26 __kernel_pid_t _pid; /* sender's pid */
27 __kernel_uid_t _uid; /* backwards compatibility */
28 __kernel_uid32_t _uid32; /* sender's uid */
29 } _kill;
30
31 /* POSIX.1b timers */
32 struct {
33 unsigned int _timer1;
34 unsigned int _timer2;
35 } _timer;
36
37 /* POSIX.1b signals */
38 struct {
39 __kernel_pid_t _pid; /* sender's pid */
40 __kernel_uid_t _uid; /* backwards compatibility */
41 sigval_t _sigval;
42 __kernel_uid32_t _uid32; /* sender's uid */
43 } _rt;
44
45 /* SIGCHLD */
46 struct {
47 __kernel_pid_t _pid; /* which child */
48 __kernel_uid_t _uid; /* backwards compatibility */
49 int _status; /* exit code */
50 clock_t _utime;
51 clock_t _stime;
52 __kernel_uid32_t _uid32; /* sender's uid */
53 } _sigchld;
54
55 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
56 struct {
57 void *_addr; /* faulting insn/memory ref. */
58 } _sigfault;
59
60 /* SIGPOLL */
61 struct {
62 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
63 int _fd;
64 } _sigpoll;
65 } _sifields;
66 } siginfo_t;
67
68 #define UID16_SIGINFO_COMPAT_NEEDED
69
70 /*
71 * How these fields are to be accessed.
72 */
73 #define si_pid _sifields._kill._pid
74 #ifdef __KERNEL__
75 #define si_uid _sifields._kill._uid32
76 #define si_uid16 _sifields._kill._uid
77 #else
78 #define si_uid _sifields._kill._uid
79 #endif /* __KERNEL__ */
80 #define si_status _sifields._sigchld._status
81 #define si_utime _sifields._sigchld._utime
82 #define si_stime _sifields._sigchld._stime
83 #define si_value _sifields._rt._sigval
84 #define si_int _sifields._rt._sigval.sival_int
85 #define si_ptr _sifields._rt._sigval.sival_ptr
86 #define si_addr _sifields._sigfault._addr
87 #define si_band _sifields._sigpoll._band
88 #define si_fd _sifields._sigpoll._fd
89
90 #ifdef __KERNEL__
91 #define __SI_MASK 0xffff0000
92 #define __SI_KILL (0 << 16)
93 #define __SI_TIMER (1 << 16)
94 #define __SI_POLL (2 << 16)
95 #define __SI_FAULT (3 << 16)
96 #define __SI_CHLD (4 << 16)
97 #define __SI_RT (5 << 16)
98 #define __SI_CODE(T,N) ((T) << 16 | ((N) & 0xffff))
99 #else
100 #define __SI_KILL 0
101 #define __SI_TIMER 0
102 #define __SI_POLL 0
103 #define __SI_FAULT 0
104 #define __SI_CHLD 0
105 #define __SI_RT 0
106 #define __SI_CODE(T,N) (N)
107 #endif
108
109 /*
110 * si_code values
111 * Digital reserves positive values for kernel-generated signals.
112 */
113 #define SI_USER 0 /* sent by kill, sigsend, raise */
114 #define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
115 #define SI_QUEUE -1 /* sent by sigqueue */
116 #define SI_TIMER __SI_CODE(__SI_TIMER,-2) /* sent by timer expiration */
117 #define SI_MESGQ -3 /* sent by real time mesq state change */
118 #define SI_ASYNCIO -4 /* sent by AIO completion */
119 #define SI_SIGIO -5 /* sent by queued SIGIO */
120
121 #define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
122 #define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
123
124 /*
125 * SIGILL si_codes
126 */
127 #define ILL_ILLOPC (__SI_FAULT|1) /* illegal opcode */
128 #define ILL_ILLOPN (__SI_FAULT|2) /* illegal operand */
129 #define ILL_ILLADR (__SI_FAULT|3) /* illegal addressing mode */
130 #define ILL_ILLTRP (__SI_FAULT|4) /* illegal trap */
131 #define ILL_PRVOPC (__SI_FAULT|5) /* privileged opcode */
132 #define ILL_PRVREG (__SI_FAULT|6) /* privileged register */
133 #define ILL_COPROC (__SI_FAULT|7) /* coprocessor error */
134 #define ILL_BADSTK (__SI_FAULT|8) /* internal stack error */
135 #define NSIGILL 8
136
137 /*
138 * SIGFPE si_codes
139 */
140 #define FPE_INTDIV (__SI_FAULT|1) /* integer divide by zero */
141 #define FPE_INTOVF (__SI_FAULT|2) /* integer overflow */
142 #define FPE_FLTDIV (__SI_FAULT|3) /* floating point divide by zero */
143 #define FPE_FLTOVF (__SI_FAULT|4) /* floating point overflow */
144 #define FPE_FLTUND (__SI_FAULT|5) /* floating point underflow */
145 #define FPE_FLTRES (__SI_FAULT|6) /* floating point inexact result */
146 #define FPE_FLTINV (__SI_FAULT|7) /* floating point invalid operation */
147 #define FPE_FLTSUB (__SI_FAULT|8) /* subscript out of range */
148 #define NSIGFPE 8
149
150 /*
151 * SIGSEGV si_codes
152 */
153 #define SEGV_MAPERR (__SI_FAULT|1) /* address not mapped to object */
154 #define SEGV_ACCERR (__SI_FAULT|2) /* invalid permissions for mapped object */
155 #define NSIGSEGV 2
156
157 /*
158 * SIGBUS si_codes
159 */
160 #define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */
161 #define BUS_ADRERR (__SI_FAULT|2) /* non-existant physical address */
162 #define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */
163 #define NSIGBUS 3
164
165 /*
166 * SIGTRAP si_codes
167 */
168 #define TRAP_BRKPT (__SI_FAULT|1) /* process breakpoint */
169 #define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */
170 #define NSIGTRAP 2
171
172 /*
173 * SIGCHLD si_codes
174 */
175 #define CLD_EXITED (__SI_CHLD|1) /* child has exited */
176 #define CLD_KILLED (__SI_CHLD|2) /* child was killed */
177 #define CLD_DUMPED (__SI_CHLD|3) /* child terminated abnormally */
178 #define CLD_TRAPPED (__SI_CHLD|4) /* traced child has trapped */
179 #define CLD_STOPPED (__SI_CHLD|5) /* child has stopped */
180 #define CLD_CONTINUED (__SI_CHLD|6) /* stopped child has continued */
181 #define NSIGCHLD 6
182
183 /*
184 * SIGPOLL si_codes
185 */
186 #define POLL_IN (__SI_POLL|1) /* data input available */
187 #define POLL_OUT (__SI_POLL|2) /* output buffers available */
188 #define POLL_MSG (__SI_POLL|3) /* input message available */
189 #define POLL_ERR (__SI_POLL|4) /* i/o error */
190 #define POLL_PRI (__SI_POLL|5) /* high priority input available */
191 #define POLL_HUP (__SI_POLL|6) /* device disconnected */
192 #define NSIGPOLL 6
193
194 /*
195 * sigevent definitions
196 *
197 * It seems likely that SIGEV_THREAD will have to be handled from
198 * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
199 * thread manager then catches and does the appropriate nonsense.
200 * However, everything is written out here so as to not get lost.
201 */
202 #define SIGEV_SIGNAL 0 /* notify via signal */
203 #define SIGEV_NONE 1 /* other notification: meaningless */
204 #define SIGEV_THREAD 2 /* deliver via thread creation */
205
206 #define SIGEV_MAX_SIZE 64
207 #define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
208
209 typedef struct sigevent {
210 sigval_t sigev_value;
211 int sigev_signo;
212 int sigev_notify;
213 union {
214 int _pad[SIGEV_PAD_SIZE];
215
216 struct {
217 void (*_function)(sigval_t);
218 void *_attribute; /* really pthread_attr_t */
219 } _sigev_thread;
220 } _sigev_un;
221 } sigevent_t;
222
223 #define sigev_notify_function _sigev_un._sigev_thread._function
224 #define sigev_notify_attributes _sigev_un._sigev_thread._attribute
225
226 #ifdef __KERNEL__
227 #include <linux/string.h>
228
229 extern inline void copy_siginfo(siginfo_t *to, siginfo_t *from)
230 {
231 if (from->si_code < 0)
232 memcpy(to, from, sizeof(siginfo_t));
233 else
234 /* _sigchld is currently the largest know union member */
235 memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld));
236 }
237
238 extern int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from);
239
240 #endif /* __KERNEL__ */
241
242 #endif
243
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.