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/arm64 | |
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/arm64')
-rw-r--r-- | arch/arm64/include/asm/compat.h | 60 | ||||
-rw-r--r-- | arch/arm64/kernel/signal32.c | 53 |
2 files changed, 59 insertions, 54 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; |