compat.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. #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. */
  7. #ifdef CONFIG_COMPAT
  8. #include <linux/stat.h>
  9. #include <linux/param.h> /* for HZ */
  10. #include <linux/sem.h>
  11. #include <linux/socket.h>
  12. #include <linux/if.h>
  13. #include <linux/fs.h>
  14. #include <linux/aio_abi.h> /* for aio_context_t */
  15. #include <asm/compat.h>
  16. #include <asm/siginfo.h>
  17. #include <asm/signal.h>
  18. #ifndef COMPAT_USE_64BIT_TIME
  19. #define COMPAT_USE_64BIT_TIME 0
  20. #endif
  21. #ifndef __SC_DELOUSE
  22. #define __SC_DELOUSE(t,v) ((t)(unsigned long)(v))
  23. #endif
  24. #define __SC_CCAST1(t1, a1) __SC_DELOUSE(t1,a1)
  25. #define __SC_CCAST2(t2, a2, ...) __SC_DELOUSE(t2,a2), __SC_CCAST1(__VA_ARGS__)
  26. #define __SC_CCAST3(t3, a3, ...) __SC_DELOUSE(t3,a3), __SC_CCAST2(__VA_ARGS__)
  27. #define __SC_CCAST4(t4, a4, ...) __SC_DELOUSE(t4,a4), __SC_CCAST3(__VA_ARGS__)
  28. #define __SC_CCAST5(t5, a5, ...) __SC_DELOUSE(t5,a5), __SC_CCAST4(__VA_ARGS__)
  29. #define __SC_CCAST6(t6, a6, ...) __SC_DELOUSE(t6,a6), __SC_CCAST5(__VA_ARGS__)
  30. #define COMPAT_SYSCALL_DEFINE1(name, ...) \
  31. COMPAT_SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
  32. #define COMPAT_SYSCALL_DEFINE2(name, ...) \
  33. COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
  34. #define COMPAT_SYSCALL_DEFINE3(name, ...) \
  35. COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
  36. #define COMPAT_SYSCALL_DEFINE4(name, ...) \
  37. COMPAT_SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
  38. #define COMPAT_SYSCALL_DEFINE5(name, ...) \
  39. COMPAT_SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
  40. #define COMPAT_SYSCALL_DEFINE6(name, ...) \
  41. COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
  42. #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
  43. #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
  44. asmlinkage long compat_sys##name(__SC_DECL##x(__VA_ARGS__)); \
  45. static inline long C_SYSC##name(__SC_DECL##x(__VA_ARGS__)); \
  46. asmlinkage long compat_SyS##name(__SC_LONG##x(__VA_ARGS__)) \
  47. { \
  48. return (long) C_SYSC##name(__SC_CCAST##x(__VA_ARGS__)); \
  49. } \
  50. SYSCALL_ALIAS(compat_sys##name, compat_SyS##name); \
  51. static inline long C_SYSC##name(__SC_DECL##x(__VA_ARGS__))
  52. #else /* CONFIG_HAVE_SYSCALL_WRAPPERS */
  53. #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
  54. asmlinkage long compat_sys##name(__SC_DECL##x(__VA_ARGS__))
  55. #endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */
  56. #ifndef compat_user_stack_pointer
  57. #define compat_user_stack_pointer() current_user_stack_pointer()
  58. #endif
  59. #ifdef CONFIG_GENERIC_SIGALTSTACK
  60. #ifndef compat_sigaltstack /* we'll need that for MIPS */
  61. typedef struct compat_sigaltstack {
  62. compat_uptr_t ss_sp;
  63. int ss_flags;
  64. compat_size_t ss_size;
  65. } compat_stack_t;
  66. #endif
  67. #endif
  68. #define compat_jiffies_to_clock_t(x) \
  69. (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
  70. typedef __compat_uid32_t compat_uid_t;
  71. typedef __compat_gid32_t compat_gid_t;
  72. struct compat_sel_arg_struct;
  73. struct rusage;
  74. struct compat_itimerspec {
  75. struct compat_timespec it_interval;
  76. struct compat_timespec it_value;
  77. };
  78. struct compat_utimbuf {
  79. compat_time_t actime;
  80. compat_time_t modtime;
  81. };
  82. struct compat_itimerval {
  83. struct compat_timeval it_interval;
  84. struct compat_timeval it_value;
  85. };
  86. struct compat_tms {
  87. compat_clock_t tms_utime;
  88. compat_clock_t tms_stime;
  89. compat_clock_t tms_cutime;
  90. compat_clock_t tms_cstime;
  91. };
  92. struct compat_timex {
  93. compat_uint_t modes;
  94. compat_long_t offset;
  95. compat_long_t freq;
  96. compat_long_t maxerror;
  97. compat_long_t esterror;
  98. compat_int_t status;
  99. compat_long_t constant;
  100. compat_long_t precision;
  101. compat_long_t tolerance;
  102. struct compat_timeval time;
  103. compat_long_t tick;
  104. compat_long_t ppsfreq;
  105. compat_long_t jitter;
  106. compat_int_t shift;
  107. compat_long_t stabil;
  108. compat_long_t jitcnt;
  109. compat_long_t calcnt;
  110. compat_long_t errcnt;
  111. compat_long_t stbcnt;
  112. compat_int_t tai;
  113. compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
  114. compat_int_t:32; compat_int_t:32; compat_int_t:32; compat_int_t:32;
  115. compat_int_t:32; compat_int_t:32; compat_int_t:32;
  116. };
  117. #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
  118. typedef struct {
  119. compat_sigset_word sig[_COMPAT_NSIG_WORDS];
  120. } compat_sigset_t;
  121. /*
  122. * These functions operate strictly on struct compat_time*
  123. */
  124. extern int get_compat_timespec(struct timespec *,
  125. const struct compat_timespec __user *);
  126. extern int put_compat_timespec(const struct timespec *,
  127. struct compat_timespec __user *);
  128. extern int get_compat_timeval(struct timeval *,
  129. const struct compat_timeval __user *);
  130. extern int put_compat_timeval(const struct timeval *,
  131. struct compat_timeval __user *);
  132. /*
  133. * These functions operate on 32- or 64-bit specs depending on
  134. * COMPAT_USE_64BIT_TIME, hence the void user pointer arguments and the
  135. * naming as compat_get/put_ rather than get/put_compat_.
  136. */
  137. extern int compat_get_timespec(struct timespec *, const void __user *);
  138. extern int compat_put_timespec(const struct timespec *, void __user *);
  139. extern int compat_get_timeval(struct timeval *, const void __user *);
  140. extern int compat_put_timeval(const struct timeval *, void __user *);
  141. struct compat_iovec {
  142. compat_uptr_t iov_base;
  143. compat_size_t iov_len;
  144. };
  145. struct compat_rlimit {
  146. compat_ulong_t rlim_cur;
  147. compat_ulong_t rlim_max;
  148. };
  149. struct compat_rusage {
  150. struct compat_timeval ru_utime;
  151. struct compat_timeval ru_stime;
  152. compat_long_t ru_maxrss;
  153. compat_long_t ru_ixrss;
  154. compat_long_t ru_idrss;
  155. compat_long_t ru_isrss;
  156. compat_long_t ru_minflt;
  157. compat_long_t ru_majflt;
  158. compat_long_t ru_nswap;
  159. compat_long_t ru_inblock;
  160. compat_long_t ru_oublock;
  161. compat_long_t ru_msgsnd;
  162. compat_long_t ru_msgrcv;
  163. compat_long_t ru_nsignals;
  164. compat_long_t ru_nvcsw;
  165. compat_long_t ru_nivcsw;
  166. };
  167. extern int put_compat_rusage(const struct rusage *,
  168. struct compat_rusage __user *);
  169. struct compat_siginfo;
  170. extern asmlinkage long compat_sys_waitid(int, compat_pid_t,
  171. struct compat_siginfo __user *, int,
  172. struct compat_rusage __user *);
  173. struct compat_dirent {
  174. u32 d_ino;
  175. compat_off_t d_off;
  176. u16 d_reclen;
  177. char d_name[256];
  178. };
  179. struct compat_ustat {
  180. compat_daddr_t f_tfree;
  181. compat_ino_t f_tinode;
  182. char f_fname[6];
  183. char f_fpack[6];
  184. };
  185. #define COMPAT_SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
  186. typedef struct compat_sigevent {
  187. compat_sigval_t sigev_value;
  188. compat_int_t sigev_signo;
  189. compat_int_t sigev_notify;
  190. union {
  191. compat_int_t _pad[COMPAT_SIGEV_PAD_SIZE];
  192. compat_int_t _tid;
  193. struct {
  194. compat_uptr_t _function;
  195. compat_uptr_t _attribute;
  196. } _sigev_thread;
  197. } _sigev_un;
  198. } compat_sigevent_t;
  199. struct compat_ifmap {
  200. compat_ulong_t mem_start;
  201. compat_ulong_t mem_end;
  202. unsigned short base_addr;
  203. unsigned char irq;
  204. unsigned char dma;
  205. unsigned char port;
  206. };
  207. struct compat_if_settings {
  208. unsigned int type; /* Type of physical device or protocol */
  209. unsigned int size; /* Size of the data allocated by the caller */
  210. compat_uptr_t ifs_ifsu; /* union of pointers */
  211. };
  212. struct compat_ifreq {
  213. union {
  214. char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
  215. } ifr_ifrn;
  216. union {
  217. struct sockaddr ifru_addr;
  218. struct sockaddr ifru_dstaddr;
  219. struct sockaddr ifru_broadaddr;
  220. struct sockaddr ifru_netmask;
  221. struct sockaddr ifru_hwaddr;
  222. short ifru_flags;
  223. compat_int_t ifru_ivalue;
  224. compat_int_t ifru_mtu;
  225. struct compat_ifmap ifru_map;
  226. char ifru_slave[IFNAMSIZ]; /* Just fits the size */
  227. char ifru_newname[IFNAMSIZ];
  228. compat_caddr_t ifru_data;
  229. struct compat_if_settings ifru_settings;
  230. } ifr_ifru;
  231. };
  232. struct compat_ifconf {
  233. compat_int_t ifc_len; /* size of buffer */
  234. compat_caddr_t ifcbuf;
  235. };
  236. struct compat_robust_list {
  237. compat_uptr_t next;
  238. };
  239. struct compat_robust_list_head {
  240. struct compat_robust_list list;
  241. compat_long_t futex_offset;
  242. compat_uptr_t list_op_pending;
  243. };
  244. struct compat_statfs;
  245. struct compat_statfs64;
  246. struct compat_old_linux_dirent;
  247. struct compat_linux_dirent;
  248. struct linux_dirent64;
  249. struct compat_msghdr;
  250. struct compat_mmsghdr;
  251. struct compat_sysinfo;
  252. struct compat_sysctl_args;
  253. struct compat_kexec_segment;
  254. struct compat_mq_attr;
  255. struct compat_msgbuf;
  256. extern void compat_exit_robust_list(struct task_struct *curr);
  257. asmlinkage long
  258. compat_sys_set_robust_list(struct compat_robust_list_head __user *head,
  259. compat_size_t len);
  260. asmlinkage long
  261. compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
  262. compat_size_t __user *len_ptr);
  263. #ifdef CONFIG_ARCH_WANT_OLD_COMPAT_IPC
  264. long compat_sys_semctl(int first, int second, int third, void __user *uptr);
  265. long compat_sys_msgsnd(int first, int second, int third, void __user *uptr);
  266. long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
  267. int version, void __user *uptr);
  268. long compat_sys_shmat(int first, int second, compat_uptr_t third, int version,
  269. void __user *uptr);
  270. #else
  271. long compat_sys_semctl(int semid, int semnum, int cmd, int arg);
  272. long compat_sys_msgsnd(int msqid, struct compat_msgbuf __user *msgp,
  273. compat_ssize_t msgsz, int msgflg);
  274. long compat_sys_msgrcv(int msqid, struct compat_msgbuf __user *msgp,
  275. compat_ssize_t msgsz, long msgtyp, int msgflg);
  276. long compat_sys_shmat(int shmid, compat_uptr_t shmaddr, int shmflg);
  277. #endif
  278. long compat_sys_msgctl(int first, int second, void __user *uptr);
  279. long compat_sys_shmctl(int first, int second, void __user *uptr);
  280. long compat_sys_semtimedop(int semid, struct sembuf __user *tsems,
  281. unsigned nsems, const struct compat_timespec __user *timeout);
  282. asmlinkage long compat_sys_keyctl(u32 option,
  283. u32 arg2, u32 arg3, u32 arg4, u32 arg5);
  284. asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32);
  285. asmlinkage ssize_t compat_sys_readv(unsigned long fd,
  286. const struct compat_iovec __user *vec, unsigned long vlen);
  287. asmlinkage ssize_t compat_sys_writev(unsigned long fd,
  288. const struct compat_iovec __user *vec, unsigned long vlen);
  289. asmlinkage ssize_t compat_sys_preadv(unsigned long fd,
  290. const struct compat_iovec __user *vec,
  291. unsigned long vlen, u32 pos_low, u32 pos_high);
  292. asmlinkage ssize_t compat_sys_pwritev(unsigned long fd,
  293. const struct compat_iovec __user *vec,
  294. unsigned long vlen, u32 pos_low, u32 pos_high);
  295. asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv,
  296. const compat_uptr_t __user *envp);
  297. asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
  298. compat_ulong_t __user *outp, compat_ulong_t __user *exp,
  299. struct compat_timeval __user *tvp);
  300. asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg);
  301. asmlinkage long compat_sys_wait4(compat_pid_t pid,
  302. compat_uint_t __user *stat_addr, int options,
  303. struct compat_rusage __user *ru);
  304. #define BITS_PER_COMPAT_LONG (8*sizeof(compat_long_t))
  305. #define BITS_TO_COMPAT_LONGS(bits) \
  306. (((bits)+BITS_PER_COMPAT_LONG-1)/BITS_PER_COMPAT_LONG)
  307. long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask,
  308. unsigned long bitmap_size);
  309. long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask,
  310. unsigned long bitmap_size);
  311. int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from);
  312. int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from);
  313. int get_compat_sigevent(struct sigevent *event,
  314. const struct compat_sigevent __user *u_event);
  315. long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig,
  316. struct compat_siginfo __user *uinfo);
  317. static inline int compat_timeval_compare(struct compat_timeval *lhs,
  318. struct compat_timeval *rhs)
  319. {
  320. if (lhs->tv_sec < rhs->tv_sec)
  321. return -1;
  322. if (lhs->tv_sec > rhs->tv_sec)
  323. return 1;
  324. return lhs->tv_usec - rhs->tv_usec;
  325. }
  326. static inline int compat_timespec_compare(struct compat_timespec *lhs,
  327. struct compat_timespec *rhs)
  328. {
  329. if (lhs->tv_sec < rhs->tv_sec)
  330. return -1;
  331. if (lhs->tv_sec > rhs->tv_sec)
  332. return 1;
  333. return lhs->tv_nsec - rhs->tv_nsec;
  334. }
  335. extern int get_compat_itimerspec(struct itimerspec *dst,
  336. const struct compat_itimerspec __user *src);
  337. extern int put_compat_itimerspec(struct compat_itimerspec __user *dst,
  338. const struct itimerspec *src);
  339. asmlinkage long compat_sys_gettimeofday(struct compat_timeval __user *tv,
  340. struct timezone __user *tz);
  341. asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv,
  342. struct timezone __user *tz);
  343. asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);
  344. extern int compat_printk(const char *fmt, ...);
  345. extern void sigset_from_compat(sigset_t *set, const compat_sigset_t *compat);
  346. extern void sigset_to_compat(compat_sigset_t *compat, const sigset_t *set);
  347. asmlinkage long compat_sys_migrate_pages(compat_pid_t pid,
  348. compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes,
  349. const compat_ulong_t __user *new_nodes);
  350. extern int compat_ptrace_request(struct task_struct *child,
  351. compat_long_t request,
  352. compat_ulong_t addr, compat_ulong_t data);
  353. extern long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
  354. compat_ulong_t addr, compat_ulong_t data);
  355. asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
  356. compat_long_t addr, compat_long_t data);
  357. /*
  358. * epoll (fs/eventpoll.c) compat bits follow ...
  359. */
  360. struct epoll_event;
  361. #define compat_epoll_event epoll_event
  362. asmlinkage long compat_sys_epoll_pwait(int epfd,
  363. struct compat_epoll_event __user *events,
  364. int maxevents, int timeout,
  365. const compat_sigset_t __user *sigmask,
  366. compat_size_t sigsetsize);
  367. asmlinkage long compat_sys_utime(const char __user *filename,
  368. struct compat_utimbuf __user *t);
  369. asmlinkage long compat_sys_utimensat(unsigned int dfd,
  370. const char __user *filename,
  371. struct compat_timespec __user *t,
  372. int flags);
  373. asmlinkage long compat_sys_time(compat_time_t __user *tloc);
  374. asmlinkage long compat_sys_stime(compat_time_t __user *tptr);
  375. asmlinkage long compat_sys_signalfd(int ufd,
  376. const compat_sigset_t __user *sigmask,
  377. compat_size_t sigsetsize);
  378. asmlinkage long compat_sys_timerfd_settime(int ufd, int flags,
  379. const struct compat_itimerspec __user *utmr,
  380. struct compat_itimerspec __user *otmr);
  381. asmlinkage long compat_sys_timerfd_gettime(int ufd,
  382. struct compat_itimerspec __user *otmr);
  383. asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page,
  384. __u32 __user *pages,
  385. const int __user *nodes,
  386. int __user *status,
  387. int flags);
  388. asmlinkage long compat_sys_futimesat(unsigned int dfd,
  389. const char __user *filename,
  390. struct compat_timeval __user *t);
  391. asmlinkage long compat_sys_utimes(const char __user *filename,
  392. struct compat_timeval __user *t);
  393. asmlinkage long compat_sys_newstat(const char __user *filename,
  394. struct compat_stat __user *statbuf);
  395. asmlinkage long compat_sys_newlstat(const char __user *filename,
  396. struct compat_stat __user *statbuf);
  397. asmlinkage long compat_sys_newfstatat(unsigned int dfd,
  398. const char __user *filename,
  399. struct compat_stat __user *statbuf,
  400. int flag);
  401. asmlinkage long compat_sys_newfstat(unsigned int fd,
  402. struct compat_stat __user *statbuf);
  403. asmlinkage long compat_sys_statfs(const char __user *pathname,
  404. struct compat_statfs __user *buf);
  405. asmlinkage long compat_sys_fstatfs(unsigned int fd,
  406. struct compat_statfs __user *buf);
  407. asmlinkage long compat_sys_statfs64(const char __user *pathname,
  408. compat_size_t sz,
  409. struct compat_statfs64 __user *buf);
  410. asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz,
  411. struct compat_statfs64 __user *buf);
  412. asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd,
  413. unsigned long arg);
  414. asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd,
  415. unsigned long arg);
  416. asmlinkage long compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p);
  417. asmlinkage long compat_sys_io_getevents(aio_context_t ctx_id,
  418. unsigned long min_nr,
  419. unsigned long nr,
  420. struct io_event __user *events,
  421. struct compat_timespec __user *timeout);
  422. asmlinkage long compat_sys_io_submit(aio_context_t ctx_id, int nr,
  423. u32 __user *iocb);
  424. asmlinkage long compat_sys_mount(const char __user *dev_name,
  425. const char __user *dir_name,
  426. const char __user *type, unsigned long flags,
  427. const void __user *data);
  428. asmlinkage long compat_sys_old_readdir(unsigned int fd,
  429. struct compat_old_linux_dirent __user *,
  430. unsigned int count);
  431. asmlinkage long compat_sys_getdents(unsigned int fd,
  432. struct compat_linux_dirent __user *dirent,
  433. unsigned int count);
  434. asmlinkage long compat_sys_getdents64(unsigned int fd,
  435. struct linux_dirent64 __user *dirent,
  436. unsigned int count);
  437. asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *,
  438. unsigned int nr_segs, unsigned int flags);
  439. asmlinkage long compat_sys_open(const char __user *filename, int flags,
  440. umode_t mode);
  441. asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
  442. int flags, umode_t mode);
  443. asmlinkage long compat_sys_open_by_handle_at(int mountdirfd,
  444. struct file_handle __user *handle,
  445. int flags);
  446. asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp,
  447. compat_ulong_t __user *outp,
  448. compat_ulong_t __user *exp,
  449. struct compat_timespec __user *tsp,
  450. void __user *sig);
  451. asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
  452. unsigned int nfds,
  453. struct compat_timespec __user *tsp,
  454. const compat_sigset_t __user *sigmask,
  455. compat_size_t sigsetsize);
  456. asmlinkage long compat_sys_signalfd4(int ufd,
  457. const compat_sigset_t __user *sigmask,
  458. compat_size_t sigsetsize, int flags);
  459. asmlinkage long compat_sys_get_mempolicy(int __user *policy,
  460. compat_ulong_t __user *nmask,
  461. compat_ulong_t maxnode,
  462. compat_ulong_t addr,
  463. compat_ulong_t flags);
  464. asmlinkage long compat_sys_set_mempolicy(int mode, compat_ulong_t __user *nmask,
  465. compat_ulong_t maxnode);
  466. asmlinkage long compat_sys_mbind(compat_ulong_t start, compat_ulong_t len,
  467. compat_ulong_t mode,
  468. compat_ulong_t __user *nmask,
  469. compat_ulong_t maxnode, compat_ulong_t flags);
  470. asmlinkage long compat_sys_setsockopt(int fd, int level, int optname,
  471. char __user *optval, unsigned int optlen);
  472. asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg,
  473. unsigned flags);
  474. asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg,
  475. unsigned vlen, unsigned int flags);
  476. asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg,
  477. unsigned int flags);
  478. asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len,
  479. unsigned flags);
  480. asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, size_t len,
  481. unsigned flags, struct sockaddr __user *addr,
  482. int __user *addrlen);
  483. asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
  484. unsigned vlen, unsigned int flags,
  485. struct compat_timespec __user *timeout);
  486. asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
  487. struct compat_timespec __user *rmtp);
  488. asmlinkage long compat_sys_getitimer(int which,
  489. struct compat_itimerval __user *it);
  490. asmlinkage long compat_sys_setitimer(int which,
  491. struct compat_itimerval __user *in,
  492. struct compat_itimerval __user *out);
  493. asmlinkage long compat_sys_times(struct compat_tms __user *tbuf);
  494. asmlinkage long compat_sys_setrlimit(unsigned int resource,
  495. struct compat_rlimit __user *rlim);
  496. asmlinkage long compat_sys_getrlimit(unsigned int resource,
  497. struct compat_rlimit __user *rlim);
  498. asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru);
  499. asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid,
  500. unsigned int len,
  501. compat_ulong_t __user *user_mask_ptr);
  502. asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid,
  503. unsigned int len,
  504. compat_ulong_t __user *user_mask_ptr);
  505. asmlinkage long compat_sys_timer_create(clockid_t which_clock,
  506. struct compat_sigevent __user *timer_event_spec,
  507. timer_t __user *created_timer_id);
  508. asmlinkage long compat_sys_timer_settime(timer_t timer_id, int flags,
  509. struct compat_itimerspec __user *new,
  510. struct compat_itimerspec __user *old);
  511. asmlinkage long compat_sys_timer_gettime(timer_t timer_id,
  512. struct compat_itimerspec __user *setting);
  513. asmlinkage long compat_sys_clock_settime(clockid_t which_clock,
  514. struct compat_timespec __user *tp);
  515. asmlinkage long compat_sys_clock_gettime(clockid_t which_clock,
  516. struct compat_timespec __user *tp);
  517. asmlinkage long compat_sys_clock_adjtime(clockid_t which_clock,
  518. struct compat_timex __user *tp);
  519. asmlinkage long compat_sys_clock_getres(clockid_t which_clock,
  520. struct compat_timespec __user *tp);
  521. asmlinkage long compat_sys_clock_nanosleep(clockid_t which_clock, int flags,
  522. struct compat_timespec __user *rqtp,
  523. struct compat_timespec __user *rmtp);
  524. asmlinkage long compat_sys_rt_sigtimedwait(compat_sigset_t __user *uthese,
  525. struct compat_siginfo __user *uinfo,
  526. struct compat_timespec __user *uts, compat_size_t sigsetsize);
  527. asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset,
  528. compat_size_t sigsetsize);
  529. #ifdef CONFIG_GENERIC_COMPAT_RT_SIGPROCMASK
  530. asmlinkage long compat_sys_rt_sigprocmask(int how, compat_sigset_t __user *set,
  531. compat_sigset_t __user *oset,
  532. compat_size_t sigsetsize);
  533. #endif
  534. asmlinkage long compat_sys_sysinfo(struct compat_sysinfo __user *info);
  535. asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
  536. unsigned long arg);
  537. asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val,
  538. struct compat_timespec __user *utime, u32 __user *uaddr2,
  539. u32 val3);
  540. asmlinkage long compat_sys_getsockopt(int fd, int level, int optname,
  541. char __user *optval, int __user *optlen);
  542. asmlinkage long compat_sys_kexec_load(unsigned long entry,
  543. unsigned long nr_segments,
  544. struct compat_kexec_segment __user *,
  545. unsigned long flags);
  546. asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes,
  547. const struct compat_mq_attr __user *u_mqstat,
  548. struct compat_mq_attr __user *u_omqstat);
  549. asmlinkage long compat_sys_mq_notify(mqd_t mqdes,
  550. const struct compat_sigevent __user *u_notification);
  551. asmlinkage long compat_sys_mq_open(const char __user *u_name,
  552. int oflag, compat_mode_t mode,
  553. struct compat_mq_attr __user *u_attr);
  554. asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes,
  555. const char __user *u_msg_ptr,
  556. size_t msg_len, unsigned int msg_prio,
  557. const struct compat_timespec __user *u_abs_timeout);
  558. asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes,
  559. char __user *u_msg_ptr,
  560. size_t msg_len, unsigned int __user *u_msg_prio,
  561. const struct compat_timespec __user *u_abs_timeout);
  562. asmlinkage long compat_sys_socketcall(int call, u32 __user *args);
  563. asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args);
  564. extern ssize_t compat_rw_copy_check_uvector(int type,
  565. const struct compat_iovec __user *uvector,
  566. unsigned long nr_segs,
  567. unsigned long fast_segs, struct iovec *fast_pointer,
  568. struct iovec **ret_pointer);
  569. extern void __user *compat_alloc_user_space(unsigned long len);
  570. asmlinkage ssize_t compat_sys_process_vm_readv(compat_pid_t pid,
  571. const struct compat_iovec __user *lvec,
  572. unsigned long liovcnt, const struct compat_iovec __user *rvec,
  573. unsigned long riovcnt, unsigned long flags);
  574. asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid,
  575. const struct compat_iovec __user *lvec,
  576. unsigned long liovcnt, const struct compat_iovec __user *rvec,
  577. unsigned long riovcnt, unsigned long flags);
  578. asmlinkage long compat_sys_sendfile(int out_fd, int in_fd,
  579. compat_off_t __user *offset, compat_size_t count);
  580. #ifdef CONFIG_GENERIC_SIGALTSTACK
  581. asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr,
  582. compat_stack_t __user *uoss_ptr);
  583. int compat_restore_altstack(const compat_stack_t __user *uss);
  584. int __compat_save_altstack(compat_stack_t __user *, unsigned long);
  585. #endif
  586. asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid,
  587. struct compat_timespec __user *interval);
  588. #else
  589. #define is_compat_task() (0)
  590. #endif /* CONFIG_COMPAT */
  591. #endif /* _LINUX_COMPAT_H */