Linux 2.6.26-rc5
[linux-2.6/openmoko-kernel/knife-kernel.git] / include / asm-m68k / siginfo.h
blob05a8d6d90b58304055b01278f9a6bb8a88929aa9
1 #ifndef _M68K_SIGINFO_H
2 #define _M68K_SIGINFO_H
4 #define HAVE_ARCH_SIGINFO_T
5 #define HAVE_ARCH_COPY_SIGINFO
7 #include <asm-generic/siginfo.h>
9 typedef struct siginfo {
10 int si_signo;
11 int si_errno;
12 int si_code;
14 union {
15 int _pad[SI_PAD_SIZE];
17 /* kill() */
18 struct {
19 __kernel_pid_t _pid; /* sender's pid */
20 __kernel_uid_t _uid; /* backwards compatibility */
21 __kernel_uid32_t _uid32; /* sender's uid */
22 } _kill;
24 /* POSIX.1b timers */
25 struct {
26 timer_t _tid; /* timer id */
27 int _overrun; /* overrun count */
28 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
29 sigval_t _sigval; /* same as below */
30 int _sys_private; /* not to be passed to user */
31 } _timer;
33 /* POSIX.1b signals */
34 struct {
35 __kernel_pid_t _pid; /* sender's pid */
36 __kernel_uid_t _uid; /* backwards compatibility */
37 sigval_t _sigval;
38 __kernel_uid32_t _uid32; /* sender's uid */
39 } _rt;
41 /* SIGCHLD */
42 struct {
43 __kernel_pid_t _pid; /* which child */
44 __kernel_uid_t _uid; /* backwards compatibility */
45 int _status; /* exit code */
46 clock_t _utime;
47 clock_t _stime;
48 __kernel_uid32_t _uid32; /* sender's uid */
49 } _sigchld;
51 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
52 struct {
53 void *_addr; /* faulting insn/memory ref. */
54 } _sigfault;
56 /* SIGPOLL */
57 struct {
58 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
59 int _fd;
60 } _sigpoll;
61 } _sifields;
62 } siginfo_t;
64 #define UID16_SIGINFO_COMPAT_NEEDED
67 * How these fields are to be accessed.
69 #undef si_uid
70 #ifdef __KERNEL__
71 #define si_uid _sifields._kill._uid32
72 #define si_uid16 _sifields._kill._uid
73 #else
74 #define si_uid _sifields._kill._uid
75 #endif
77 #ifdef __KERNEL__
79 #include <linux/string.h>
81 static inline void copy_siginfo(struct siginfo *to, struct siginfo *from)
83 if (from->si_code < 0)
84 memcpy(to, from, sizeof(*to));
85 else
86 /* _sigchld is currently the largest know union member */
87 memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld));
90 #endif /* __KERNEL__ */
92 #endif