blob: e94184834b711b8765f82ddd661975ef28233878 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_COMPAT_H
2#define _LINUX_COMPAT_H
3/*
4 * These are the type definitions for the architecture specific
5 * syscall compatibility layer.
6 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
8#ifdef CONFIG_COMPAT
9
10#include <linux/stat.h>
11#include <linux/param.h> /* for HZ */
12#include <linux/sem.h>
Arnd Bergmann2dceba12009-11-06 08:09:03 +000013#include <linux/socket.h>
14#include <linux/if.h>
Chris Metcalfbe84cb42011-05-09 13:12:30 -040015#include <linux/fs.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
17#include <asm/compat.h>
18#include <asm/siginfo.h>
David Howells3f2e05e2006-10-02 14:12:31 +010019#include <asm/signal.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
21#define compat_jiffies_to_clock_t(x) \
22 (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
23
Stephen Rothwell202e5972005-09-06 15:16:40 -070024typedef __compat_uid32_t compat_uid_t;
25typedef __compat_gid32_t compat_gid_t;
26
Christoph Hellwig5d0e5282010-03-10 15:21:13 -080027struct compat_sel_arg_struct;
Linus Torvalds1da177e2005-04-16 15:20:36 -070028struct rusage;
29
30struct compat_itimerspec {
31 struct compat_timespec it_interval;
32 struct compat_timespec it_value;
33};
34
35struct compat_utimbuf {
36 compat_time_t actime;
37 compat_time_t modtime;
38};
39
40struct compat_itimerval {
41 struct compat_timeval it_interval;
42 struct compat_timeval it_value;
43};
44
45struct compat_tms {
46 compat_clock_t tms_utime;
47 compat_clock_t tms_stime;
48 compat_clock_t tms_cutime;
49 compat_clock_t tms_cstime;
50};
51
Stephen Rothwell88959ea2006-03-26 01:37:27 -080052struct compat_timex {
53 compat_uint_t modes;
54 compat_long_t offset;
55 compat_long_t freq;
56 compat_long_t maxerror;
57 compat_long_t esterror;
58 compat_int_t status;
59 compat_long_t constant;
60 compat_long_t precision;
61 compat_long_t tolerance;
62 struct compat_timeval time;
63 compat_long_t tick;
64 compat_long_t ppsfreq;
65 compat_long_t jitter;
66 compat_int_t shift;
67 compat_long_t stabil;
68 compat_long_t jitcnt;
69 compat_long_t calcnt;
70 compat_long_t errcnt;
71 compat_long_t stbcnt;
Roman Zippel153b5d02008-05-01 04:34:37 -070072 compat_int_t tai;
Stephen Rothwell88959ea2006-03-26 01:37:27 -080073
74 compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32;
75 compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32;
Roman Zippel153b5d02008-05-01 04:34:37 -070076 compat_int_t :32; compat_int_t :32; compat_int_t :32;
Stephen Rothwell88959ea2006-03-26 01:37:27 -080077};
78
Linus Torvalds1da177e2005-04-16 15:20:36 -070079#define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
80
81typedef struct {
82 compat_sigset_word sig[_COMPAT_NSIG_WORDS];
83} compat_sigset_t;
84
Linus Torvalds1da177e2005-04-16 15:20:36 -070085extern int get_compat_timespec(struct timespec *, const struct compat_timespec __user *);
86extern int put_compat_timespec(const struct timespec *, struct compat_timespec __user *);
87
88struct compat_iovec {
89 compat_uptr_t iov_base;
90 compat_size_t iov_len;
91};
92
93struct compat_rlimit {
94 compat_ulong_t rlim_cur;
95 compat_ulong_t rlim_max;
96};
97
98struct compat_rusage {
99 struct compat_timeval ru_utime;
100 struct compat_timeval ru_stime;
101 compat_long_t ru_maxrss;
102 compat_long_t ru_ixrss;
103 compat_long_t ru_idrss;
104 compat_long_t ru_isrss;
105 compat_long_t ru_minflt;
106 compat_long_t ru_majflt;
107 compat_long_t ru_nswap;
108 compat_long_t ru_inblock;
109 compat_long_t ru_oublock;
110 compat_long_t ru_msgsnd;
111 compat_long_t ru_msgrcv;
112 compat_long_t ru_nsignals;
113 compat_long_t ru_nvcsw;
114 compat_long_t ru_nivcsw;
115};
116
117extern int put_compat_rusage(const struct rusage *, struct compat_rusage __user *);
118
119struct compat_siginfo;
120
121extern asmlinkage long compat_sys_waitid(int, compat_pid_t,
122 struct compat_siginfo __user *, int,
123 struct compat_rusage __user *);
124
125struct compat_dirent {
126 u32 d_ino;
127 compat_off_t d_off;
128 u16 d_reclen;
129 char d_name[256];
130};
131
Christoph Hellwig2b1c6bd2008-11-28 10:09:09 +0100132struct compat_ustat {
133 compat_daddr_t f_tfree;
134 compat_ino_t f_tinode;
135 char f_fname[6];
136 char f_fpack[6];
137};
138
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139typedef union compat_sigval {
140 compat_int_t sival_int;
141 compat_uptr_t sival_ptr;
142} compat_sigval_t;
143
144#define COMPAT_SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
145
146typedef struct compat_sigevent {
147 compat_sigval_t sigev_value;
148 compat_int_t sigev_signo;
149 compat_int_t sigev_notify;
150 union {
151 compat_int_t _pad[COMPAT_SIGEV_PAD_SIZE];
152 compat_int_t _tid;
153
154 struct {
155 compat_uptr_t _function;
156 compat_uptr_t _attribute;
157 } _sigev_thread;
158 } _sigev_un;
159} compat_sigevent_t;
160
Arnd Bergmann2dceba12009-11-06 08:09:03 +0000161struct compat_ifmap {
162 compat_ulong_t mem_start;
163 compat_ulong_t mem_end;
164 unsigned short base_addr;
165 unsigned char irq;
166 unsigned char dma;
167 unsigned char port;
168};
169
Arnd Bergmann7a50a242009-11-08 20:57:03 -0800170struct compat_if_settings
171{
172 unsigned int type; /* Type of physical device or protocol */
173 unsigned int size; /* Size of the data allocated by the caller */
174 compat_uptr_t ifs_ifsu; /* union of pointers */
175};
176
Arnd Bergmann2dceba12009-11-06 08:09:03 +0000177struct compat_ifreq {
Arnd Bergmann7a50a242009-11-08 20:57:03 -0800178 union {
179 char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
180 } ifr_ifrn;
181 union {
182 struct sockaddr ifru_addr;
183 struct sockaddr ifru_dstaddr;
184 struct sockaddr ifru_broadaddr;
185 struct sockaddr ifru_netmask;
186 struct sockaddr ifru_hwaddr;
187 short ifru_flags;
188 compat_int_t ifru_ivalue;
189 compat_int_t ifru_mtu;
190 struct compat_ifmap ifru_map;
191 char ifru_slave[IFNAMSIZ]; /* Just fits the size */
Arnd Bergmann2dceba12009-11-06 08:09:03 +0000192 char ifru_newname[IFNAMSIZ];
Arnd Bergmann7a50a242009-11-08 20:57:03 -0800193 compat_caddr_t ifru_data;
194 struct compat_if_settings ifru_settings;
195 } ifr_ifru;
Arnd Bergmann2dceba12009-11-06 08:09:03 +0000196};
197
198struct compat_ifconf {
199 compat_int_t ifc_len; /* size of buffer */
200 compat_caddr_t ifcbuf;
201};
202
Ingo Molnar34f192c2006-03-27 01:16:24 -0800203struct compat_robust_list {
204 compat_uptr_t next;
205};
206
207struct compat_robust_list_head {
208 struct compat_robust_list list;
209 compat_long_t futex_offset;
210 compat_uptr_t list_op_pending;
211};
212
Chris Metcalfbe84cb42011-05-09 13:12:30 -0400213struct compat_statfs;
214struct compat_statfs64;
215struct compat_old_linux_dirent;
216struct compat_linux_dirent;
217struct linux_dirent64;
218struct compat_msghdr;
219struct compat_mmsghdr;
220struct compat_sysinfo;
221struct compat_sysctl_args;
222struct compat_kexec_segment;
223struct compat_mq_attr;
224
Ingo Molnar34f192c2006-03-27 01:16:24 -0800225extern void compat_exit_robust_list(struct task_struct *curr);
226
227asmlinkage long
228compat_sys_set_robust_list(struct compat_robust_list_head __user *head,
229 compat_size_t len);
230asmlinkage long
Al Viroba46df92006-10-10 22:46:07 +0100231compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
Ingo Molnar34f192c2006-03-27 01:16:24 -0800232 compat_size_t __user *len_ptr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233
234long compat_sys_semctl(int first, int second, int third, void __user *uptr);
235long compat_sys_msgsnd(int first, int second, int third, void __user *uptr);
236long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
237 int version, void __user *uptr);
238long compat_sys_msgctl(int first, int second, void __user *uptr);
239long compat_sys_shmat(int first, int second, compat_uptr_t third, int version,
240 void __user *uptr);
241long compat_sys_shmctl(int first, int second, void __user *uptr);
242long compat_sys_semtimedop(int semid, struct sembuf __user *tsems,
243 unsigned nsems, const struct compat_timespec __user *timeout);
244asmlinkage long compat_sys_keyctl(u32 option,
245 u32 arg2, u32 arg3, u32 arg4, u32 arg5);
Christoph Hellwig2b1c6bd2008-11-28 10:09:09 +0100246asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700247
248asmlinkage ssize_t compat_sys_readv(unsigned long fd,
249 const struct compat_iovec __user *vec, unsigned long vlen);
250asmlinkage ssize_t compat_sys_writev(unsigned long fd,
251 const struct compat_iovec __user *vec, unsigned long vlen);
Gerd Hoffmannf3554f42009-04-02 16:59:23 -0700252asmlinkage ssize_t compat_sys_preadv(unsigned long fd,
253 const struct compat_iovec __user *vec,
Linus Torvalds601cc112009-04-03 08:03:22 -0700254 unsigned long vlen, u32 pos_low, u32 pos_high);
Gerd Hoffmannf3554f42009-04-02 16:59:23 -0700255asmlinkage ssize_t compat_sys_pwritev(unsigned long fd,
256 const struct compat_iovec __user *vec,
Linus Torvalds601cc112009-04-03 08:03:22 -0700257 unsigned long vlen, u32 pos_low, u32 pos_high);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700258
259int compat_do_execve(char * filename, compat_uptr_t __user *argv,
260 compat_uptr_t __user *envp, struct pt_regs * regs);
261
262asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
263 compat_ulong_t __user *outp, compat_ulong_t __user *exp,
264 struct compat_timeval __user *tvp);
265
Christoph Hellwig5d0e5282010-03-10 15:21:13 -0800266asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg);
267
Thomas Gleixnerc202f292008-01-30 13:30:08 +0100268asmlinkage long compat_sys_wait4(compat_pid_t pid,
Al Viro7d61c452008-03-29 03:09:28 +0000269 compat_uint_t __user *stat_addr, int options,
270 struct compat_rusage __user *ru);
Thomas Gleixnerc202f292008-01-30 13:30:08 +0100271
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272#define BITS_PER_COMPAT_LONG (8*sizeof(compat_long_t))
273
274#define BITS_TO_COMPAT_LONGS(bits) \
275 (((bits)+BITS_PER_COMPAT_LONG-1)/BITS_PER_COMPAT_LONG)
276
Stephen Rothwell5fa38392006-10-28 10:38:46 -0700277long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700278 unsigned long bitmap_size);
279long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask,
280 unsigned long bitmap_size);
281int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from);
282int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from);
283int get_compat_sigevent(struct sigevent *event,
284 const struct compat_sigevent __user *u_event);
Thomas Gleixner62ab4502009-04-04 21:01:06 +0000285long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig,
286 struct compat_siginfo __user *uinfo);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700287
Andrew Morton643a6542006-02-11 17:55:52 -0800288static inline int compat_timeval_compare(struct compat_timeval *lhs,
289 struct compat_timeval *rhs)
290{
291 if (lhs->tv_sec < rhs->tv_sec)
292 return -1;
293 if (lhs->tv_sec > rhs->tv_sec)
294 return 1;
295 return lhs->tv_usec - rhs->tv_usec;
296}
297
298static inline int compat_timespec_compare(struct compat_timespec *lhs,
299 struct compat_timespec *rhs)
300{
301 if (lhs->tv_sec < rhs->tv_sec)
302 return -1;
303 if (lhs->tv_sec > rhs->tv_sec)
304 return 1;
305 return lhs->tv_nsec - rhs->tv_nsec;
306}
307
Davide Libenzi83f5d122007-05-10 22:23:18 -0700308extern int get_compat_itimerspec(struct itimerspec *dst,
309 const struct compat_itimerspec __user *src);
310extern int put_compat_itimerspec(struct compat_itimerspec __user *dst,
311 const struct itimerspec *src);
312
Christoph Hellwigb418da12008-10-15 22:02:06 -0700313asmlinkage long compat_sys_gettimeofday(struct compat_timeval __user *tv,
314 struct timezone __user *tz);
315asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv,
316 struct timezone __user *tz);
317
Stephen Rothwell3158e942006-03-26 01:37:29 -0800318asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);
319
Andi Kleenbebfa102006-06-26 13:56:52 +0200320extern int compat_printk(const char *fmt, ...);
Linus Torvalds02354972006-10-02 14:05:20 -0700321extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
Andi Kleenbebfa102006-06-26 13:56:52 +0200322
Stephen Rothwell3fd59392006-11-02 22:07:24 -0800323asmlinkage long compat_sys_migrate_pages(compat_pid_t pid,
324 compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes,
325 const compat_ulong_t __user *new_nodes);
326
Roland McGrath032d82d2008-01-30 13:31:47 +0100327extern int compat_ptrace_request(struct task_struct *child,
328 compat_long_t request,
329 compat_ulong_t addr, compat_ulong_t data);
330
Roland McGrathc269f192008-01-30 13:31:48 +0100331extern long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
332 compat_ulong_t addr, compat_ulong_t data);
333asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
334 compat_long_t addr, compat_long_t data);
Roland McGrathc269f192008-01-30 13:31:48 +0100335
Davide Libenzif6dfb4f2007-03-07 20:41:21 -0800336/*
337 * epoll (fs/eventpoll.c) compat bits follow ...
338 */
Davide Libenzif6dfb4f2007-03-07 20:41:21 -0800339struct epoll_event;
340#define compat_epoll_event epoll_event
Davide Libenzif6dfb4f2007-03-07 20:41:21 -0800341asmlinkage long compat_sys_epoll_pwait(int epfd,
342 struct compat_epoll_event __user *events,
343 int maxevents, int timeout,
344 const compat_sigset_t __user *sigmask,
345 compat_size_t sigsetsize);
346
Chris Metcalfbe84cb42011-05-09 13:12:30 -0400347asmlinkage long compat_sys_utime(const char __user *filename,
348 struct compat_utimbuf __user *t);
David Howellsc7887322010-08-11 11:26:22 +0100349asmlinkage long compat_sys_utimensat(unsigned int dfd, const char __user *filename,
Stephen Rothwell97416ce2007-05-09 02:32:35 -0700350 struct compat_timespec __user *t, int flags);
351
Chris Metcalfbe84cb42011-05-09 13:12:30 -0400352asmlinkage long compat_sys_time(compat_time_t __user *tloc);
353asmlinkage long compat_sys_stime(compat_time_t __user *tptr);
Stephen Rothwell140ff8b2007-05-14 13:47:47 +1000354asmlinkage long compat_sys_signalfd(int ufd,
355 const compat_sigset_t __user *sigmask,
356 compat_size_t sigsetsize);
Davide Libenzi4d672e72008-02-04 22:27:26 -0800357asmlinkage long compat_sys_timerfd_settime(int ufd, int flags,
358 const struct compat_itimerspec __user *utmr,
359 struct compat_itimerspec __user *otmr);
360asmlinkage long compat_sys_timerfd_gettime(int ufd,
361 struct compat_itimerspec __user *otmr);
Stephen Rothwell140ff8b2007-05-14 13:47:47 +1000362
Heiko Carstens4c696ba2009-01-14 14:13:53 +0100363asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page,
364 __u32 __user *pages,
365 const int __user *nodes,
366 int __user *status,
367 int flags);
David Howellsc7887322010-08-11 11:26:22 +0100368asmlinkage long compat_sys_futimesat(unsigned int dfd, const char __user *filename,
Heiko Carstens4c696ba2009-01-14 14:13:53 +0100369 struct compat_timeval __user *t);
Chris Metcalfbe84cb42011-05-09 13:12:30 -0400370asmlinkage long compat_sys_utimes(const char __user *filename,
371 struct compat_timeval __user *t);
372asmlinkage long compat_sys_newstat(const char __user * filename,
373 struct compat_stat __user *statbuf);
374asmlinkage long compat_sys_newlstat(const char __user * filename,
375 struct compat_stat __user *statbuf);
David Howellsc7887322010-08-11 11:26:22 +0100376asmlinkage long compat_sys_newfstatat(unsigned int dfd, const char __user * filename,
Heiko Carstens4c696ba2009-01-14 14:13:53 +0100377 struct compat_stat __user *statbuf,
378 int flag);
Chris Metcalfbe84cb42011-05-09 13:12:30 -0400379asmlinkage long compat_sys_newfstat(unsigned int fd,
380 struct compat_stat __user * statbuf);
381asmlinkage long compat_sys_statfs(const char __user *pathname,
382 struct compat_statfs __user *buf);
383asmlinkage long compat_sys_fstatfs(unsigned int fd,
384 struct compat_statfs __user *buf);
385asmlinkage long compat_sys_statfs64(const char __user *pathname,
386 compat_size_t sz,
387 struct compat_statfs64 __user *buf);
388asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz,
389 struct compat_statfs64 __user *buf);
390asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd,
391 unsigned long arg);
392asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd,
393 unsigned long arg);
394asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p);
395asmlinkage long compat_sys_io_getevents(aio_context_t ctx_id,
396 unsigned long min_nr,
397 unsigned long nr,
398 struct io_event __user *events,
399 struct compat_timespec __user *timeout);
400asmlinkage long compat_sys_io_submit(aio_context_t ctx_id, int nr,
401 u32 __user *iocb);
402asmlinkage long compat_sys_mount(const char __user * dev_name,
403 const char __user * dir_name,
404 const char __user * type, unsigned long flags,
405 const void __user * data);
406asmlinkage long compat_sys_old_readdir(unsigned int fd,
407 struct compat_old_linux_dirent __user *,
408 unsigned int count);
409asmlinkage long compat_sys_getdents(unsigned int fd,
410 struct compat_linux_dirent __user *dirent,
411 unsigned int count);
412asmlinkage long compat_sys_getdents64(unsigned int fd,
413 struct linux_dirent64 __user * dirent,
414 unsigned int count);
415asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *,
416 unsigned int nr_segs, unsigned int flags);
417asmlinkage long compat_sys_open(const char __user *filename, int flags,
418 int mode);
Heiko Carstens4c696ba2009-01-14 14:13:53 +0100419asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
420 int flags, int mode);
Chris Metcalfbe84cb42011-05-09 13:12:30 -0400421asmlinkage long compat_sys_open_by_handle_at(int mountdirfd,
422 struct file_handle __user *handle,
423 int flags);
424asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp,
425 compat_ulong_t __user *outp,
426 compat_ulong_t __user *exp,
427 struct compat_timespec __user *tsp,
428 void __user *sig);
429asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
430 unsigned int nfds,
431 struct compat_timespec __user *tsp,
432 const compat_sigset_t __user *sigmask,
433 compat_size_t sigsetsize);
434#if (defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE)) && !defined(CONFIG_NFSD_DEPRECATED)
435union compat_nfsctl_res;
436struct compat_nfsctl_arg;
437asmlinkage long compat_sys_nfsservctl(int cmd,
438 struct compat_nfsctl_arg __user *arg,
439 union compat_nfsctl_res __user *res);
440#else
441long asmlinkage compat_sys_nfsservctl(int cmd, void *notused, void *notused2);
442#endif
443asmlinkage long compat_sys_signalfd4(int ufd,
444 const compat_sigset_t __user *sigmask,
445 compat_size_t sigsetsize, int flags);
446asmlinkage long compat_sys_get_mempolicy(int __user *policy,
447 compat_ulong_t __user *nmask,
448 compat_ulong_t maxnode,
449 compat_ulong_t addr,
450 compat_ulong_t flags);
451asmlinkage long compat_sys_set_mempolicy(int mode, compat_ulong_t __user *nmask,
452 compat_ulong_t maxnode);
453asmlinkage long compat_sys_mbind(compat_ulong_t start, compat_ulong_t len,
454 compat_ulong_t mode,
455 compat_ulong_t __user *nmask,
456 compat_ulong_t maxnode, compat_ulong_t flags);
457
458asmlinkage long compat_sys_setsockopt(int fd, int level, int optname,
459 char __user *optval, unsigned int optlen);
460asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg,
461 unsigned flags);
462asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg,
463 unsigned int flags);
464asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len,
465 unsigned flags);
466asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, size_t len,
467 unsigned flags, struct sockaddr __user *addr,
468 int __user *addrlen);
469asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
470 unsigned vlen, unsigned int flags,
471 struct compat_timespec __user *timeout);
472asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
473 struct compat_timespec __user *rmtp);
474asmlinkage long compat_sys_getitimer(int which,
475 struct compat_itimerval __user *it);
476asmlinkage long compat_sys_setitimer(int which,
477 struct compat_itimerval __user *in,
478 struct compat_itimerval __user *out);
479asmlinkage long compat_sys_times(struct compat_tms __user *tbuf);
480asmlinkage long compat_sys_setrlimit(unsigned int resource,
481 struct compat_rlimit __user *rlim);
482asmlinkage long compat_sys_getrlimit (unsigned int resource,
483 struct compat_rlimit __user *rlim);
484asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru);
485asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid,
486 unsigned int len,
487 compat_ulong_t __user *user_mask_ptr);
488asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid,
489 unsigned int len,
490 compat_ulong_t __user *user_mask_ptr);
491asmlinkage long compat_sys_timer_create(clockid_t which_clock,
492 struct compat_sigevent __user *timer_event_spec,
493 timer_t __user *created_timer_id);
494asmlinkage long compat_sys_timer_settime(timer_t timer_id, int flags,
495 struct compat_itimerspec __user *new,
496 struct compat_itimerspec __user *old);
497asmlinkage long compat_sys_timer_gettime(timer_t timer_id,
498 struct compat_itimerspec __user *setting);
499asmlinkage long compat_sys_clock_settime(clockid_t which_clock,
500 struct compat_timespec __user *tp);
501asmlinkage long compat_sys_clock_gettime(clockid_t which_clock,
502 struct compat_timespec __user *tp);
503asmlinkage long compat_sys_clock_adjtime(clockid_t which_clock,
504 struct compat_timex __user *tp);
505asmlinkage long compat_sys_clock_getres(clockid_t which_clock,
506 struct compat_timespec __user *tp);
507asmlinkage long compat_sys_clock_nanosleep(clockid_t which_clock, int flags,
508 struct compat_timespec __user *rqtp,
509 struct compat_timespec __user *rmtp);
510asmlinkage long compat_sys_rt_sigtimedwait (compat_sigset_t __user *uthese,
511 struct compat_siginfo __user *uinfo,
512 struct compat_timespec __user *uts, compat_size_t sigsetsize);
513asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset,
514 compat_size_t sigsetsize);
515asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info);
516asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
517 unsigned long arg);
518asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val,
519 struct compat_timespec __user *utime, u32 __user *uaddr2,
520 u32 val3);
521asmlinkage long compat_sys_getsockopt(int fd, int level, int optname,
522 char __user *optval, int __user *optlen);
523asmlinkage long compat_sys_kexec_load(unsigned long entry,
524 unsigned long nr_segments,
525 struct compat_kexec_segment __user *,
526 unsigned long flags);
527asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes,
528 const struct compat_mq_attr __user *u_mqstat,
529 struct compat_mq_attr __user *u_omqstat);
530asmlinkage long compat_sys_mq_notify(mqd_t mqdes,
531 const struct compat_sigevent __user *u_notification);
532asmlinkage long compat_sys_mq_open(const char __user *u_name,
533 int oflag, compat_mode_t mode,
534 struct compat_mq_attr __user *u_attr);
535asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes,
536 const char __user *u_msg_ptr,
537 size_t msg_len, unsigned int msg_prio,
538 const struct compat_timespec __user *u_abs_timeout);
539asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes,
540 char __user *u_msg_ptr,
541 size_t msg_len, unsigned int __user *u_msg_prio,
542 const struct compat_timespec __user *u_abs_timeout);
543asmlinkage long compat_sys_socketcall(int call, u32 __user *args);
544asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args);
Heiko Carstens4c696ba2009-01-14 14:13:53 +0100545
Jeff Moyerb8373362010-05-26 14:44:25 -0700546extern ssize_t compat_rw_copy_check_uvector(int type,
547 const struct compat_iovec __user *uvector, unsigned long nr_segs,
548 unsigned long fast_segs, struct iovec *fast_pointer,
549 struct iovec **ret_pointer);
H. Peter Anvinc41d68a2010-09-07 16:16:18 -0700550
551extern void __user *compat_alloc_user_space(unsigned long len);
552
Linus Torvalds1da177e2005-04-16 15:20:36 -0700553#endif /* CONFIG_COMPAT */
554#endif /* _LINUX_COMPAT_H */