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/sparc | |
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/sparc')
-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 |
3 files changed, 60 insertions, 54 deletions
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h index b8be20d42a0..cef99fbc0a2 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 215900fce21..dbc182c438b 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 a53e0a5fd3a..53e48f721ce 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; |