aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/compat.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 18:35:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 18:35:32 -0400
commit0798b1dbfbd9ff2a370c5968c5f0621ef0075fe0 (patch)
treec7f61ab9683786a070da0933b9981fc74a4d865f /include/linux/compat.h
parentad363e0916423b2e6cdfcdc30ae707ec709f0a65 (diff)
parent6738d3210aabe3016a1b03cd98a7fc479c229197 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
* git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile: (26 commits) arch/tile: prefer "tilepro" as the name of the 32-bit architecture compat: include aio_abi.h for aio_context_t arch/tile: cleanups for tilegx compat mode arch/tile: allocate PCI IRQs later in boot arch/tile: support signal "exception-trace" hook arch/tile: use better definitions of xchg() and cmpxchg() include/linux/compat.h: coding-style fixes tile: add an RTC driver for the Tilera hypervisor arch/tile: finish enabling support for TILE-Gx 64-bit chip compat: fixes to allow working with tile arch arch/tile: update defconfig file to something more useful tile: do_hardwall_trap: do not play with task->sighand tile: replace mm->cpu_vm_mask with mm_cpumask() tile,mn10300: add device parameter to dma_cache_sync() audit: support the "standard" <asm-generic/unistd.h> arch/tile: clarify flush_buffer()/finv_buffer() function names arch/tile: kernel-related cleanups from removing static page size arch/tile: various header improvements for building drivers arch/tile: disable GX prefetcher during cache flush arch/tile: tolerate disabling CONFIG_BLK_DEV_INITRD ...
Diffstat (limited to 'include/linux/compat.h')
-rw-r--r--include/linux/compat.h236
1 files changed, 216 insertions, 20 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 5778b559d59c..ddcb7db38e67 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -12,6 +12,8 @@
12#include <linux/sem.h> 12#include <linux/sem.h>
13#include <linux/socket.h> 13#include <linux/socket.h>
14#include <linux/if.h> 14#include <linux/if.h>
15#include <linux/fs.h>
16#include <linux/aio_abi.h> /* for aio_context_t */
15 17
16#include <asm/compat.h> 18#include <asm/compat.h>
17#include <asm/siginfo.h> 19#include <asm/siginfo.h>
@@ -26,7 +28,7 @@ typedef __compat_gid32_t compat_gid_t;
26struct compat_sel_arg_struct; 28struct compat_sel_arg_struct;
27struct rusage; 29struct rusage;
28 30
29struct compat_itimerspec { 31struct compat_itimerspec {
30 struct compat_timespec it_interval; 32 struct compat_timespec it_interval;
31 struct compat_timespec it_value; 33 struct compat_timespec it_value;
32}; 34};
@@ -70,9 +72,9 @@ struct compat_timex {
70 compat_long_t stbcnt; 72 compat_long_t stbcnt;
71 compat_int_t tai; 73 compat_int_t tai;
72 74
73 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;
74 compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32; 76 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; 77 compat_int_t:32; compat_int_t:32; compat_int_t:32;
76}; 78};
77 79
78#define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW) 80#define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
@@ -81,8 +83,10 @@ typedef struct {
81 compat_sigset_word sig[_COMPAT_NSIG_WORDS]; 83 compat_sigset_word sig[_COMPAT_NSIG_WORDS];
82} compat_sigset_t; 84} compat_sigset_t;
83 85
84extern int get_compat_timespec(struct timespec *, const struct compat_timespec __user *); 86extern int get_compat_timespec(struct timespec *,
85extern int put_compat_timespec(const struct timespec *, struct compat_timespec __user *); 87 const struct compat_timespec __user *);
88extern int put_compat_timespec(const struct timespec *,
89 struct compat_timespec __user *);
86 90
87struct compat_iovec { 91struct compat_iovec {
88 compat_uptr_t iov_base; 92 compat_uptr_t iov_base;
@@ -113,7 +117,8 @@ struct compat_rusage {
113 compat_long_t ru_nivcsw; 117 compat_long_t ru_nivcsw;
114}; 118};
115 119
116extern int put_compat_rusage(const struct rusage *, struct compat_rusage __user *); 120extern int put_compat_rusage(const struct rusage *,
121 struct compat_rusage __user *);
117 122
118struct compat_siginfo; 123struct compat_siginfo;
119 124
@@ -166,8 +171,7 @@ struct compat_ifmap {
166 unsigned char port; 171 unsigned char port;
167}; 172};
168 173
169struct compat_if_settings 174struct compat_if_settings {
170{
171 unsigned int type; /* Type of physical device or protocol */ 175 unsigned int type; /* Type of physical device or protocol */
172 unsigned int size; /* Size of the data allocated by the caller */ 176 unsigned int size; /* Size of the data allocated by the caller */
173 compat_uptr_t ifs_ifsu; /* union of pointers */ 177 compat_uptr_t ifs_ifsu; /* union of pointers */
@@ -195,8 +199,8 @@ struct compat_ifreq {
195}; 199};
196 200
197struct compat_ifconf { 201struct compat_ifconf {
198 compat_int_t ifc_len; /* size of buffer */ 202 compat_int_t ifc_len; /* size of buffer */
199 compat_caddr_t ifcbuf; 203 compat_caddr_t ifcbuf;
200}; 204};
201 205
202struct compat_robust_list { 206struct compat_robust_list {
@@ -209,6 +213,18 @@ struct compat_robust_list_head {
209 compat_uptr_t list_op_pending; 213 compat_uptr_t list_op_pending;
210}; 214};
211 215
216struct compat_statfs;
217struct compat_statfs64;
218struct compat_old_linux_dirent;
219struct compat_linux_dirent;
220struct linux_dirent64;
221struct compat_msghdr;
222struct compat_mmsghdr;
223struct compat_sysinfo;
224struct compat_sysctl_args;
225struct compat_kexec_segment;
226struct compat_mq_attr;
227
212extern void compat_exit_robust_list(struct task_struct *curr); 228extern void compat_exit_robust_list(struct task_struct *curr);
213 229
214asmlinkage long 230asmlinkage long
@@ -243,8 +259,8 @@ asmlinkage ssize_t compat_sys_pwritev(unsigned long fd,
243 const struct compat_iovec __user *vec, 259 const struct compat_iovec __user *vec,
244 unsigned long vlen, u32 pos_low, u32 pos_high); 260 unsigned long vlen, u32 pos_low, u32 pos_high);
245 261
246int compat_do_execve(char * filename, compat_uptr_t __user *argv, 262int compat_do_execve(char *filename, compat_uptr_t __user *argv,
247 compat_uptr_t __user *envp, struct pt_regs * regs); 263 compat_uptr_t __user *envp, struct pt_regs *regs);
248 264
249asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, 265asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
250 compat_ulong_t __user *outp, compat_ulong_t __user *exp, 266 compat_ulong_t __user *outp, compat_ulong_t __user *exp,
@@ -331,12 +347,18 @@ asmlinkage long compat_sys_epoll_pwait(int epfd,
331 const compat_sigset_t __user *sigmask, 347 const compat_sigset_t __user *sigmask,
332 compat_size_t sigsetsize); 348 compat_size_t sigsetsize);
333 349
334asmlinkage long compat_sys_utimensat(unsigned int dfd, const char __user *filename, 350asmlinkage long compat_sys_utime(const char __user *filename,
335 struct compat_timespec __user *t, int flags); 351 struct compat_utimbuf __user *t);
352asmlinkage long compat_sys_utimensat(unsigned int dfd,
353 const char __user *filename,
354 struct compat_timespec __user *t,
355 int flags);
336 356
357asmlinkage long compat_sys_time(compat_time_t __user *tloc);
358asmlinkage long compat_sys_stime(compat_time_t __user *tptr);
337asmlinkage long compat_sys_signalfd(int ufd, 359asmlinkage long compat_sys_signalfd(int ufd,
338 const compat_sigset_t __user *sigmask, 360 const compat_sigset_t __user *sigmask,
339 compat_size_t sigsetsize); 361 compat_size_t sigsetsize);
340asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, 362asmlinkage long compat_sys_timerfd_settime(int ufd, int flags,
341 const struct compat_itimerspec __user *utmr, 363 const struct compat_itimerspec __user *utmr,
342 struct compat_itimerspec __user *otmr); 364 struct compat_itimerspec __user *otmr);
@@ -348,16 +370,190 @@ asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page,
348 const int __user *nodes, 370 const int __user *nodes,
349 int __user *status, 371 int __user *status,
350 int flags); 372 int flags);
351asmlinkage long compat_sys_futimesat(unsigned int dfd, const char __user *filename, 373asmlinkage long compat_sys_futimesat(unsigned int dfd,
374 const char __user *filename,
352 struct compat_timeval __user *t); 375 struct compat_timeval __user *t);
353asmlinkage long compat_sys_newfstatat(unsigned int dfd, const char __user * filename, 376asmlinkage long compat_sys_utimes(const char __user *filename,
377 struct compat_timeval __user *t);
378asmlinkage long compat_sys_newstat(const char __user *filename,
379 struct compat_stat __user *statbuf);
380asmlinkage long compat_sys_newlstat(const char __user *filename,
381 struct compat_stat __user *statbuf);
382asmlinkage long compat_sys_newfstatat(unsigned int dfd,
383 const char __user *filename,
354 struct compat_stat __user *statbuf, 384 struct compat_stat __user *statbuf,
355 int flag); 385 int flag);
386asmlinkage long compat_sys_newfstat(unsigned int fd,
387 struct compat_stat __user *statbuf);
388asmlinkage long compat_sys_statfs(const char __user *pathname,
389 struct compat_statfs __user *buf);
390asmlinkage long compat_sys_fstatfs(unsigned int fd,
391 struct compat_statfs __user *buf);
392asmlinkage long compat_sys_statfs64(const char __user *pathname,
393 compat_size_t sz,
394 struct compat_statfs64 __user *buf);
395asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz,
396 struct compat_statfs64 __user *buf);
397asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd,
398 unsigned long arg);
399asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd,
400 unsigned long arg);
401asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p);
402asmlinkage long compat_sys_io_getevents(aio_context_t ctx_id,
403 unsigned long min_nr,
404 unsigned long nr,
405 struct io_event __user *events,
406 struct compat_timespec __user *timeout);
407asmlinkage long compat_sys_io_submit(aio_context_t ctx_id, int nr,
408 u32 __user *iocb);
409asmlinkage long compat_sys_mount(const char __user *dev_name,
410 const char __user *dir_name,
411 const char __user *type, unsigned long flags,
412 const void __user *data);
413asmlinkage long compat_sys_old_readdir(unsigned int fd,
414 struct compat_old_linux_dirent __user *,
415 unsigned int count);
416asmlinkage long compat_sys_getdents(unsigned int fd,
417 struct compat_linux_dirent __user *dirent,
418 unsigned int count);
419asmlinkage long compat_sys_getdents64(unsigned int fd,
420 struct linux_dirent64 __user *dirent,
421 unsigned int count);
422asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *,
423 unsigned int nr_segs, unsigned int flags);
424asmlinkage long compat_sys_open(const char __user *filename, int flags,
425 int mode);
356asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, 426asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
357 int flags, int mode); 427 int flags, int mode);
428asmlinkage long compat_sys_open_by_handle_at(int mountdirfd,
429 struct file_handle __user *handle,
430 int flags);
431asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp,
432 compat_ulong_t __user *outp,
433 compat_ulong_t __user *exp,
434 struct compat_timespec __user *tsp,
435 void __user *sig);
436asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
437 unsigned int nfds,
438 struct compat_timespec __user *tsp,
439 const compat_sigset_t __user *sigmask,
440 compat_size_t sigsetsize);
441#if (defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE)) && \
442 !defined(CONFIG_NFSD_DEPRECATED)
443union compat_nfsctl_res;
444struct compat_nfsctl_arg;
445asmlinkage long compat_sys_nfsservctl(int cmd,
446 struct compat_nfsctl_arg __user *arg,
447 union compat_nfsctl_res __user *res);
448#else
449asmlinkage long compat_sys_nfsservctl(int cmd, void *notused, void *notused2);
450#endif
451asmlinkage long compat_sys_signalfd4(int ufd,
452 const compat_sigset_t __user *sigmask,
453 compat_size_t sigsetsize, int flags);
454asmlinkage long compat_sys_get_mempolicy(int __user *policy,
455 compat_ulong_t __user *nmask,
456 compat_ulong_t maxnode,
457 compat_ulong_t addr,
458 compat_ulong_t flags);
459asmlinkage long compat_sys_set_mempolicy(int mode, compat_ulong_t __user *nmask,
460 compat_ulong_t maxnode);
461asmlinkage long compat_sys_mbind(compat_ulong_t start, compat_ulong_t len,
462 compat_ulong_t mode,
463 compat_ulong_t __user *nmask,
464 compat_ulong_t maxnode, compat_ulong_t flags);
465
466asmlinkage long compat_sys_setsockopt(int fd, int level, int optname,
467 char __user *optval, unsigned int optlen);
468asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg,
469 unsigned flags);
470asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg,
471 unsigned int flags);
472asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len,
473 unsigned flags);
474asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, size_t len,
475 unsigned flags, struct sockaddr __user *addr,
476 int __user *addrlen);
477asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
478 unsigned vlen, unsigned int flags,
479 struct compat_timespec __user *timeout);
480asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
481 struct compat_timespec __user *rmtp);
482asmlinkage long compat_sys_getitimer(int which,
483 struct compat_itimerval __user *it);
484asmlinkage long compat_sys_setitimer(int which,
485 struct compat_itimerval __user *in,
486 struct compat_itimerval __user *out);
487asmlinkage long compat_sys_times(struct compat_tms __user *tbuf);
488asmlinkage long compat_sys_setrlimit(unsigned int resource,
489 struct compat_rlimit __user *rlim);
490asmlinkage long compat_sys_getrlimit(unsigned int resource,
491 struct compat_rlimit __user *rlim);
492asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru);
493asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid,
494 unsigned int len,
495 compat_ulong_t __user *user_mask_ptr);
496asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid,
497 unsigned int len,
498 compat_ulong_t __user *user_mask_ptr);
499asmlinkage long compat_sys_timer_create(clockid_t which_clock,
500 struct compat_sigevent __user *timer_event_spec,
501 timer_t __user *created_timer_id);
502asmlinkage long compat_sys_timer_settime(timer_t timer_id, int flags,
503 struct compat_itimerspec __user *new,
504 struct compat_itimerspec __user *old);
505asmlinkage long compat_sys_timer_gettime(timer_t timer_id,
506 struct compat_itimerspec __user *setting);
507asmlinkage long compat_sys_clock_settime(clockid_t which_clock,
508 struct compat_timespec __user *tp);
509asmlinkage long compat_sys_clock_gettime(clockid_t which_clock,
510 struct compat_timespec __user *tp);
511asmlinkage long compat_sys_clock_adjtime(clockid_t which_clock,
512 struct compat_timex __user *tp);
513asmlinkage long compat_sys_clock_getres(clockid_t which_clock,
514 struct compat_timespec __user *tp);
515asmlinkage long compat_sys_clock_nanosleep(clockid_t which_clock, int flags,
516 struct compat_timespec __user *rqtp,
517 struct compat_timespec __user *rmtp);
518asmlinkage long compat_sys_rt_sigtimedwait(compat_sigset_t __user *uthese,
519 struct compat_siginfo __user *uinfo,
520 struct compat_timespec __user *uts, compat_size_t sigsetsize);
521asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset,
522 compat_size_t sigsetsize);
523asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info);
524asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
525 unsigned long arg);
526asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val,
527 struct compat_timespec __user *utime, u32 __user *uaddr2,
528 u32 val3);
529asmlinkage long compat_sys_getsockopt(int fd, int level, int optname,
530 char __user *optval, int __user *optlen);
531asmlinkage long compat_sys_kexec_load(unsigned long entry,
532 unsigned long nr_segments,
533 struct compat_kexec_segment __user *,
534 unsigned long flags);
535asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes,
536 const struct compat_mq_attr __user *u_mqstat,
537 struct compat_mq_attr __user *u_omqstat);
538asmlinkage long compat_sys_mq_notify(mqd_t mqdes,
539 const struct compat_sigevent __user *u_notification);
540asmlinkage long compat_sys_mq_open(const char __user *u_name,
541 int oflag, compat_mode_t mode,
542 struct compat_mq_attr __user *u_attr);
543asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes,
544 const char __user *u_msg_ptr,
545 size_t msg_len, unsigned int msg_prio,
546 const struct compat_timespec __user *u_abs_timeout);
547asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes,
548 char __user *u_msg_ptr,
549 size_t msg_len, unsigned int __user *u_msg_prio,
550 const struct compat_timespec __user *u_abs_timeout);
551asmlinkage long compat_sys_socketcall(int call, u32 __user *args);
552asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args);
358 553
359extern ssize_t compat_rw_copy_check_uvector(int type, 554extern ssize_t compat_rw_copy_check_uvector(int type,
360 const struct compat_iovec __user *uvector, unsigned long nr_segs, 555 const struct compat_iovec __user *uvector,
556 unsigned long nr_segs,
361 unsigned long fast_segs, struct iovec *fast_pointer, 557 unsigned long fast_segs, struct iovec *fast_pointer,
362 struct iovec **ret_pointer); 558 struct iovec **ret_pointer);
363 559