diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-10-04 20:15:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-05 14:05:16 -0400 |
commit | 751f409db6216ebd134a94f6dcd97779933a5106 (patch) | |
tree | 7b059d89cf303ed2d37f36e8f8604e2295e3566a /arch | |
parent | 5ab1c309b344880d81494e9eab7fb27682bc6d9d (diff) |
compat: move compat_siginfo_t definition to asm/compat.h
This is a preparatory patch for the introduction of NT_SIGINFO elf note.
Make the location of compat_siginfo_t uniform across eight architectures
which have it. Now it can be pulled in by including asm/compat.h or
linux/compat.h.
Most of the copies are verbatim. compat_uid[32]_t had to be replaced by
__compat_uid[32]_t. compat_uptr_t had to be moved up before
compat_siginfo_t in asm/compat.h on a several architectures (tile already
had it moved up). compat_sigval_t had to be relocated from linux/compat.h
to asm/compat.h.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Amerigo Wang <amwang@redhat.com>
Cc: "Jonathan M. Foote" <jmfoote@cert.org>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Pedro Alves <palves@redhat.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm64/include/asm/compat.h | 60 | ||||
-rw-r--r-- | arch/arm64/kernel/signal32.c | 53 | ||||
-rw-r--r-- | arch/mips/include/asm/compat-signal.h | 62 | ||||
-rw-r--r-- | arch/mips/include/asm/compat.h | 69 | ||||
-rw-r--r-- | arch/parisc/include/asm/compat.h | 59 | ||||
-rw-r--r-- | arch/parisc/kernel/signal32.h | 52 | ||||
-rw-r--r-- | arch/powerpc/include/asm/compat.h | 60 | ||||
-rw-r--r-- | arch/powerpc/include/asm/siginfo.h | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/ppc32.h | 51 | ||||
-rw-r--r-- | arch/s390/include/asm/compat.h | 75 | ||||
-rw-r--r-- | arch/s390/kernel/compat_linux.h | 68 | ||||
-rw-r--r-- | arch/sparc/include/asm/compat.h | 61 | ||||
-rw-r--r-- | arch/sparc/include/asm/siginfo.h | 1 | ||||
-rw-r--r-- | arch/sparc/kernel/signal32.c | 52 | ||||
-rw-r--r-- | arch/tile/include/asm/compat.h | 62 | ||||
-rw-r--r-- | arch/tile/kernel/compat_signal.c | 57 | ||||
-rw-r--r-- | arch/x86/include/asm/compat.h | 74 | ||||
-rw-r--r-- | arch/x86/include/asm/ia32.h | 67 |
18 files changed, 513 insertions, 471 deletions
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index a670a33ad736..37e610dc084e 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h | |||
@@ -55,6 +55,7 @@ typedef s64 compat_s64; | |||
55 | typedef u32 compat_uint_t; | 55 | typedef u32 compat_uint_t; |
56 | typedef u32 compat_ulong_t; | 56 | typedef u32 compat_ulong_t; |
57 | typedef u64 compat_u64; | 57 | typedef u64 compat_u64; |
58 | typedef u32 compat_uptr_t; | ||
58 | 59 | ||
59 | struct compat_timespec { | 60 | struct compat_timespec { |
60 | compat_time_t tv_sec; | 61 | compat_time_t tv_sec; |
@@ -130,6 +131,64 @@ typedef u32 compat_old_sigset_t; | |||
130 | 131 | ||
131 | typedef u32 compat_sigset_word; | 132 | typedef u32 compat_sigset_word; |
132 | 133 | ||
134 | typedef union compat_sigval { | ||
135 | compat_int_t sival_int; | ||
136 | compat_uptr_t sival_ptr; | ||
137 | } compat_sigval_t; | ||
138 | |||
139 | typedef struct compat_siginfo { | ||
140 | int si_signo; | ||
141 | int si_errno; | ||
142 | int si_code; | ||
143 | |||
144 | union { | ||
145 | /* The padding is the same size as AArch64. */ | ||
146 | int _pad[128/sizeof(int) - 3]; | ||
147 | |||
148 | /* kill() */ | ||
149 | struct { | ||
150 | compat_pid_t _pid; /* sender's pid */ | ||
151 | __compat_uid32_t _uid; /* sender's uid */ | ||
152 | } _kill; | ||
153 | |||
154 | /* POSIX.1b timers */ | ||
155 | struct { | ||
156 | compat_timer_t _tid; /* timer id */ | ||
157 | int _overrun; /* overrun count */ | ||
158 | compat_sigval_t _sigval; /* same as below */ | ||
159 | int _sys_private; /* not to be passed to user */ | ||
160 | } _timer; | ||
161 | |||
162 | /* POSIX.1b signals */ | ||
163 | struct { | ||
164 | compat_pid_t _pid; /* sender's pid */ | ||
165 | __compat_uid32_t _uid; /* sender's uid */ | ||
166 | compat_sigval_t _sigval; | ||
167 | } _rt; | ||
168 | |||
169 | /* SIGCHLD */ | ||
170 | struct { | ||
171 | compat_pid_t _pid; /* which child */ | ||
172 | __compat_uid32_t _uid; /* sender's uid */ | ||
173 | int _status; /* exit code */ | ||
174 | compat_clock_t _utime; | ||
175 | compat_clock_t _stime; | ||
176 | } _sigchld; | ||
177 | |||
178 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
179 | struct { | ||
180 | compat_uptr_t _addr; /* faulting insn/memory ref. */ | ||
181 | short _addr_lsb; /* LSB of the reported address */ | ||
182 | } _sigfault; | ||
183 | |||
184 | /* SIGPOLL */ | ||
185 | struct { | ||
186 | compat_long_t _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
187 | int _fd; | ||
188 | } _sigpoll; | ||
189 | } _sifields; | ||
190 | } compat_siginfo_t; | ||
191 | |||
133 | #define COMPAT_OFF_T_MAX 0x7fffffff | 192 | #define COMPAT_OFF_T_MAX 0x7fffffff |
134 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL | 193 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL |
135 | 194 | ||
@@ -139,7 +198,6 @@ typedef u32 compat_sigset_word; | |||
139 | * as pointers because the syscall entry code will have | 198 | * as pointers because the syscall entry code will have |
140 | * appropriately converted them already. | 199 | * appropriately converted them already. |
141 | */ | 200 | */ |
142 | typedef u32 compat_uptr_t; | ||
143 | 201 | ||
144 | static inline void __user *compat_ptr(compat_uptr_t uptr) | 202 | static inline void __user *compat_ptr(compat_uptr_t uptr) |
145 | { | 203 | { |
diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c index ac74c2f261e3..0790a87a4346 100644 --- a/arch/arm64/kernel/signal32.c +++ b/arch/arm64/kernel/signal32.c | |||
@@ -30,59 +30,6 @@ | |||
30 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
31 | #include <asm/unistd.h> | 31 | #include <asm/unistd.h> |
32 | 32 | ||
33 | typedef struct compat_siginfo { | ||
34 | int si_signo; | ||
35 | int si_errno; | ||
36 | int si_code; | ||
37 | |||
38 | union { | ||
39 | /* The padding is the same size as AArch64. */ | ||
40 | int _pad[SI_PAD_SIZE]; | ||
41 | |||
42 | /* kill() */ | ||
43 | struct { | ||
44 | compat_pid_t _pid; /* sender's pid */ | ||
45 | __compat_uid32_t _uid; /* sender's uid */ | ||
46 | } _kill; | ||
47 | |||
48 | /* POSIX.1b timers */ | ||
49 | struct { | ||
50 | compat_timer_t _tid; /* timer id */ | ||
51 | int _overrun; /* overrun count */ | ||
52 | compat_sigval_t _sigval; /* same as below */ | ||
53 | int _sys_private; /* not to be passed to user */ | ||
54 | } _timer; | ||
55 | |||
56 | /* POSIX.1b signals */ | ||
57 | struct { | ||
58 | compat_pid_t _pid; /* sender's pid */ | ||
59 | __compat_uid32_t _uid; /* sender's uid */ | ||
60 | compat_sigval_t _sigval; | ||
61 | } _rt; | ||
62 | |||
63 | /* SIGCHLD */ | ||
64 | struct { | ||
65 | compat_pid_t _pid; /* which child */ | ||
66 | __compat_uid32_t _uid; /* sender's uid */ | ||
67 | int _status; /* exit code */ | ||
68 | compat_clock_t _utime; | ||
69 | compat_clock_t _stime; | ||
70 | } _sigchld; | ||
71 | |||
72 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
73 | struct { | ||
74 | compat_uptr_t _addr; /* faulting insn/memory ref. */ | ||
75 | short _addr_lsb; /* LSB of the reported address */ | ||
76 | } _sigfault; | ||
77 | |||
78 | /* SIGPOLL */ | ||
79 | struct { | ||
80 | compat_long_t _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
81 | int _fd; | ||
82 | } _sigpoll; | ||
83 | } _sifields; | ||
84 | } compat_siginfo_t; | ||
85 | |||
86 | struct compat_sigaction { | 33 | struct compat_sigaction { |
87 | compat_uptr_t sa_handler; | 34 | compat_uptr_t sa_handler; |
88 | compat_ulong_t sa_flags; | 35 | compat_ulong_t sa_flags; |
diff --git a/arch/mips/include/asm/compat-signal.h b/arch/mips/include/asm/compat-signal.h index 368a99e5c3e1..6599a901b63e 100644 --- a/arch/mips/include/asm/compat-signal.h +++ b/arch/mips/include/asm/compat-signal.h | |||
@@ -10,68 +10,6 @@ | |||
10 | 10 | ||
11 | #include <asm/uaccess.h> | 11 | #include <asm/uaccess.h> |
12 | 12 | ||
13 | #define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) | ||
14 | |||
15 | typedef struct compat_siginfo { | ||
16 | int si_signo; | ||
17 | int si_code; | ||
18 | int si_errno; | ||
19 | |||
20 | union { | ||
21 | int _pad[SI_PAD_SIZE32]; | ||
22 | |||
23 | /* kill() */ | ||
24 | struct { | ||
25 | compat_pid_t _pid; /* sender's pid */ | ||
26 | compat_uid_t _uid; /* sender's uid */ | ||
27 | } _kill; | ||
28 | |||
29 | /* SIGCHLD */ | ||
30 | struct { | ||
31 | compat_pid_t _pid; /* which child */ | ||
32 | compat_uid_t _uid; /* sender's uid */ | ||
33 | int _status; /* exit code */ | ||
34 | compat_clock_t _utime; | ||
35 | compat_clock_t _stime; | ||
36 | } _sigchld; | ||
37 | |||
38 | /* IRIX SIGCHLD */ | ||
39 | struct { | ||
40 | compat_pid_t _pid; /* which child */ | ||
41 | compat_clock_t _utime; | ||
42 | int _status; /* exit code */ | ||
43 | compat_clock_t _stime; | ||
44 | } _irix_sigchld; | ||
45 | |||
46 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
47 | struct { | ||
48 | s32 _addr; /* faulting insn/memory ref. */ | ||
49 | } _sigfault; | ||
50 | |||
51 | /* SIGPOLL, SIGXFSZ (To do ...) */ | ||
52 | struct { | ||
53 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
54 | int _fd; | ||
55 | } _sigpoll; | ||
56 | |||
57 | /* POSIX.1b timers */ | ||
58 | struct { | ||
59 | timer_t _tid; /* timer id */ | ||
60 | int _overrun; /* overrun count */ | ||
61 | compat_sigval_t _sigval;/* same as below */ | ||
62 | int _sys_private; /* not to be passed to user */ | ||
63 | } _timer; | ||
64 | |||
65 | /* POSIX.1b signals */ | ||
66 | struct { | ||
67 | compat_pid_t _pid; /* sender's pid */ | ||
68 | compat_uid_t _uid; /* sender's uid */ | ||
69 | compat_sigval_t _sigval; | ||
70 | } _rt; | ||
71 | |||
72 | } _sifields; | ||
73 | } compat_siginfo_t; | ||
74 | |||
75 | static inline int __copy_conv_sigset_to_user(compat_sigset_t __user *d, | 13 | static inline int __copy_conv_sigset_to_user(compat_sigset_t __user *d, |
76 | const sigset_t *s) | 14 | const sigset_t *s) |
77 | { | 15 | { |
diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h index b77df0366ee6..58277e0e9cd4 100644 --- a/arch/mips/include/asm/compat.h +++ b/arch/mips/include/asm/compat.h | |||
@@ -43,6 +43,7 @@ typedef s64 compat_s64; | |||
43 | typedef u32 compat_uint_t; | 43 | typedef u32 compat_uint_t; |
44 | typedef u32 compat_ulong_t; | 44 | typedef u32 compat_ulong_t; |
45 | typedef u64 compat_u64; | 45 | typedef u64 compat_u64; |
46 | typedef u32 compat_uptr_t; | ||
46 | 47 | ||
47 | struct compat_timespec { | 48 | struct compat_timespec { |
48 | compat_time_t tv_sec; | 49 | compat_time_t tv_sec; |
@@ -124,6 +125,73 @@ typedef u32 compat_old_sigset_t; /* at least 32 bits */ | |||
124 | 125 | ||
125 | typedef u32 compat_sigset_word; | 126 | typedef u32 compat_sigset_word; |
126 | 127 | ||
128 | typedef union compat_sigval { | ||
129 | compat_int_t sival_int; | ||
130 | compat_uptr_t sival_ptr; | ||
131 | } compat_sigval_t; | ||
132 | |||
133 | #define SI_PAD_SIZE32 (128/sizeof(int) - 3) | ||
134 | |||
135 | typedef struct compat_siginfo { | ||
136 | int si_signo; | ||
137 | int si_code; | ||
138 | int si_errno; | ||
139 | |||
140 | union { | ||
141 | int _pad[SI_PAD_SIZE32]; | ||
142 | |||
143 | /* kill() */ | ||
144 | struct { | ||
145 | compat_pid_t _pid; /* sender's pid */ | ||
146 | __compat_uid_t _uid; /* sender's uid */ | ||
147 | } _kill; | ||
148 | |||
149 | /* SIGCHLD */ | ||
150 | struct { | ||
151 | compat_pid_t _pid; /* which child */ | ||
152 | __compat_uid_t _uid; /* sender's uid */ | ||
153 | int _status; /* exit code */ | ||
154 | compat_clock_t _utime; | ||
155 | compat_clock_t _stime; | ||
156 | } _sigchld; | ||
157 | |||
158 | /* IRIX SIGCHLD */ | ||
159 | struct { | ||
160 | compat_pid_t _pid; /* which child */ | ||
161 | compat_clock_t _utime; | ||
162 | int _status; /* exit code */ | ||
163 | compat_clock_t _stime; | ||
164 | } _irix_sigchld; | ||
165 | |||
166 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
167 | struct { | ||
168 | s32 _addr; /* faulting insn/memory ref. */ | ||
169 | } _sigfault; | ||
170 | |||
171 | /* SIGPOLL, SIGXFSZ (To do ...) */ | ||
172 | struct { | ||
173 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
174 | int _fd; | ||
175 | } _sigpoll; | ||
176 | |||
177 | /* POSIX.1b timers */ | ||
178 | struct { | ||
179 | timer_t _tid; /* timer id */ | ||
180 | int _overrun; /* overrun count */ | ||
181 | compat_sigval_t _sigval;/* same as below */ | ||
182 | int _sys_private; /* not to be passed to user */ | ||
183 | } _timer; | ||
184 | |||
185 | /* POSIX.1b signals */ | ||
186 | struct { | ||
187 | compat_pid_t _pid; /* sender's pid */ | ||
188 | __compat_uid_t _uid; /* sender's uid */ | ||
189 | compat_sigval_t _sigval; | ||
190 | } _rt; | ||
191 | |||
192 | } _sifields; | ||
193 | } compat_siginfo_t; | ||
194 | |||
127 | #define COMPAT_OFF_T_MAX 0x7fffffff | 195 | #define COMPAT_OFF_T_MAX 0x7fffffff |
128 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL | 196 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL |
129 | 197 | ||
@@ -133,7 +201,6 @@ typedef u32 compat_sigset_word; | |||
133 | * as pointers because the syscall entry code will have | 201 | * as pointers because the syscall entry code will have |
134 | * appropriately converted them already. | 202 | * appropriately converted them already. |
135 | */ | 203 | */ |
136 | typedef u32 compat_uptr_t; | ||
137 | 204 | ||
138 | static inline void __user *compat_ptr(compat_uptr_t uptr) | 205 | static inline void __user *compat_ptr(compat_uptr_t uptr) |
139 | { | 206 | { |
diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h index 760f331d4fa3..db7a662691a8 100644 --- a/arch/parisc/include/asm/compat.h +++ b/arch/parisc/include/asm/compat.h | |||
@@ -36,6 +36,7 @@ typedef s64 compat_s64; | |||
36 | typedef u32 compat_uint_t; | 36 | typedef u32 compat_uint_t; |
37 | typedef u32 compat_ulong_t; | 37 | typedef u32 compat_ulong_t; |
38 | typedef u64 compat_u64; | 38 | typedef u64 compat_u64; |
39 | typedef u32 compat_uptr_t; | ||
39 | 40 | ||
40 | struct compat_timespec { | 41 | struct compat_timespec { |
41 | compat_time_t tv_sec; | 42 | compat_time_t tv_sec; |
@@ -127,6 +128,63 @@ typedef u32 compat_old_sigset_t; /* at least 32 bits */ | |||
127 | 128 | ||
128 | typedef u32 compat_sigset_word; | 129 | typedef u32 compat_sigset_word; |
129 | 130 | ||
131 | typedef union compat_sigval { | ||
132 | compat_int_t sival_int; | ||
133 | compat_uptr_t sival_ptr; | ||
134 | } compat_sigval_t; | ||
135 | |||
136 | typedef struct compat_siginfo { | ||
137 | int si_signo; | ||
138 | int si_errno; | ||
139 | int si_code; | ||
140 | |||
141 | union { | ||
142 | int _pad[128/sizeof(int) - 3]; | ||
143 | |||
144 | /* kill() */ | ||
145 | struct { | ||
146 | unsigned int _pid; /* sender's pid */ | ||
147 | unsigned int _uid; /* sender's uid */ | ||
148 | } _kill; | ||
149 | |||
150 | /* POSIX.1b timers */ | ||
151 | struct { | ||
152 | compat_timer_t _tid; /* timer id */ | ||
153 | int _overrun; /* overrun count */ | ||
154 | char _pad[sizeof(unsigned int) - sizeof(int)]; | ||
155 | compat_sigval_t _sigval; /* same as below */ | ||
156 | int _sys_private; /* not to be passed to user */ | ||
157 | } _timer; | ||
158 | |||
159 | /* POSIX.1b signals */ | ||
160 | struct { | ||
161 | unsigned int _pid; /* sender's pid */ | ||
162 | unsigned int _uid; /* sender's uid */ | ||
163 | compat_sigval_t _sigval; | ||
164 | } _rt; | ||
165 | |||
166 | /* SIGCHLD */ | ||
167 | struct { | ||
168 | unsigned int _pid; /* which child */ | ||
169 | unsigned int _uid; /* sender's uid */ | ||
170 | int _status; /* exit code */ | ||
171 | compat_clock_t _utime; | ||
172 | compat_clock_t _stime; | ||
173 | } _sigchld; | ||
174 | |||
175 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
176 | struct { | ||
177 | unsigned int _addr; /* faulting insn/memory ref. */ | ||
178 | } _sigfault; | ||
179 | |||
180 | /* SIGPOLL */ | ||
181 | struct { | ||
182 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
183 | int _fd; | ||
184 | } _sigpoll; | ||
185 | } _sifields; | ||
186 | } compat_siginfo_t; | ||
187 | |||
130 | #define COMPAT_OFF_T_MAX 0x7fffffff | 188 | #define COMPAT_OFF_T_MAX 0x7fffffff |
131 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL | 189 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL |
132 | 190 | ||
@@ -136,7 +194,6 @@ typedef u32 compat_sigset_word; | |||
136 | * as pointers because the syscall entry code will have | 194 | * as pointers because the syscall entry code will have |
137 | * appropriately converted them already. | 195 | * appropriately converted them already. |
138 | */ | 196 | */ |
139 | typedef u32 compat_uptr_t; | ||
140 | 197 | ||
141 | static inline void __user *compat_ptr(compat_uptr_t uptr) | 198 | static inline void __user *compat_ptr(compat_uptr_t uptr) |
142 | { | 199 | { |
diff --git a/arch/parisc/kernel/signal32.h b/arch/parisc/kernel/signal32.h index c7800846422c..08a88b5349a2 100644 --- a/arch/parisc/kernel/signal32.h +++ b/arch/parisc/kernel/signal32.h | |||
@@ -55,58 +55,6 @@ struct k_sigaction32 { | |||
55 | struct compat_sigaction sa; | 55 | struct compat_sigaction sa; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | typedef struct compat_siginfo { | ||
59 | int si_signo; | ||
60 | int si_errno; | ||
61 | int si_code; | ||
62 | |||
63 | union { | ||
64 | int _pad[((128/sizeof(int)) - 3)]; | ||
65 | |||
66 | /* kill() */ | ||
67 | struct { | ||
68 | unsigned int _pid; /* sender's pid */ | ||
69 | unsigned int _uid; /* sender's uid */ | ||
70 | } _kill; | ||
71 | |||
72 | /* POSIX.1b timers */ | ||
73 | struct { | ||
74 | compat_timer_t _tid; /* timer id */ | ||
75 | int _overrun; /* overrun count */ | ||
76 | char _pad[sizeof(unsigned int) - sizeof(int)]; | ||
77 | compat_sigval_t _sigval; /* same as below */ | ||
78 | int _sys_private; /* not to be passed to user */ | ||
79 | } _timer; | ||
80 | |||
81 | /* POSIX.1b signals */ | ||
82 | struct { | ||
83 | unsigned int _pid; /* sender's pid */ | ||
84 | unsigned int _uid; /* sender's uid */ | ||
85 | compat_sigval_t _sigval; | ||
86 | } _rt; | ||
87 | |||
88 | /* SIGCHLD */ | ||
89 | struct { | ||
90 | unsigned int _pid; /* which child */ | ||
91 | unsigned int _uid; /* sender's uid */ | ||
92 | int _status; /* exit code */ | ||
93 | compat_clock_t _utime; | ||
94 | compat_clock_t _stime; | ||
95 | } _sigchld; | ||
96 | |||
97 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
98 | struct { | ||
99 | unsigned int _addr; /* faulting insn/memory ref. */ | ||
100 | } _sigfault; | ||
101 | |||
102 | /* SIGPOLL */ | ||
103 | struct { | ||
104 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
105 | int _fd; | ||
106 | } _sigpoll; | ||
107 | } _sifields; | ||
108 | } compat_siginfo_t; | ||
109 | |||
110 | int copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from); | 58 | int copy_siginfo_to_user32 (compat_siginfo_t __user *to, siginfo_t *from); |
111 | int copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from); | 59 | int copy_siginfo_from_user32 (siginfo_t *to, compat_siginfo_t __user *from); |
112 | 60 | ||
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h index 88e602f6430d..84fdf6857c31 100644 --- a/arch/powerpc/include/asm/compat.h +++ b/arch/powerpc/include/asm/compat.h | |||
@@ -38,6 +38,7 @@ typedef s64 compat_s64; | |||
38 | typedef u32 compat_uint_t; | 38 | typedef u32 compat_uint_t; |
39 | typedef u32 compat_ulong_t; | 39 | typedef u32 compat_ulong_t; |
40 | typedef u64 compat_u64; | 40 | typedef u64 compat_u64; |
41 | typedef u32 compat_uptr_t; | ||
41 | 42 | ||
42 | struct compat_timespec { | 43 | struct compat_timespec { |
43 | compat_time_t tv_sec; | 44 | compat_time_t tv_sec; |
@@ -114,6 +115,64 @@ typedef u32 compat_old_sigset_t; | |||
114 | 115 | ||
115 | typedef u32 compat_sigset_word; | 116 | typedef u32 compat_sigset_word; |
116 | 117 | ||
118 | typedef union compat_sigval { | ||
119 | compat_int_t sival_int; | ||
120 | compat_uptr_t sival_ptr; | ||
121 | } compat_sigval_t; | ||
122 | |||
123 | #define SI_PAD_SIZE32 (128/sizeof(int) - 3) | ||
124 | |||
125 | typedef struct compat_siginfo { | ||
126 | int si_signo; | ||
127 | int si_errno; | ||
128 | int si_code; | ||
129 | |||
130 | union { | ||
131 | int _pad[SI_PAD_SIZE32]; | ||
132 | |||
133 | /* kill() */ | ||
134 | struct { | ||
135 | compat_pid_t _pid; /* sender's pid */ | ||
136 | __compat_uid_t _uid; /* sender's uid */ | ||
137 | } _kill; | ||
138 | |||
139 | /* POSIX.1b timers */ | ||
140 | struct { | ||
141 | compat_timer_t _tid; /* timer id */ | ||
142 | int _overrun; /* overrun count */ | ||
143 | compat_sigval_t _sigval; /* same as below */ | ||
144 | int _sys_private; /* not to be passed to user */ | ||
145 | } _timer; | ||
146 | |||
147 | /* POSIX.1b signals */ | ||
148 | struct { | ||
149 | compat_pid_t _pid; /* sender's pid */ | ||
150 | __compat_uid_t _uid; /* sender's uid */ | ||
151 | compat_sigval_t _sigval; | ||
152 | } _rt; | ||
153 | |||
154 | /* SIGCHLD */ | ||
155 | struct { | ||
156 | compat_pid_t _pid; /* which child */ | ||
157 | __compat_uid_t _uid; /* sender's uid */ | ||
158 | int _status; /* exit code */ | ||
159 | compat_clock_t _utime; | ||
160 | compat_clock_t _stime; | ||
161 | } _sigchld; | ||
162 | |||
163 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */ | ||
164 | struct { | ||
165 | unsigned int _addr; /* faulting insn/memory ref. */ | ||
166 | } _sigfault; | ||
167 | |||
168 | /* SIGPOLL */ | ||
169 | struct { | ||
170 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
171 | int _fd; | ||
172 | } _sigpoll; | ||
173 | } _sifields; | ||
174 | } compat_siginfo_t; | ||
175 | |||
117 | #define COMPAT_OFF_T_MAX 0x7fffffff | 176 | #define COMPAT_OFF_T_MAX 0x7fffffff |
118 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL | 177 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL |
119 | 178 | ||
@@ -123,7 +182,6 @@ typedef u32 compat_sigset_word; | |||
123 | * as pointers because the syscall entry code will have | 182 | * as pointers because the syscall entry code will have |
124 | * appropriately converted them already. | 183 | * appropriately converted them already. |
125 | */ | 184 | */ |
126 | typedef u32 compat_uptr_t; | ||
127 | 185 | ||
128 | static inline void __user *compat_ptr(compat_uptr_t uptr) | 186 | static inline void __user *compat_ptr(compat_uptr_t uptr) |
129 | { | 187 | { |
diff --git a/arch/powerpc/include/asm/siginfo.h b/arch/powerpc/include/asm/siginfo.h index 49495b0534ed..ccce3ef5cd86 100644 --- a/arch/powerpc/include/asm/siginfo.h +++ b/arch/powerpc/include/asm/siginfo.h | |||
@@ -10,7 +10,6 @@ | |||
10 | 10 | ||
11 | #ifdef __powerpc64__ | 11 | #ifdef __powerpc64__ |
12 | # define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) | 12 | # define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) |
13 | # define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) | ||
14 | #endif | 13 | #endif |
15 | 14 | ||
16 | #include <asm-generic/siginfo.h> | 15 | #include <asm-generic/siginfo.h> |
diff --git a/arch/powerpc/kernel/ppc32.h b/arch/powerpc/kernel/ppc32.h index dc16aefe1dd0..02fb0ee26093 100644 --- a/arch/powerpc/kernel/ppc32.h +++ b/arch/powerpc/kernel/ppc32.h | |||
@@ -16,57 +16,6 @@ | |||
16 | 16 | ||
17 | /* These are here to support 32-bit syscalls on a 64-bit kernel. */ | 17 | /* These are here to support 32-bit syscalls on a 64-bit kernel. */ |
18 | 18 | ||
19 | typedef struct compat_siginfo { | ||
20 | int si_signo; | ||
21 | int si_errno; | ||
22 | int si_code; | ||
23 | |||
24 | union { | ||
25 | int _pad[SI_PAD_SIZE32]; | ||
26 | |||
27 | /* kill() */ | ||
28 | struct { | ||
29 | compat_pid_t _pid; /* sender's pid */ | ||
30 | compat_uid_t _uid; /* sender's uid */ | ||
31 | } _kill; | ||
32 | |||
33 | /* POSIX.1b timers */ | ||
34 | struct { | ||
35 | compat_timer_t _tid; /* timer id */ | ||
36 | int _overrun; /* overrun count */ | ||
37 | compat_sigval_t _sigval; /* same as below */ | ||
38 | int _sys_private; /* not to be passed to user */ | ||
39 | } _timer; | ||
40 | |||
41 | /* POSIX.1b signals */ | ||
42 | struct { | ||
43 | compat_pid_t _pid; /* sender's pid */ | ||
44 | compat_uid_t _uid; /* sender's uid */ | ||
45 | compat_sigval_t _sigval; | ||
46 | } _rt; | ||
47 | |||
48 | /* SIGCHLD */ | ||
49 | struct { | ||
50 | compat_pid_t _pid; /* which child */ | ||
51 | compat_uid_t _uid; /* sender's uid */ | ||
52 | int _status; /* exit code */ | ||
53 | compat_clock_t _utime; | ||
54 | compat_clock_t _stime; | ||
55 | } _sigchld; | ||
56 | |||
57 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */ | ||
58 | struct { | ||
59 | unsigned int _addr; /* faulting insn/memory ref. */ | ||
60 | } _sigfault; | ||
61 | |||
62 | /* SIGPOLL */ | ||
63 | struct { | ||
64 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
65 | int _fd; | ||
66 | } _sigpoll; | ||
67 | } _sifields; | ||
68 | } compat_siginfo_t; | ||
69 | |||
70 | #define __old_sigaction32 old_sigaction32 | 19 | #define __old_sigaction32 old_sigaction32 |
71 | 20 | ||
72 | struct __old_sigaction32 { | 21 | struct __old_sigaction32 { |
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h index 234f1d859cea..a34a9d612fc0 100644 --- a/arch/s390/include/asm/compat.h +++ b/arch/s390/include/asm/compat.h | |||
@@ -65,6 +65,7 @@ typedef s64 compat_s64; | |||
65 | typedef u32 compat_uint_t; | 65 | typedef u32 compat_uint_t; |
66 | typedef u32 compat_ulong_t; | 66 | typedef u32 compat_ulong_t; |
67 | typedef u64 compat_u64; | 67 | typedef u64 compat_u64; |
68 | typedef u32 compat_uptr_t; | ||
68 | 69 | ||
69 | struct compat_timespec { | 70 | struct compat_timespec { |
70 | compat_time_t tv_sec; | 71 | compat_time_t tv_sec; |
@@ -144,6 +145,79 @@ typedef u32 compat_old_sigset_t; /* at least 32 bits */ | |||
144 | 145 | ||
145 | typedef u32 compat_sigset_word; | 146 | typedef u32 compat_sigset_word; |
146 | 147 | ||
148 | typedef union compat_sigval { | ||
149 | compat_int_t sival_int; | ||
150 | compat_uptr_t sival_ptr; | ||
151 | } compat_sigval_t; | ||
152 | |||
153 | typedef struct compat_siginfo { | ||
154 | int si_signo; | ||
155 | int si_errno; | ||
156 | int si_code; | ||
157 | |||
158 | union { | ||
159 | int _pad[128/sizeof(int) - 3]; | ||
160 | |||
161 | /* kill() */ | ||
162 | struct { | ||
163 | pid_t _pid; /* sender's pid */ | ||
164 | uid_t _uid; /* sender's uid */ | ||
165 | } _kill; | ||
166 | |||
167 | /* POSIX.1b timers */ | ||
168 | struct { | ||
169 | compat_timer_t _tid; /* timer id */ | ||
170 | int _overrun; /* overrun count */ | ||
171 | compat_sigval_t _sigval; /* same as below */ | ||
172 | int _sys_private; /* not to be passed to user */ | ||
173 | } _timer; | ||
174 | |||
175 | /* POSIX.1b signals */ | ||
176 | struct { | ||
177 | pid_t _pid; /* sender's pid */ | ||
178 | uid_t _uid; /* sender's uid */ | ||
179 | compat_sigval_t _sigval; | ||
180 | } _rt; | ||
181 | |||
182 | /* SIGCHLD */ | ||
183 | struct { | ||
184 | pid_t _pid; /* which child */ | ||
185 | uid_t _uid; /* sender's uid */ | ||
186 | int _status;/* exit code */ | ||
187 | compat_clock_t _utime; | ||
188 | compat_clock_t _stime; | ||
189 | } _sigchld; | ||
190 | |||
191 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
192 | struct { | ||
193 | __u32 _addr; /* faulting insn/memory ref. - pointer */ | ||
194 | } _sigfault; | ||
195 | |||
196 | /* SIGPOLL */ | ||
197 | struct { | ||
198 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
199 | int _fd; | ||
200 | } _sigpoll; | ||
201 | } _sifields; | ||
202 | } compat_siginfo_t; | ||
203 | |||
204 | /* | ||
205 | * How these fields are to be accessed. | ||
206 | */ | ||
207 | #define si_pid _sifields._kill._pid | ||
208 | #define si_uid _sifields._kill._uid | ||
209 | #define si_status _sifields._sigchld._status | ||
210 | #define si_utime _sifields._sigchld._utime | ||
211 | #define si_stime _sifields._sigchld._stime | ||
212 | #define si_value _sifields._rt._sigval | ||
213 | #define si_int _sifields._rt._sigval.sival_int | ||
214 | #define si_ptr _sifields._rt._sigval.sival_ptr | ||
215 | #define si_addr _sifields._sigfault._addr | ||
216 | #define si_band _sifields._sigpoll._band | ||
217 | #define si_fd _sifields._sigpoll._fd | ||
218 | #define si_tid _sifields._timer._tid | ||
219 | #define si_overrun _sifields._timer._overrun | ||
220 | |||
147 | #define COMPAT_OFF_T_MAX 0x7fffffff | 221 | #define COMPAT_OFF_T_MAX 0x7fffffff |
148 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL | 222 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL |
149 | 223 | ||
@@ -153,7 +227,6 @@ typedef u32 compat_sigset_word; | |||
153 | * as pointers because the syscall entry code will have | 227 | * as pointers because the syscall entry code will have |
154 | * appropriately converted them already. | 228 | * appropriately converted them already. |
155 | */ | 229 | */ |
156 | typedef u32 compat_uptr_t; | ||
157 | 230 | ||
158 | static inline void __user *compat_ptr(compat_uptr_t uptr) | 231 | static inline void __user *compat_ptr(compat_uptr_t uptr) |
159 | { | 232 | { |
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h index 9635d759c2b9..90887bd98cf0 100644 --- a/arch/s390/kernel/compat_linux.h +++ b/arch/s390/kernel/compat_linux.h | |||
@@ -23,74 +23,6 @@ struct old_sigaction32 { | |||
23 | __u32 sa_flags; | 23 | __u32 sa_flags; |
24 | __u32 sa_restorer; /* Another 32 bit pointer */ | 24 | __u32 sa_restorer; /* Another 32 bit pointer */ |
25 | }; | 25 | }; |
26 | |||
27 | typedef struct compat_siginfo { | ||
28 | int si_signo; | ||
29 | int si_errno; | ||
30 | int si_code; | ||
31 | |||
32 | union { | ||
33 | int _pad[((128/sizeof(int)) - 3)]; | ||
34 | |||
35 | /* kill() */ | ||
36 | struct { | ||
37 | pid_t _pid; /* sender's pid */ | ||
38 | uid_t _uid; /* sender's uid */ | ||
39 | } _kill; | ||
40 | |||
41 | /* POSIX.1b timers */ | ||
42 | struct { | ||
43 | compat_timer_t _tid; /* timer id */ | ||
44 | int _overrun; /* overrun count */ | ||
45 | compat_sigval_t _sigval; /* same as below */ | ||
46 | int _sys_private; /* not to be passed to user */ | ||
47 | } _timer; | ||
48 | |||
49 | /* POSIX.1b signals */ | ||
50 | struct { | ||
51 | pid_t _pid; /* sender's pid */ | ||
52 | uid_t _uid; /* sender's uid */ | ||
53 | compat_sigval_t _sigval; | ||
54 | } _rt; | ||
55 | |||
56 | /* SIGCHLD */ | ||
57 | struct { | ||
58 | pid_t _pid; /* which child */ | ||
59 | uid_t _uid; /* sender's uid */ | ||
60 | int _status;/* exit code */ | ||
61 | compat_clock_t _utime; | ||
62 | compat_clock_t _stime; | ||
63 | } _sigchld; | ||
64 | |||
65 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
66 | struct { | ||
67 | __u32 _addr; /* faulting insn/memory ref. - pointer */ | ||
68 | } _sigfault; | ||
69 | |||
70 | /* SIGPOLL */ | ||
71 | struct { | ||
72 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
73 | int _fd; | ||
74 | } _sigpoll; | ||
75 | } _sifields; | ||
76 | } compat_siginfo_t; | ||
77 | |||
78 | /* | ||
79 | * How these fields are to be accessed. | ||
80 | */ | ||
81 | #define si_pid _sifields._kill._pid | ||
82 | #define si_uid _sifields._kill._uid | ||
83 | #define si_status _sifields._sigchld._status | ||
84 | #define si_utime _sifields._sigchld._utime | ||
85 | #define si_stime _sifields._sigchld._stime | ||
86 | #define si_value _sifields._rt._sigval | ||
87 | #define si_int _sifields._rt._sigval.sival_int | ||
88 | #define si_ptr _sifields._rt._sigval.sival_ptr | ||
89 | #define si_addr _sifields._sigfault._addr | ||
90 | #define si_band _sifields._sigpoll._band | ||
91 | #define si_fd _sifields._sigpoll._fd | ||
92 | #define si_tid _sifields._timer._tid | ||
93 | #define si_overrun _sifields._timer._overrun | ||
94 | 26 | ||
95 | /* asm/sigcontext.h */ | 27 | /* asm/sigcontext.h */ |
96 | typedef union | 28 | typedef union |
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h index b8be20d42a0a..cef99fbc0a21 100644 --- a/arch/sparc/include/asm/compat.h +++ b/arch/sparc/include/asm/compat.h | |||
@@ -36,6 +36,7 @@ typedef s64 compat_s64; | |||
36 | typedef u32 compat_uint_t; | 36 | typedef u32 compat_uint_t; |
37 | typedef u32 compat_ulong_t; | 37 | typedef u32 compat_ulong_t; |
38 | typedef u64 compat_u64; | 38 | typedef u64 compat_u64; |
39 | typedef u32 compat_uptr_t; | ||
39 | 40 | ||
40 | struct compat_timespec { | 41 | struct compat_timespec { |
41 | compat_time_t tv_sec; | 42 | compat_time_t tv_sec; |
@@ -147,6 +148,65 @@ typedef u32 compat_old_sigset_t; | |||
147 | 148 | ||
148 | typedef u32 compat_sigset_word; | 149 | typedef u32 compat_sigset_word; |
149 | 150 | ||
151 | typedef union compat_sigval { | ||
152 | compat_int_t sival_int; | ||
153 | compat_uptr_t sival_ptr; | ||
154 | } compat_sigval_t; | ||
155 | |||
156 | #define SI_PAD_SIZE32 (128/sizeof(int) - 3) | ||
157 | |||
158 | typedef struct compat_siginfo { | ||
159 | int si_signo; | ||
160 | int si_errno; | ||
161 | int si_code; | ||
162 | |||
163 | union { | ||
164 | int _pad[SI_PAD_SIZE32]; | ||
165 | |||
166 | /* kill() */ | ||
167 | struct { | ||
168 | compat_pid_t _pid; /* sender's pid */ | ||
169 | unsigned int _uid; /* sender's uid */ | ||
170 | } _kill; | ||
171 | |||
172 | /* POSIX.1b timers */ | ||
173 | struct { | ||
174 | compat_timer_t _tid; /* timer id */ | ||
175 | int _overrun; /* overrun count */ | ||
176 | compat_sigval_t _sigval; /* same as below */ | ||
177 | int _sys_private; /* not to be passed to user */ | ||
178 | } _timer; | ||
179 | |||
180 | /* POSIX.1b signals */ | ||
181 | struct { | ||
182 | compat_pid_t _pid; /* sender's pid */ | ||
183 | unsigned int _uid; /* sender's uid */ | ||
184 | compat_sigval_t _sigval; | ||
185 | } _rt; | ||
186 | |||
187 | /* SIGCHLD */ | ||
188 | struct { | ||
189 | compat_pid_t _pid; /* which child */ | ||
190 | unsigned int _uid; /* sender's uid */ | ||
191 | int _status; /* exit code */ | ||
192 | compat_clock_t _utime; | ||
193 | compat_clock_t _stime; | ||
194 | } _sigchld; | ||
195 | |||
196 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */ | ||
197 | struct { | ||
198 | u32 _addr; /* faulting insn/memory ref. */ | ||
199 | int _trapno; | ||
200 | } _sigfault; | ||
201 | |||
202 | /* SIGPOLL */ | ||
203 | struct { | ||
204 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
205 | int _fd; | ||
206 | } _sigpoll; | ||
207 | } _sifields; | ||
208 | } compat_siginfo_t; | ||
209 | |||
150 | #define COMPAT_OFF_T_MAX 0x7fffffff | 210 | #define COMPAT_OFF_T_MAX 0x7fffffff |
151 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL | 211 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL |
152 | 212 | ||
@@ -156,7 +216,6 @@ typedef u32 compat_sigset_word; | |||
156 | * as pointers because the syscall entry code will have | 216 | * as pointers because the syscall entry code will have |
157 | * appropriately converted them already. | 217 | * appropriately converted them already. |
158 | */ | 218 | */ |
159 | typedef u32 compat_uptr_t; | ||
160 | 219 | ||
161 | static inline void __user *compat_ptr(compat_uptr_t uptr) | 220 | static inline void __user *compat_ptr(compat_uptr_t uptr) |
162 | { | 221 | { |
diff --git a/arch/sparc/include/asm/siginfo.h b/arch/sparc/include/asm/siginfo.h index 215900fce21b..dbc182c438b4 100644 --- a/arch/sparc/include/asm/siginfo.h +++ b/arch/sparc/include/asm/siginfo.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #if defined(__sparc__) && defined(__arch64__) | 4 | #if defined(__sparc__) && defined(__arch64__) |
5 | 5 | ||
6 | #define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) | ||
7 | #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) | 6 | #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) |
8 | #define __ARCH_SI_BAND_T int | 7 | #define __ARCH_SI_BAND_T int |
9 | 8 | ||
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c index a53e0a5fd3a3..53e48f721ce3 100644 --- a/arch/sparc/kernel/signal32.c +++ b/arch/sparc/kernel/signal32.c | |||
@@ -54,58 +54,6 @@ struct signal_frame32 { | |||
54 | /* __siginfo_rwin_t * */u32 rwin_save; | 54 | /* __siginfo_rwin_t * */u32 rwin_save; |
55 | } __attribute__((aligned(8))); | 55 | } __attribute__((aligned(8))); |
56 | 56 | ||
57 | typedef struct compat_siginfo{ | ||
58 | int si_signo; | ||
59 | int si_errno; | ||
60 | int si_code; | ||
61 | |||
62 | union { | ||
63 | int _pad[SI_PAD_SIZE32]; | ||
64 | |||
65 | /* kill() */ | ||
66 | struct { | ||
67 | compat_pid_t _pid; /* sender's pid */ | ||
68 | unsigned int _uid; /* sender's uid */ | ||
69 | } _kill; | ||
70 | |||
71 | /* POSIX.1b timers */ | ||
72 | struct { | ||
73 | compat_timer_t _tid; /* timer id */ | ||
74 | int _overrun; /* overrun count */ | ||
75 | compat_sigval_t _sigval; /* same as below */ | ||
76 | int _sys_private; /* not to be passed to user */ | ||
77 | } _timer; | ||
78 | |||
79 | /* POSIX.1b signals */ | ||
80 | struct { | ||
81 | compat_pid_t _pid; /* sender's pid */ | ||
82 | unsigned int _uid; /* sender's uid */ | ||
83 | compat_sigval_t _sigval; | ||
84 | } _rt; | ||
85 | |||
86 | /* SIGCHLD */ | ||
87 | struct { | ||
88 | compat_pid_t _pid; /* which child */ | ||
89 | unsigned int _uid; /* sender's uid */ | ||
90 | int _status; /* exit code */ | ||
91 | compat_clock_t _utime; | ||
92 | compat_clock_t _stime; | ||
93 | } _sigchld; | ||
94 | |||
95 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */ | ||
96 | struct { | ||
97 | u32 _addr; /* faulting insn/memory ref. */ | ||
98 | int _trapno; | ||
99 | } _sigfault; | ||
100 | |||
101 | /* SIGPOLL */ | ||
102 | struct { | ||
103 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
104 | int _fd; | ||
105 | } _sigpoll; | ||
106 | } _sifields; | ||
107 | }compat_siginfo_t; | ||
108 | |||
109 | struct rt_signal_frame32 { | 57 | struct rt_signal_frame32 { |
110 | struct sparc_stackf32 ss; | 58 | struct sparc_stackf32 ss; |
111 | compat_siginfo_t info; | 59 | compat_siginfo_t info; |
diff --git a/arch/tile/include/asm/compat.h b/arch/tile/include/asm/compat.h index 6e74450ff0a1..3063e6fc8daa 100644 --- a/arch/tile/include/asm/compat.h +++ b/arch/tile/include/asm/compat.h | |||
@@ -110,6 +110,68 @@ struct compat_flock64 { | |||
110 | 110 | ||
111 | typedef u32 compat_sigset_word; | 111 | typedef u32 compat_sigset_word; |
112 | 112 | ||
113 | typedef union compat_sigval { | ||
114 | compat_int_t sival_int; | ||
115 | compat_uptr_t sival_ptr; | ||
116 | } compat_sigval_t; | ||
117 | |||
118 | #define COMPAT_SI_PAD_SIZE (128/sizeof(int) - 3) | ||
119 | |||
120 | typedef struct compat_siginfo { | ||
121 | int si_signo; | ||
122 | int si_errno; | ||
123 | int si_code; | ||
124 | |||
125 | union { | ||
126 | int _pad[COMPAT_SI_PAD_SIZE]; | ||
127 | |||
128 | /* kill() */ | ||
129 | struct { | ||
130 | unsigned int _pid; /* sender's pid */ | ||
131 | unsigned int _uid; /* sender's uid */ | ||
132 | } _kill; | ||
133 | |||
134 | /* POSIX.1b timers */ | ||
135 | struct { | ||
136 | compat_timer_t _tid; /* timer id */ | ||
137 | int _overrun; /* overrun count */ | ||
138 | compat_sigval_t _sigval; /* same as below */ | ||
139 | int _sys_private; /* not to be passed to user */ | ||
140 | int _overrun_incr; /* amount to add to overrun */ | ||
141 | } _timer; | ||
142 | |||
143 | /* POSIX.1b signals */ | ||
144 | struct { | ||
145 | unsigned int _pid; /* sender's pid */ | ||
146 | unsigned int _uid; /* sender's uid */ | ||
147 | compat_sigval_t _sigval; | ||
148 | } _rt; | ||
149 | |||
150 | /* SIGCHLD */ | ||
151 | struct { | ||
152 | unsigned int _pid; /* which child */ | ||
153 | unsigned int _uid; /* sender's uid */ | ||
154 | int _status; /* exit code */ | ||
155 | compat_clock_t _utime; | ||
156 | compat_clock_t _stime; | ||
157 | } _sigchld; | ||
158 | |||
159 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
160 | struct { | ||
161 | unsigned int _addr; /* faulting insn/memory ref. */ | ||
162 | #ifdef __ARCH_SI_TRAPNO | ||
163 | int _trapno; /* TRAP # which caused the signal */ | ||
164 | #endif | ||
165 | } _sigfault; | ||
166 | |||
167 | /* SIGPOLL */ | ||
168 | struct { | ||
169 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
170 | int _fd; | ||
171 | } _sigpoll; | ||
172 | } _sifields; | ||
173 | } compat_siginfo_t; | ||
174 | |||
113 | #define COMPAT_OFF_T_MAX 0x7fffffff | 175 | #define COMPAT_OFF_T_MAX 0x7fffffff |
114 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL | 176 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL |
115 | 177 | ||
diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c index 474571b84085..7bc0859a9f5e 100644 --- a/arch/tile/kernel/compat_signal.c +++ b/arch/tile/kernel/compat_signal.c | |||
@@ -55,63 +55,6 @@ struct compat_ucontext { | |||
55 | sigset_t uc_sigmask; /* mask last for extensibility */ | 55 | sigset_t uc_sigmask; /* mask last for extensibility */ |
56 | }; | 56 | }; |
57 | 57 | ||
58 | #define COMPAT_SI_PAD_SIZE ((SI_MAX_SIZE - 3 * sizeof(int)) / sizeof(int)) | ||
59 | |||
60 | struct compat_siginfo { | ||
61 | int si_signo; | ||
62 | int si_errno; | ||
63 | int si_code; | ||
64 | |||
65 | union { | ||
66 | int _pad[COMPAT_SI_PAD_SIZE]; | ||
67 | |||
68 | /* kill() */ | ||
69 | struct { | ||
70 | unsigned int _pid; /* sender's pid */ | ||
71 | unsigned int _uid; /* sender's uid */ | ||
72 | } _kill; | ||
73 | |||
74 | /* POSIX.1b timers */ | ||
75 | struct { | ||
76 | compat_timer_t _tid; /* timer id */ | ||
77 | int _overrun; /* overrun count */ | ||
78 | compat_sigval_t _sigval; /* same as below */ | ||
79 | int _sys_private; /* not to be passed to user */ | ||
80 | int _overrun_incr; /* amount to add to overrun */ | ||
81 | } _timer; | ||
82 | |||
83 | /* POSIX.1b signals */ | ||
84 | struct { | ||
85 | unsigned int _pid; /* sender's pid */ | ||
86 | unsigned int _uid; /* sender's uid */ | ||
87 | compat_sigval_t _sigval; | ||
88 | } _rt; | ||
89 | |||
90 | /* SIGCHLD */ | ||
91 | struct { | ||
92 | unsigned int _pid; /* which child */ | ||
93 | unsigned int _uid; /* sender's uid */ | ||
94 | int _status; /* exit code */ | ||
95 | compat_clock_t _utime; | ||
96 | compat_clock_t _stime; | ||
97 | } _sigchld; | ||
98 | |||
99 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
100 | struct { | ||
101 | unsigned int _addr; /* faulting insn/memory ref. */ | ||
102 | #ifdef __ARCH_SI_TRAPNO | ||
103 | int _trapno; /* TRAP # which caused the signal */ | ||
104 | #endif | ||
105 | } _sigfault; | ||
106 | |||
107 | /* SIGPOLL */ | ||
108 | struct { | ||
109 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
110 | int _fd; | ||
111 | } _sigpoll; | ||
112 | } _sifields; | ||
113 | }; | ||
114 | |||
115 | struct compat_rt_sigframe { | 58 | struct compat_rt_sigframe { |
116 | unsigned char save_area[C_ABI_SAVE_AREA_SIZE]; /* caller save area */ | 59 | unsigned char save_area[C_ABI_SAVE_AREA_SIZE]; /* caller save area */ |
117 | struct compat_siginfo info; | 60 | struct compat_siginfo info; |
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h index fedf32b73e65..59c6c401f79f 100644 --- a/arch/x86/include/asm/compat.h +++ b/arch/x86/include/asm/compat.h | |||
@@ -41,6 +41,7 @@ typedef s64 __attribute__((aligned(4))) compat_s64; | |||
41 | typedef u32 compat_uint_t; | 41 | typedef u32 compat_uint_t; |
42 | typedef u32 compat_ulong_t; | 42 | typedef u32 compat_ulong_t; |
43 | typedef u64 __attribute__((aligned(4))) compat_u64; | 43 | typedef u64 __attribute__((aligned(4))) compat_u64; |
44 | typedef u32 compat_uptr_t; | ||
44 | 45 | ||
45 | struct compat_timespec { | 46 | struct compat_timespec { |
46 | compat_time_t tv_sec; | 47 | compat_time_t tv_sec; |
@@ -124,6 +125,78 @@ typedef u32 compat_old_sigset_t; /* at least 32 bits */ | |||
124 | 125 | ||
125 | typedef u32 compat_sigset_word; | 126 | typedef u32 compat_sigset_word; |
126 | 127 | ||
128 | typedef union compat_sigval { | ||
129 | compat_int_t sival_int; | ||
130 | compat_uptr_t sival_ptr; | ||
131 | } compat_sigval_t; | ||
132 | |||
133 | typedef struct compat_siginfo { | ||
134 | int si_signo; | ||
135 | int si_errno; | ||
136 | int si_code; | ||
137 | |||
138 | union { | ||
139 | int _pad[128/sizeof(int) - 3]; | ||
140 | |||
141 | /* kill() */ | ||
142 | struct { | ||
143 | unsigned int _pid; /* sender's pid */ | ||
144 | unsigned int _uid; /* sender's uid */ | ||
145 | } _kill; | ||
146 | |||
147 | /* POSIX.1b timers */ | ||
148 | struct { | ||
149 | compat_timer_t _tid; /* timer id */ | ||
150 | int _overrun; /* overrun count */ | ||
151 | compat_sigval_t _sigval; /* same as below */ | ||
152 | int _sys_private; /* not to be passed to user */ | ||
153 | int _overrun_incr; /* amount to add to overrun */ | ||
154 | } _timer; | ||
155 | |||
156 | /* POSIX.1b signals */ | ||
157 | struct { | ||
158 | unsigned int _pid; /* sender's pid */ | ||
159 | unsigned int _uid; /* sender's uid */ | ||
160 | compat_sigval_t _sigval; | ||
161 | } _rt; | ||
162 | |||
163 | /* SIGCHLD */ | ||
164 | struct { | ||
165 | unsigned int _pid; /* which child */ | ||
166 | unsigned int _uid; /* sender's uid */ | ||
167 | int _status; /* exit code */ | ||
168 | compat_clock_t _utime; | ||
169 | compat_clock_t _stime; | ||
170 | } _sigchld; | ||
171 | |||
172 | /* SIGCHLD (x32 version) */ | ||
173 | struct { | ||
174 | unsigned int _pid; /* which child */ | ||
175 | unsigned int _uid; /* sender's uid */ | ||
176 | int _status; /* exit code */ | ||
177 | compat_s64 _utime; | ||
178 | compat_s64 _stime; | ||
179 | } _sigchld_x32; | ||
180 | |||
181 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
182 | struct { | ||
183 | unsigned int _addr; /* faulting insn/memory ref. */ | ||
184 | } _sigfault; | ||
185 | |||
186 | /* SIGPOLL */ | ||
187 | struct { | ||
188 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
189 | int _fd; | ||
190 | } _sigpoll; | ||
191 | |||
192 | struct { | ||
193 | unsigned int _call_addr; /* calling insn */ | ||
194 | int _syscall; /* triggering system call number */ | ||
195 | unsigned int _arch; /* AUDIT_ARCH_* of syscall */ | ||
196 | } _sigsys; | ||
197 | } _sifields; | ||
198 | } compat_siginfo_t; | ||
199 | |||
127 | #define COMPAT_OFF_T_MAX 0x7fffffff | 200 | #define COMPAT_OFF_T_MAX 0x7fffffff |
128 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL | 201 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL |
129 | 202 | ||
@@ -209,7 +282,6 @@ typedef struct user_regs_struct32 compat_elf_gregset_t; | |||
209 | * as pointers because the syscall entry code will have | 282 | * as pointers because the syscall entry code will have |
210 | * appropriately converted them already. | 283 | * appropriately converted them already. |
211 | */ | 284 | */ |
212 | typedef u32 compat_uptr_t; | ||
213 | 285 | ||
214 | static inline void __user *compat_ptr(compat_uptr_t uptr) | 286 | static inline void __user *compat_ptr(compat_uptr_t uptr) |
215 | { | 287 | { |
diff --git a/arch/x86/include/asm/ia32.h b/arch/x86/include/asm/ia32.h index b04cbdb138cd..e6232773ce49 100644 --- a/arch/x86/include/asm/ia32.h +++ b/arch/x86/include/asm/ia32.h | |||
@@ -86,73 +86,6 @@ struct stat64 { | |||
86 | unsigned long long st_ino; | 86 | unsigned long long st_ino; |
87 | } __attribute__((packed)); | 87 | } __attribute__((packed)); |
88 | 88 | ||
89 | typedef struct compat_siginfo { | ||
90 | int si_signo; | ||
91 | int si_errno; | ||
92 | int si_code; | ||
93 | |||
94 | union { | ||
95 | int _pad[((128 / sizeof(int)) - 3)]; | ||
96 | |||
97 | /* kill() */ | ||
98 | struct { | ||
99 | unsigned int _pid; /* sender's pid */ | ||
100 | unsigned int _uid; /* sender's uid */ | ||
101 | } _kill; | ||
102 | |||
103 | /* POSIX.1b timers */ | ||
104 | struct { | ||
105 | compat_timer_t _tid; /* timer id */ | ||
106 | int _overrun; /* overrun count */ | ||
107 | compat_sigval_t _sigval; /* same as below */ | ||
108 | int _sys_private; /* not to be passed to user */ | ||
109 | int _overrun_incr; /* amount to add to overrun */ | ||
110 | } _timer; | ||
111 | |||
112 | /* POSIX.1b signals */ | ||
113 | struct { | ||
114 | unsigned int _pid; /* sender's pid */ | ||
115 | unsigned int _uid; /* sender's uid */ | ||
116 | compat_sigval_t _sigval; | ||
117 | } _rt; | ||
118 | |||
119 | /* SIGCHLD */ | ||
120 | struct { | ||
121 | unsigned int _pid; /* which child */ | ||
122 | unsigned int _uid; /* sender's uid */ | ||
123 | int _status; /* exit code */ | ||
124 | compat_clock_t _utime; | ||
125 | compat_clock_t _stime; | ||
126 | } _sigchld; | ||
127 | |||
128 | /* SIGCHLD (x32 version) */ | ||
129 | struct { | ||
130 | unsigned int _pid; /* which child */ | ||
131 | unsigned int _uid; /* sender's uid */ | ||
132 | int _status; /* exit code */ | ||
133 | compat_s64 _utime; | ||
134 | compat_s64 _stime; | ||
135 | } _sigchld_x32; | ||
136 | |||
137 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
138 | struct { | ||
139 | unsigned int _addr; /* faulting insn/memory ref. */ | ||
140 | } _sigfault; | ||
141 | |||
142 | /* SIGPOLL */ | ||
143 | struct { | ||
144 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
145 | int _fd; | ||
146 | } _sigpoll; | ||
147 | |||
148 | struct { | ||
149 | unsigned int _call_addr; /* calling insn */ | ||
150 | int _syscall; /* triggering system call number */ | ||
151 | unsigned int _arch; /* AUDIT_ARCH_* of syscall */ | ||
152 | } _sigsys; | ||
153 | } _sifields; | ||
154 | } compat_siginfo_t; | ||
155 | |||
156 | #define IA32_STACK_TOP IA32_PAGE_OFFSET | 89 | #define IA32_STACK_TOP IA32_PAGE_OFFSET |
157 | 90 | ||
158 | #ifdef __KERNEL__ | 91 | #ifdef __KERNEL__ |