diff options
Diffstat (limited to 'include/linux/syscalls.h')
-rw-r--r-- | include/linux/syscalls.h | 174 |
1 files changed, 122 insertions, 52 deletions
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 18d0a243a7b3..0eda02ff2414 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -54,6 +54,7 @@ struct compat_stat; | |||
54 | struct compat_timeval; | 54 | struct compat_timeval; |
55 | struct robust_list_head; | 55 | struct robust_list_head; |
56 | struct getcpu_cache; | 56 | struct getcpu_cache; |
57 | struct old_linux_dirent; | ||
57 | 58 | ||
58 | #include <linux/types.h> | 59 | #include <linux/types.h> |
59 | #include <linux/aio_abi.h> | 60 | #include <linux/aio_abi.h> |
@@ -65,6 +66,79 @@ struct getcpu_cache; | |||
65 | #include <linux/quota.h> | 66 | #include <linux/quota.h> |
66 | #include <linux/key.h> | 67 | #include <linux/key.h> |
67 | 68 | ||
69 | #define __SC_DECL1(t1, a1) t1 a1 | ||
70 | #define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__) | ||
71 | #define __SC_DECL3(t3, a3, ...) t3 a3, __SC_DECL2(__VA_ARGS__) | ||
72 | #define __SC_DECL4(t4, a4, ...) t4 a4, __SC_DECL3(__VA_ARGS__) | ||
73 | #define __SC_DECL5(t5, a5, ...) t5 a5, __SC_DECL4(__VA_ARGS__) | ||
74 | #define __SC_DECL6(t6, a6, ...) t6 a6, __SC_DECL5(__VA_ARGS__) | ||
75 | |||
76 | #define __SC_LONG1(t1, a1) long a1 | ||
77 | #define __SC_LONG2(t2, a2, ...) long a2, __SC_LONG1(__VA_ARGS__) | ||
78 | #define __SC_LONG3(t3, a3, ...) long a3, __SC_LONG2(__VA_ARGS__) | ||
79 | #define __SC_LONG4(t4, a4, ...) long a4, __SC_LONG3(__VA_ARGS__) | ||
80 | #define __SC_LONG5(t5, a5, ...) long a5, __SC_LONG4(__VA_ARGS__) | ||
81 | #define __SC_LONG6(t6, a6, ...) long a6, __SC_LONG5(__VA_ARGS__) | ||
82 | |||
83 | #define __SC_CAST1(t1, a1) (t1) a1 | ||
84 | #define __SC_CAST2(t2, a2, ...) (t2) a2, __SC_CAST1(__VA_ARGS__) | ||
85 | #define __SC_CAST3(t3, a3, ...) (t3) a3, __SC_CAST2(__VA_ARGS__) | ||
86 | #define __SC_CAST4(t4, a4, ...) (t4) a4, __SC_CAST3(__VA_ARGS__) | ||
87 | #define __SC_CAST5(t5, a5, ...) (t5) a5, __SC_CAST4(__VA_ARGS__) | ||
88 | #define __SC_CAST6(t6, a6, ...) (t6) a6, __SC_CAST5(__VA_ARGS__) | ||
89 | |||
90 | #define __SC_TEST(type) BUILD_BUG_ON(sizeof(type) > sizeof(long)) | ||
91 | #define __SC_TEST1(t1, a1) __SC_TEST(t1) | ||
92 | #define __SC_TEST2(t2, a2, ...) __SC_TEST(t2); __SC_TEST1(__VA_ARGS__) | ||
93 | #define __SC_TEST3(t3, a3, ...) __SC_TEST(t3); __SC_TEST2(__VA_ARGS__) | ||
94 | #define __SC_TEST4(t4, a4, ...) __SC_TEST(t4); __SC_TEST3(__VA_ARGS__) | ||
95 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) | ||
96 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) | ||
97 | |||
98 | #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) | ||
99 | #define SYSCALL_DEFINE1(...) SYSCALL_DEFINEx(1, __VA_ARGS__) | ||
100 | #define SYSCALL_DEFINE2(...) SYSCALL_DEFINEx(2, __VA_ARGS__) | ||
101 | #define SYSCALL_DEFINE3(...) SYSCALL_DEFINEx(3, __VA_ARGS__) | ||
102 | #define SYSCALL_DEFINE4(...) SYSCALL_DEFINEx(4, __VA_ARGS__) | ||
103 | #define SYSCALL_DEFINE5(...) SYSCALL_DEFINEx(5, __VA_ARGS__) | ||
104 | #define SYSCALL_DEFINE6(...) SYSCALL_DEFINEx(6, __VA_ARGS__) | ||
105 | |||
106 | #ifdef CONFIG_PPC64 | ||
107 | #define SYSCALL_ALIAS(alias, name) \ | ||
108 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \ | ||
109 | "\t.globl ." #alias "\n\t.set ." #alias ", ." #name) | ||
110 | #else | ||
111 | #ifdef CONFIG_ALPHA | ||
112 | #define SYSCALL_ALIAS(alias, name) \ | ||
113 | asm ( #alias " = " #name "\n\t.globl " #alias) | ||
114 | #else | ||
115 | #define SYSCALL_ALIAS(alias, name) \ | ||
116 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name) | ||
117 | #endif | ||
118 | #endif | ||
119 | |||
120 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
121 | |||
122 | #define SYSCALL_DEFINE(name) static inline long SYSC_##name | ||
123 | #define SYSCALL_DEFINEx(x, name, ...) \ | ||
124 | asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)); \ | ||
125 | static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)); \ | ||
126 | asmlinkage long SyS_##name(__SC_LONG##x(__VA_ARGS__)) \ | ||
127 | { \ | ||
128 | __SC_TEST##x(__VA_ARGS__); \ | ||
129 | return (long) SYSC_##name(__SC_CAST##x(__VA_ARGS__)); \ | ||
130 | } \ | ||
131 | SYSCALL_ALIAS(sys_##name, SyS_##name); \ | ||
132 | static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)) | ||
133 | |||
134 | #else /* CONFIG_HAVE_SYSCALL_WRAPPERS */ | ||
135 | |||
136 | #define SYSCALL_DEFINE(name) asmlinkage long sys_##name | ||
137 | #define SYSCALL_DEFINEx(x, name, ...) \ | ||
138 | asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)) | ||
139 | |||
140 | #endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */ | ||
141 | |||
68 | asmlinkage long sys_time(time_t __user *tloc); | 142 | asmlinkage long sys_time(time_t __user *tloc); |
69 | asmlinkage long sys_stime(time_t __user *tptr); | 143 | asmlinkage long sys_stime(time_t __user *tptr); |
70 | asmlinkage long sys_gettimeofday(struct timeval __user *tv, | 144 | asmlinkage long sys_gettimeofday(struct timeval __user *tv, |
@@ -77,7 +151,7 @@ asmlinkage long sys_times(struct tms __user *tbuf); | |||
77 | 151 | ||
78 | asmlinkage long sys_gettid(void); | 152 | asmlinkage long sys_gettid(void); |
79 | asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp); | 153 | asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp); |
80 | asmlinkage unsigned long sys_alarm(unsigned int seconds); | 154 | asmlinkage long sys_alarm(unsigned int seconds); |
81 | asmlinkage long sys_getpid(void); | 155 | asmlinkage long sys_getpid(void); |
82 | asmlinkage long sys_getppid(void); | 156 | asmlinkage long sys_getppid(void); |
83 | asmlinkage long sys_getuid(void); | 157 | asmlinkage long sys_getuid(void); |
@@ -166,7 +240,7 @@ asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, | |||
166 | unsigned long flags); | 240 | unsigned long flags); |
167 | 241 | ||
168 | asmlinkage long sys_exit(int error_code); | 242 | asmlinkage long sys_exit(int error_code); |
169 | asmlinkage void sys_exit_group(int error_code); | 243 | asmlinkage long sys_exit_group(int error_code); |
170 | asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr, | 244 | asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr, |
171 | int options, struct rusage __user *ru); | 245 | int options, struct rusage __user *ru); |
172 | asmlinkage long sys_waitid(int which, pid_t pid, | 246 | asmlinkage long sys_waitid(int which, pid_t pid, |
@@ -196,7 +270,7 @@ asmlinkage long sys_tkill(int pid, int sig); | |||
196 | asmlinkage long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo); | 270 | asmlinkage long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo); |
197 | asmlinkage long sys_sgetmask(void); | 271 | asmlinkage long sys_sgetmask(void); |
198 | asmlinkage long sys_ssetmask(int newmask); | 272 | asmlinkage long sys_ssetmask(int newmask); |
199 | asmlinkage unsigned long sys_signal(int sig, __sighandler_t handler); | 273 | asmlinkage long sys_signal(int sig, __sighandler_t handler); |
200 | asmlinkage long sys_pause(void); | 274 | asmlinkage long sys_pause(void); |
201 | 275 | ||
202 | asmlinkage long sys_sync(void); | 276 | asmlinkage long sys_sync(void); |
@@ -246,29 +320,29 @@ asmlinkage long sys_lsetxattr(const char __user *path, const char __user *name, | |||
246 | const void __user *value, size_t size, int flags); | 320 | const void __user *value, size_t size, int flags); |
247 | asmlinkage long sys_fsetxattr(int fd, const char __user *name, | 321 | asmlinkage long sys_fsetxattr(int fd, const char __user *name, |
248 | const void __user *value, size_t size, int flags); | 322 | const void __user *value, size_t size, int flags); |
249 | asmlinkage ssize_t sys_getxattr(const char __user *path, const char __user *name, | 323 | asmlinkage long sys_getxattr(const char __user *path, const char __user *name, |
250 | void __user *value, size_t size); | 324 | void __user *value, size_t size); |
251 | asmlinkage ssize_t sys_lgetxattr(const char __user *path, const char __user *name, | 325 | asmlinkage long sys_lgetxattr(const char __user *path, const char __user *name, |
252 | void __user *value, size_t size); | 326 | void __user *value, size_t size); |
253 | asmlinkage ssize_t sys_fgetxattr(int fd, const char __user *name, | 327 | asmlinkage long sys_fgetxattr(int fd, const char __user *name, |
254 | void __user *value, size_t size); | 328 | void __user *value, size_t size); |
255 | asmlinkage ssize_t sys_listxattr(const char __user *path, char __user *list, | 329 | asmlinkage long sys_listxattr(const char __user *path, char __user *list, |
256 | size_t size); | 330 | size_t size); |
257 | asmlinkage ssize_t sys_llistxattr(const char __user *path, char __user *list, | 331 | asmlinkage long sys_llistxattr(const char __user *path, char __user *list, |
258 | size_t size); | 332 | size_t size); |
259 | asmlinkage ssize_t sys_flistxattr(int fd, char __user *list, size_t size); | 333 | asmlinkage long sys_flistxattr(int fd, char __user *list, size_t size); |
260 | asmlinkage long sys_removexattr(const char __user *path, | 334 | asmlinkage long sys_removexattr(const char __user *path, |
261 | const char __user *name); | 335 | const char __user *name); |
262 | asmlinkage long sys_lremovexattr(const char __user *path, | 336 | asmlinkage long sys_lremovexattr(const char __user *path, |
263 | const char __user *name); | 337 | const char __user *name); |
264 | asmlinkage long sys_fremovexattr(int fd, const char __user *name); | 338 | asmlinkage long sys_fremovexattr(int fd, const char __user *name); |
265 | 339 | ||
266 | asmlinkage unsigned long sys_brk(unsigned long brk); | 340 | asmlinkage long sys_brk(unsigned long brk); |
267 | asmlinkage long sys_mprotect(unsigned long start, size_t len, | 341 | asmlinkage long sys_mprotect(unsigned long start, size_t len, |
268 | unsigned long prot); | 342 | unsigned long prot); |
269 | asmlinkage unsigned long sys_mremap(unsigned long addr, | 343 | asmlinkage long sys_mremap(unsigned long addr, |
270 | unsigned long old_len, unsigned long new_len, | 344 | unsigned long old_len, unsigned long new_len, |
271 | unsigned long flags, unsigned long new_addr); | 345 | unsigned long flags, unsigned long new_addr); |
272 | asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, | 346 | asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, |
273 | unsigned long prot, unsigned long pgoff, | 347 | unsigned long prot, unsigned long pgoff, |
274 | unsigned long flags); | 348 | unsigned long flags); |
@@ -321,10 +395,10 @@ asmlinkage long sys_io_submit(aio_context_t, long, | |||
321 | struct iocb __user * __user *); | 395 | struct iocb __user * __user *); |
322 | asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, | 396 | asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, |
323 | struct io_event __user *result); | 397 | struct io_event __user *result); |
324 | asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, | 398 | asmlinkage long sys_sendfile(int out_fd, int in_fd, |
325 | off_t __user *offset, size_t count); | 399 | off_t __user *offset, size_t count); |
326 | asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, | 400 | asmlinkage long sys_sendfile64(int out_fd, int in_fd, |
327 | loff_t __user *offset, size_t count); | 401 | loff_t __user *offset, size_t count); |
328 | asmlinkage long sys_readlink(const char __user *path, | 402 | asmlinkage long sys_readlink(const char __user *path, |
329 | char __user *buf, int bufsiz); | 403 | char __user *buf, int bufsiz); |
330 | asmlinkage long sys_creat(const char __user *pathname, int mode); | 404 | asmlinkage long sys_creat(const char __user *pathname, int mode); |
@@ -368,26 +442,25 @@ asmlinkage long sys_utime(char __user *filename, | |||
368 | struct utimbuf __user *times); | 442 | struct utimbuf __user *times); |
369 | asmlinkage long sys_utimes(char __user *filename, | 443 | asmlinkage long sys_utimes(char __user *filename, |
370 | struct timeval __user *utimes); | 444 | struct timeval __user *utimes); |
371 | asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, | 445 | asmlinkage long sys_lseek(unsigned int fd, off_t offset, |
372 | unsigned int origin); | 446 | unsigned int origin); |
373 | asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, | 447 | asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, |
374 | unsigned long offset_low, loff_t __user *result, | 448 | unsigned long offset_low, loff_t __user *result, |
375 | unsigned int origin); | 449 | unsigned int origin); |
376 | asmlinkage ssize_t sys_read(unsigned int fd, char __user *buf, | 450 | asmlinkage long sys_read(unsigned int fd, char __user *buf, size_t count); |
377 | size_t count); | 451 | asmlinkage long sys_readahead(int fd, loff_t offset, size_t count); |
378 | asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count); | 452 | asmlinkage long sys_readv(unsigned long fd, |
379 | asmlinkage ssize_t sys_readv(unsigned long fd, | 453 | const struct iovec __user *vec, |
380 | const struct iovec __user *vec, | 454 | unsigned long vlen); |
381 | unsigned long vlen); | 455 | asmlinkage long sys_write(unsigned int fd, const char __user *buf, |
382 | asmlinkage ssize_t sys_write(unsigned int fd, const char __user *buf, | 456 | size_t count); |
383 | size_t count); | 457 | asmlinkage long sys_writev(unsigned long fd, |
384 | asmlinkage ssize_t sys_writev(unsigned long fd, | 458 | const struct iovec __user *vec, |
385 | const struct iovec __user *vec, | 459 | unsigned long vlen); |
386 | unsigned long vlen); | 460 | asmlinkage long sys_pread64(unsigned int fd, char __user *buf, |
387 | asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, | 461 | size_t count, loff_t pos); |
388 | size_t count, loff_t pos); | 462 | asmlinkage long sys_pwrite64(unsigned int fd, const char __user *buf, |
389 | asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf, | 463 | size_t count, loff_t pos); |
390 | size_t count, loff_t pos); | ||
391 | asmlinkage long sys_getcwd(char __user *buf, unsigned long size); | 464 | asmlinkage long sys_getcwd(char __user *buf, unsigned long size); |
392 | asmlinkage long sys_mkdir(const char __user *pathname, int mode); | 465 | asmlinkage long sys_mkdir(const char __user *pathname, int mode); |
393 | asmlinkage long sys_chdir(const char __user *filename); | 466 | asmlinkage long sys_chdir(const char __user *filename); |
@@ -476,7 +549,7 @@ asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); | |||
476 | asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); | 549 | asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); |
477 | asmlinkage long sys_mq_unlink(const char __user *name); | 550 | asmlinkage long sys_mq_unlink(const char __user *name); |
478 | asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec __user *abs_timeout); | 551 | asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec __user *abs_timeout); |
479 | asmlinkage ssize_t sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout); | 552 | asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout); |
480 | asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification); | 553 | asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification); |
481 | asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat); | 554 | asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat); |
482 | 555 | ||
@@ -530,11 +603,6 @@ asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages, | |||
530 | const int __user *nodes, | 603 | const int __user *nodes, |
531 | int __user *status, | 604 | int __user *status, |
532 | int flags); | 605 | int flags); |
533 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, | ||
534 | __u32 __user *pages, | ||
535 | const int __user *nodes, | ||
536 | int __user *status, | ||
537 | int flags); | ||
538 | asmlinkage long sys_mbind(unsigned long start, unsigned long len, | 606 | asmlinkage long sys_mbind(unsigned long start, unsigned long len, |
539 | unsigned long mode, | 607 | unsigned long mode, |
540 | unsigned long __user *nmask, | 608 | unsigned long __user *nmask, |
@@ -583,13 +651,6 @@ asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *bu | |||
583 | int bufsiz); | 651 | int bufsiz); |
584 | asmlinkage long sys_utimensat(int dfd, char __user *filename, | 652 | asmlinkage long sys_utimensat(int dfd, char __user *filename, |
585 | struct timespec __user *utimes, int flags); | 653 | struct timespec __user *utimes, int flags); |
586 | asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, | ||
587 | struct compat_timeval __user *t); | ||
588 | asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, | ||
589 | struct compat_stat __user *statbuf, | ||
590 | int flag); | ||
591 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | ||
592 | int flags, int mode); | ||
593 | asmlinkage long sys_unshare(unsigned long unshare_flags); | 654 | asmlinkage long sys_unshare(unsigned long unshare_flags); |
594 | 655 | ||
595 | asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, | 656 | asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, |
@@ -621,6 +682,15 @@ asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr); | |||
621 | asmlinkage long sys_eventfd(unsigned int count); | 682 | asmlinkage long sys_eventfd(unsigned int count); |
622 | asmlinkage long sys_eventfd2(unsigned int count, int flags); | 683 | asmlinkage long sys_eventfd2(unsigned int count, int flags); |
623 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); | 684 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); |
685 | asmlinkage long sys_old_readdir(unsigned int, struct old_linux_dirent __user *, unsigned int); | ||
686 | asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *, | ||
687 | fd_set __user *, struct timespec __user *, | ||
688 | void __user *); | ||
689 | asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, | ||
690 | struct timespec __user *, const sigset_t __user *, | ||
691 | size_t); | ||
692 | asmlinkage long sys_pipe2(int __user *, int); | ||
693 | asmlinkage long sys_pipe(int __user *); | ||
624 | 694 | ||
625 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | 695 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); |
626 | 696 | ||