First Support on Ginger and OMAP TI
[linux-ginger.git] / arch / m68k / include / asm / siginfo.h
blobca7dde8fd22348987b85dcdf269996d9a4446bd2
1 #ifndef _M68K_SIGINFO_H
2 #define _M68K_SIGINFO_H
4 #ifndef __uClinux__
5 #define HAVE_ARCH_SIGINFO_T
6 #define HAVE_ARCH_COPY_SIGINFO
7 #endif
9 #include <asm-generic/siginfo.h>
11 #ifndef __uClinux__
13 typedef struct siginfo {
14 int si_signo;
15 int si_errno;
16 int si_code;
18 union {
19 int _pad[SI_PAD_SIZE];
21 /* kill() */
22 struct {
23 __kernel_pid_t _pid; /* sender's pid */
24 __kernel_uid_t _uid; /* backwards compatibility */
25 __kernel_uid32_t _uid32; /* sender's uid */
26 } _kill;
28 /* POSIX.1b timers */
29 struct {
30 timer_t _tid; /* timer id */
31 int _overrun; /* overrun count */
32 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
33 sigval_t _sigval; /* same as below */
34 int _sys_private; /* not to be passed to user */
35 } _timer;
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;
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;
55 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
56 struct {
57 void *_addr; /* faulting insn/memory ref. */
58 } _sigfault;
60 /* SIGPOLL */
61 struct {
62 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
63 int _fd;
64 } _sigpoll;
65 } _sifields;
66 } siginfo_t;
68 #define UID16_SIGINFO_COMPAT_NEEDED
71 * How these fields are to be accessed.
73 #undef si_uid
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
81 #ifdef __KERNEL__
83 #include <linux/string.h>
85 static inline void copy_siginfo(struct siginfo *to, struct siginfo *from)
87 if (from->si_code < 0)
88 memcpy(to, from, sizeof(*to));
89 else
90 /* _sigchld is currently the largest know union member */
91 memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld));
94 #endif /* __KERNEL__ */
95 #endif /* !__uClinux__ */
97 #endif