diff options
author | Maxim Kuvyrkov <maxim@codesourcery.com> | 2009-12-23 14:28:42 -0500 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2010-02-27 12:31:17 -0500 |
commit | 5da3a65d2d1ba333d61999640ef241f150c69c6b (patch) | |
tree | f991cfea478322ecf6608456855376ba6fdfa0ad /arch/m68k/include/asm | |
parent | 99e11ab20b26b3236490ae687ab309c2601d180b (diff) |
m68k: Switch to generic siginfo layout
This patch switches m68k to generic siginfo layout. The custom layout
of m68k's `struct siginfo' had several issues due to not considering
aliasing of members in the union, e.g., _uid32 was at different offsets
in ._kill, ._rt and ._sigchld.
Signed-off-by: Maxim Kuvyrkov <maxim@codesourcery.com>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/include/asm')
-rw-r--r-- | arch/m68k/include/asm/siginfo.h | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/arch/m68k/include/asm/siginfo.h b/arch/m68k/include/asm/siginfo.h index ca7dde8fd223..851d3d784b53 100644 --- a/arch/m68k/include/asm/siginfo.h +++ b/arch/m68k/include/asm/siginfo.h | |||
@@ -1,97 +1,6 @@ | |||
1 | #ifndef _M68K_SIGINFO_H | 1 | #ifndef _M68K_SIGINFO_H |
2 | #define _M68K_SIGINFO_H | 2 | #define _M68K_SIGINFO_H |
3 | 3 | ||
4 | #ifndef __uClinux__ | ||
5 | #define HAVE_ARCH_SIGINFO_T | ||
6 | #define HAVE_ARCH_COPY_SIGINFO | ||
7 | #endif | ||
8 | |||
9 | #include <asm-generic/siginfo.h> | 4 | #include <asm-generic/siginfo.h> |
10 | 5 | ||
11 | #ifndef __uClinux__ | ||
12 | |||
13 | typedef struct siginfo { | ||
14 | int si_signo; | ||
15 | int si_errno; | ||
16 | int si_code; | ||
17 | |||
18 | union { | ||
19 | int _pad[SI_PAD_SIZE]; | ||
20 | |||
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; | ||
27 | |||
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; | ||
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 | #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 | ||
80 | |||
81 | #ifdef __KERNEL__ | ||
82 | |||
83 | #include <linux/string.h> | ||
84 | |||
85 | static inline void copy_siginfo(struct siginfo *to, struct siginfo *from) | ||
86 | { | ||
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)); | ||
92 | } | ||
93 | |||
94 | #endif /* __KERNEL__ */ | ||
95 | #endif /* !__uClinux__ */ | ||
96 | |||
97 | #endif | 6 | #endif |