aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/compat.h')
-rw-r--r--include/linux/compat.h100
1 files changed, 99 insertions, 1 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 0fc36406f32c..8a9643857c4a 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -157,6 +157,104 @@ struct compat_sigaction {
157 compat_sigset_t sa_mask __packed; 157 compat_sigset_t sa_mask __packed;
158}; 158};
159 159
160typedef union compat_sigval {
161 compat_int_t sival_int;
162 compat_uptr_t sival_ptr;
163} compat_sigval_t;
164
165typedef struct compat_siginfo {
166 int si_signo;
167#ifndef __ARCH_HAS_SWAPPED_SIGINFO
168 int si_errno;
169 int si_code;
170#else
171 int si_code;
172 int si_errno;
173#endif
174
175 union {
176 int _pad[128/sizeof(int) - 3];
177
178 /* kill() */
179 struct {
180 compat_pid_t _pid; /* sender's pid */
181 __compat_uid32_t _uid; /* sender's uid */
182 } _kill;
183
184 /* POSIX.1b timers */
185 struct {
186 compat_timer_t _tid; /* timer id */
187 int _overrun; /* overrun count */
188 compat_sigval_t _sigval; /* same as below */
189 } _timer;
190
191 /* POSIX.1b signals */
192 struct {
193 compat_pid_t _pid; /* sender's pid */
194 __compat_uid32_t _uid; /* sender's uid */
195 compat_sigval_t _sigval;
196 } _rt;
197
198 /* SIGCHLD */
199 struct {
200 compat_pid_t _pid; /* which child */
201 __compat_uid32_t _uid; /* sender's uid */
202 int _status; /* exit code */
203 compat_clock_t _utime;
204 compat_clock_t _stime;
205 } _sigchld;
206
207#ifdef CONFIG_X86_X32_ABI
208 /* SIGCHLD (x32 version) */
209 struct {
210 compat_pid_t _pid; /* which child */
211 __compat_uid32_t _uid; /* sender's uid */
212 int _status; /* exit code */
213 compat_s64 _utime;
214 compat_s64 _stime;
215 } _sigchld_x32;
216#endif
217
218 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
219 struct {
220 compat_uptr_t _addr; /* faulting insn/memory ref. */
221#ifdef __ARCH_SI_TRAPNO
222 int _trapno; /* TRAP # which caused the signal */
223#endif
224 union {
225 /*
226 * used when si_code=BUS_MCEERR_AR or
227 * used when si_code=BUS_MCEERR_AO
228 */
229 short int _addr_lsb; /* Valid LSB of the reported address. */
230 /* used when si_code=SEGV_BNDERR */
231 struct {
232 short _dummy_bnd;
233 compat_uptr_t _lower;
234 compat_uptr_t _upper;
235 } _addr_bnd;
236 /* used when si_code=SEGV_PKUERR */
237 struct {
238 short _dummy_pkey;
239 u32 _pkey;
240 } _addr_pkey;
241 };
242 } _sigfault;
243
244 /* SIGPOLL */
245 struct {
246 compat_long_t _band; /* POLL_IN, POLL_OUT, POLL_MSG */
247 int _fd;
248 } _sigpoll;
249
250 struct {
251 compat_uptr_t _call_addr; /* calling user insn */
252 int _syscall; /* triggering system call number */
253 unsigned int _arch; /* AUDIT_ARCH_* of syscall */
254 } _sigsys;
255 } _sifields;
256} compat_siginfo_t;
257
160/* 258/*
161 * These functions operate on 32- or 64-bit specs depending on 259 * These functions operate on 32- or 64-bit specs depending on
162 * COMPAT_USE_64BIT_TIME, hence the void user pointer arguments. 260 * COMPAT_USE_64BIT_TIME, hence the void user pointer arguments.
@@ -412,7 +510,7 @@ long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask,
412 unsigned long bitmap_size); 510 unsigned long bitmap_size);
413long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, 511long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask,
414 unsigned long bitmap_size); 512 unsigned long bitmap_size);
415int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from); 513int copy_siginfo_from_user32(siginfo_t *to, const struct compat_siginfo __user *from);
416int copy_siginfo_to_user32(struct compat_siginfo __user *to, const siginfo_t *from); 514int copy_siginfo_to_user32(struct compat_siginfo __user *to, const siginfo_t *from);
417int get_compat_sigevent(struct sigevent *event, 515int get_compat_sigevent(struct sigevent *event,
418 const struct compat_sigevent __user *u_event); 516 const struct compat_sigevent __user *u_event);