aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-10-04 20:15:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-05 14:05:16 -0400
commit751f409db6216ebd134a94f6dcd97779933a5106 (patch)
tree7b059d89cf303ed2d37f36e8f8604e2295e3566a /arch/s390/include
parent5ab1c309b344880d81494e9eab7fb27682bc6d9d (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/s390/include')
-rw-r--r--arch/s390/include/asm/compat.h75
1 files changed, 74 insertions, 1 deletions
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;
65typedef u32 compat_uint_t; 65typedef u32 compat_uint_t;
66typedef u32 compat_ulong_t; 66typedef u32 compat_ulong_t;
67typedef u64 compat_u64; 67typedef u64 compat_u64;
68typedef u32 compat_uptr_t;
68 69
69struct compat_timespec { 70struct 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
145typedef u32 compat_sigset_word; 146typedef u32 compat_sigset_word;
146 147
148typedef union compat_sigval {
149 compat_int_t sival_int;
150 compat_uptr_t sival_ptr;
151} compat_sigval_t;
152
153typedef 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 */
156typedef u32 compat_uptr_t;
157 230
158static inline void __user *compat_ptr(compat_uptr_t uptr) 231static inline void __user *compat_ptr(compat_uptr_t uptr)
159{ 232{