Merge branch 'x86/uv' into x86/core
[linux-2.6] / arch / m68k / include / asm / siginfo_mm.h
1 #ifndef _M68K_SIGINFO_H
2 #define _M68K_SIGINFO_H
3
4 #define HAVE_ARCH_SIGINFO_T
5 #define HAVE_ARCH_COPY_SIGINFO
6
7 #include <asm-generic/siginfo.h>
8
9 typedef struct siginfo {
10         int si_signo;
11         int si_errno;
12         int si_code;
13
14         union {
15                 int _pad[SI_PAD_SIZE];
16
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;
23
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;
32
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;
40
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;
50
51                 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
52                 struct {
53                         void *_addr; /* faulting insn/memory ref. */
54                 } _sigfault;
55
56                 /* SIGPOLL */
57                 struct {
58                         int _band;      /* POLL_IN, POLL_OUT, POLL_MSG */
59                         int _fd;
60                 } _sigpoll;
61         } _sifields;
62 } siginfo_t;
63
64 #define UID16_SIGINFO_COMPAT_NEEDED
65
66 /*
67  * How these fields are to be accessed.
68  */
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
76
77 #ifdef __KERNEL__
78
79 #include <linux/string.h>
80
81 static inline void copy_siginfo(struct siginfo *to, struct siginfo *from)
82 {
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));
88 }
89
90 #endif /* __KERNEL__ */
91
92 #endif