Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'syscalls' of git://git390.osdl.marist.edu/pub/scm/linux-2.6

* 'syscalls' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: (44 commits)
[CVE-2009-0029] s390 specific system call wrappers
[CVE-2009-0029] System call wrappers part 33
[CVE-2009-0029] System call wrappers part 32
[CVE-2009-0029] System call wrappers part 31
[CVE-2009-0029] System call wrappers part 30
[CVE-2009-0029] System call wrappers part 29
[CVE-2009-0029] System call wrappers part 28
[CVE-2009-0029] System call wrappers part 27
[CVE-2009-0029] System call wrappers part 26
[CVE-2009-0029] System call wrappers part 25
[CVE-2009-0029] System call wrappers part 24
[CVE-2009-0029] System call wrappers part 23
[CVE-2009-0029] System call wrappers part 22
[CVE-2009-0029] System call wrappers part 21
[CVE-2009-0029] System call wrappers part 20
[CVE-2009-0029] System call wrappers part 19
[CVE-2009-0029] System call wrappers part 18
[CVE-2009-0029] System call wrappers part 17
[CVE-2009-0029] System call wrappers part 16
[CVE-2009-0029] System call wrappers part 15
...

+810 -659
+3
arch/Kconfig
··· 62 62 See Documentation/unaligned-memory-access.txt for more 63 63 information on the topic of unaligned memory accesses. 64 64 65 + config HAVE_SYSCALL_WRAPPERS 66 + bool 67 + 65 68 config KRETPROBES 66 69 def_bool y 67 70 depends on KPROBES && HAVE_KRETPROBES
+4 -4
arch/alpha/kernel/entry.S
··· 896 896 .end sys_getxpid 897 897 898 898 .align 4 899 - .globl sys_pipe 900 - .ent sys_pipe 901 - sys_pipe: 899 + .globl sys_alpha_pipe 900 + .ent sys_alpha_pipe 901 + sys_alpha_pipe: 902 902 lda $sp, -16($sp) 903 903 stq $26, 0($sp) 904 904 .prologue 0 ··· 916 916 stq $1, 80+16($sp) 917 917 1: lda $sp, 16($sp) 918 918 ret 919 - .end sys_pipe 919 + .end sys_alpha_pipe 920 920 921 921 .align 4 922 922 .globl sys_execve
+1 -1
arch/alpha/kernel/systbls.S
··· 52 52 .quad sys_setpgid 53 53 .quad alpha_ni_syscall /* 40 */ 54 54 .quad sys_dup 55 - .quad sys_pipe 55 + .quad sys_alpha_pipe 56 56 .quad osf_set_program_attributes 57 57 .quad alpha_ni_syscall 58 58 .quad sys_open /* 45 */
+1 -1
arch/arm/kernel/calls.S
··· 98 98 CALL(sys_uselib) 99 99 CALL(sys_swapon) 100 100 CALL(sys_reboot) 101 - CALL(OBSOLETE(old_readdir)) /* used by libc4 */ 101 + CALL(OBSOLETE(sys_old_readdir)) /* used by libc4 */ 102 102 /* 90 */ CALL(OBSOLETE(old_mmap)) /* used by libc4 */ 103 103 CALL(sys_munmap) 104 104 CALL(sys_truncate)
+1 -1
arch/cris/arch-v10/kernel/entry.S
··· 691 691 .long sys_uselib 692 692 .long sys_swapon 693 693 .long sys_reboot 694 - .long old_readdir 694 + .long sys_old_readdir 695 695 .long old_mmap /* 90 */ 696 696 .long sys_munmap 697 697 .long sys_truncate
+1 -1
arch/cris/arch-v32/kernel/entry.S
··· 614 614 .long sys_uselib 615 615 .long sys_swapon 616 616 .long sys_reboot 617 - .long old_readdir 617 + .long sys_old_readdir 618 618 .long old_mmap /* 90 */ 619 619 .long sys_munmap 620 620 .long sys_truncate
+1 -1
arch/h8300/kernel/syscalls.S
··· 103 103 .long SYMBOL_NAME(sys_uselib) 104 104 .long SYMBOL_NAME(sys_swapon) 105 105 .long SYMBOL_NAME(sys_reboot) 106 - .long SYMBOL_NAME(old_readdir) 106 + .long SYMBOL_NAME(sys_old_readdir) 107 107 .long SYMBOL_NAME(old_mmap) /* 90 */ 108 108 .long SYMBOL_NAME(sys_munmap) 109 109 .long SYMBOL_NAME(sys_truncate)
+1 -1
arch/ia64/ia32/ia32_entry.S
··· 220 220 data8 sys_mkdir 221 221 data8 sys_rmdir /* 40 */ 222 222 data8 sys_dup 223 - data8 sys_pipe 223 + data8 sys_ia64_pipe 224 224 data8 compat_sys_times 225 225 data8 sys_ni_syscall /* old prof syscall holder */ 226 226 data8 sys32_brk /* 45 */
+1 -1
arch/ia64/include/asm/unistd.h
··· 364 364 struct sigaction; 365 365 long sys_execve(char __user *filename, char __user * __user *argv, 366 366 char __user * __user *envp, struct pt_regs *regs); 367 - asmlinkage long sys_pipe(void); 367 + asmlinkage long sys_ia64_pipe(void); 368 368 asmlinkage long sys_rt_sigaction(int sig, 369 369 const struct sigaction __user *act, 370 370 struct sigaction __user *oact,
+1 -1
arch/ia64/kernel/entry.S
··· 1442 1442 data8 sys_mkdir // 1055 1443 1443 data8 sys_rmdir 1444 1444 data8 sys_dup 1445 - data8 sys_pipe 1445 + data8 sys_ia64_pipe 1446 1446 data8 sys_times 1447 1447 data8 ia64_brk // 1060 1448 1448 data8 sys_setgid
+1 -1
arch/ia64/kernel/sys_ia64.c
··· 154 154 * and r9) as this is faster than doing a copy_to_user(). 155 155 */ 156 156 asmlinkage long 157 - sys_pipe (void) 157 + sys_ia64_pipe (void) 158 158 { 159 159 struct pt_regs *regs = task_pt_regs(current); 160 160 int fd[2];
+1 -1
arch/m68k/kernel/entry.S
··· 513 513 .long sys_uselib 514 514 .long sys_swapon 515 515 .long sys_reboot 516 - .long old_readdir 516 + .long sys_old_readdir 517 517 .long old_mmap /* 90 */ 518 518 .long sys_munmap 519 519 .long sys_truncate
+1 -1
arch/m68knommu/kernel/syscalltable.S
··· 107 107 .long sys_uselib 108 108 .long sys_ni_syscall /* sys_swapon */ 109 109 .long sys_reboot 110 - .long old_readdir 110 + .long sys_old_readdir 111 111 .long old_mmap /* 90 */ 112 112 .long sys_munmap 113 113 .long sys_truncate
+1 -1
arch/mips/kernel/scall32-o32.S
··· 398 398 sys sys_uselib 1 399 399 sys sys_swapon 2 400 400 sys sys_reboot 3 401 - sys old_readdir 3 401 + sys sys_old_readdir 3 402 402 sys old_mmap 6 /* 4090 */ 403 403 sys sys_munmap 2 404 404 sys sys_truncate 2
+1 -1
arch/mn10300/kernel/entry.S
··· 478 478 .long sys_uselib 479 479 .long sys_swapon 480 480 .long sys_reboot 481 - .long old_readdir 481 + .long sys_old_readdir 482 482 .long old_mmap /* 90 */ 483 483 .long sys_munmap 484 484 .long sys_truncate
+1
arch/powerpc/Kconfig
··· 123 123 select HAVE_DMA_ATTRS if PPC64 124 124 select USE_GENERIC_SMP_HELPERS if SMP 125 125 select HAVE_OPROFILE 126 + select HAVE_SYSCALL_WRAPPERS if PPC64 126 127 127 128 config EARLY_PRINTK 128 129 bool
+1 -1
arch/powerpc/include/asm/systbl.h
··· 92 92 SYSCALL(uselib) 93 93 SYSCALL(swapon) 94 94 SYSCALL(reboot) 95 - SYSX(sys_ni_syscall,compat_sys_old_readdir,old_readdir) 95 + SYSX(sys_ni_syscall,compat_sys_old_readdir,sys_old_readdir) 96 96 SYSCALL_SPU(mmap) 97 97 SYSCALL_SPU(munmap) 98 98 SYSCALL_SPU(truncate)
+1
arch/s390/Kconfig
··· 77 77 config S390 78 78 def_bool y 79 79 select USE_GENERIC_SMP_HELPERS if SMP 80 + select HAVE_SYSCALL_WRAPPERS 80 81 select HAVE_FUNCTION_TRACER 81 82 select HAVE_OPROFILE 82 83 select HAVE_KPROBES
+2 -2
arch/s390/kernel/compat_wrapper.S
··· 547 547 .globl sys32_newuname_wrapper 548 548 sys32_newuname_wrapper: 549 549 llgtr %r2,%r2 # struct new_utsname * 550 - jg s390x_newuname # branch to system call 550 + jg sys_s390_newuname # branch to system call 551 551 552 552 .globl compat_sys_adjtimex_wrapper 553 553 compat_sys_adjtimex_wrapper: ··· 615 615 .globl sys32_personality_wrapper 616 616 sys32_personality_wrapper: 617 617 llgfr %r2,%r2 # unsigned long 618 - jg s390x_personality # branch to system call 618 + jg sys_s390_personality # branch to system call 619 619 620 620 .globl sys32_setfsuid16_wrapper 621 621 sys32_setfsuid16_wrapper:
+8 -8
arch/s390/kernel/entry.h
··· 30 30 struct old_sigaction; 31 31 struct sel_arg_struct; 32 32 33 - long sys_pipe(unsigned long __user *fildes); 34 33 long sys_mmap2(struct mmap_arg_struct __user *arg); 35 - long old_mmap(struct mmap_arg_struct __user *arg); 34 + long sys_s390_old_mmap(struct mmap_arg_struct __user *arg); 36 35 long sys_ipc(uint call, int first, unsigned long second, 37 36 unsigned long third, void __user *ptr); 38 - long s390x_newuname(struct new_utsname __user *name); 39 - long s390x_personality(unsigned long personality); 40 - long s390_fadvise64(int fd, u32 offset_high, u32 offset_low, 37 + long sys_s390_newuname(struct new_utsname __user *name); 38 + long sys_s390_personality(unsigned long personality); 39 + long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low, 41 40 size_t len, int advice); 42 - long s390_fadvise64_64(struct fadvise64_64_args __user *args); 43 - long s390_fallocate(int fd, int mode, loff_t offset, u32 len_high, u32 len_low); 41 + long sys_s390_fadvise64_64(struct fadvise64_64_args __user *args); 42 + long sys_s390_fallocate(int fd, int mode, loff_t offset, u32 len_high, 43 + u32 len_low); 44 44 long sys_fork(void); 45 45 long sys_clone(void); 46 46 long sys_vfork(void); 47 47 void execve_tail(void); 48 48 long sys_execve(void); 49 - int sys_sigsuspend(int history0, int history1, old_sigset_t mask); 49 + long sys_sigsuspend(int history0, int history1, old_sigset_t mask); 50 50 long sys_sigaction(int sig, const struct old_sigaction __user *act, 51 51 struct old_sigaction __user *oact); 52 52 long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss);
+5 -4
arch/s390/kernel/process.c
··· 39 39 #include <linux/tick.h> 40 40 #include <linux/elfcore.h> 41 41 #include <linux/kernel_stat.h> 42 + #include <linux/syscalls.h> 42 43 #include <asm/uaccess.h> 43 44 #include <asm/pgtable.h> 44 45 #include <asm/system.h> ··· 226 225 return 0; 227 226 } 228 227 229 - asmlinkage long sys_fork(void) 228 + SYSCALL_DEFINE0(fork) 230 229 { 231 230 struct pt_regs *regs = task_pt_regs(current); 232 231 return do_fork(SIGCHLD, regs->gprs[15], regs, 0, NULL, NULL); 233 232 } 234 233 235 - asmlinkage long sys_clone(void) 234 + SYSCALL_DEFINE0(clone) 236 235 { 237 236 struct pt_regs *regs = task_pt_regs(current); 238 237 unsigned long clone_flags; ··· 259 258 * do not have enough call-clobbered registers to hold all 260 259 * the information you need. 261 260 */ 262 - asmlinkage long sys_vfork(void) 261 + SYSCALL_DEFINE0(vfork) 263 262 { 264 263 struct pt_regs *regs = task_pt_regs(current); 265 264 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, ··· 279 278 /* 280 279 * sys_execve() executes a new program. 281 280 */ 282 - asmlinkage long sys_execve(void) 281 + SYSCALL_DEFINE0(execve) 283 282 { 284 283 struct pt_regs *regs = task_pt_regs(current); 285 284 char *filename;
+8 -11
arch/s390/kernel/signal.c
··· 25 25 #include <linux/personality.h> 26 26 #include <linux/binfmts.h> 27 27 #include <linux/tracehook.h> 28 + #include <linux/syscalls.h> 28 29 #include <asm/ucontext.h> 29 30 #include <asm/uaccess.h> 30 31 #include <asm/lowcore.h> ··· 54 53 /* 55 54 * Atomically swap in the new signal mask, and wait for a signal. 56 55 */ 57 - asmlinkage int 58 - sys_sigsuspend(int history0, int history1, old_sigset_t mask) 56 + SYSCALL_DEFINE3(sigsuspend, int, history0, int, history1, old_sigset_t, mask) 59 57 { 60 58 mask &= _BLOCKABLE; 61 59 spin_lock_irq(&current->sighand->siglock); ··· 70 70 return -ERESTARTNOHAND; 71 71 } 72 72 73 - asmlinkage long 74 - sys_sigaction(int sig, const struct old_sigaction __user *act, 75 - struct old_sigaction __user *oact) 73 + SYSCALL_DEFINE3(sigaction, int, sig, const struct old_sigaction __user *, act, 74 + struct old_sigaction __user *, oact) 76 75 { 77 76 struct k_sigaction new_ka, old_ka; 78 77 int ret; ··· 101 102 return ret; 102 103 } 103 104 104 - asmlinkage long 105 - sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) 105 + SYSCALL_DEFINE2(sigaltstack, const stack_t __user *, uss, 106 + stack_t __user *, uoss) 106 107 { 107 108 struct pt_regs *regs = task_pt_regs(current); 108 109 return do_sigaltstack(uss, uoss, regs->gprs[15]); 109 110 } 110 - 111 - 112 111 113 112 /* Returns non-zero on fault. */ 114 113 static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs) ··· 161 164 return 0; 162 165 } 163 166 164 - asmlinkage long sys_sigreturn(void) 167 + SYSCALL_DEFINE0(sigreturn) 165 168 { 166 169 struct pt_regs *regs = task_pt_regs(current); 167 170 sigframe __user *frame = (sigframe __user *)regs->gprs[15]; ··· 188 191 return 0; 189 192 } 190 193 191 - asmlinkage long sys_rt_sigreturn(void) 194 + SYSCALL_DEFINE0(rt_sigreturn) 192 195 { 193 196 struct pt_regs *regs = task_pt_regs(current); 194 197 rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15];
+21 -14
arch/s390/kernel/sys_s390.c
··· 29 29 #include <linux/personality.h> 30 30 #include <linux/unistd.h> 31 31 #include <linux/ipc.h> 32 + #include <linux/syscalls.h> 32 33 #include <asm/uaccess.h> 33 34 #include "entry.h" 34 35 ··· 75 74 unsigned long offset; 76 75 }; 77 76 78 - asmlinkage long sys_mmap2(struct mmap_arg_struct __user *arg) 77 + SYSCALL_DEFINE1(mmap2, struct mmap_arg_struct __user *, arg) 79 78 { 80 79 struct mmap_arg_struct a; 81 80 int error = -EFAULT; ··· 87 86 return error; 88 87 } 89 88 90 - asmlinkage long old_mmap(struct mmap_arg_struct __user *arg) 89 + SYSCALL_DEFINE1(s390_old_mmap, struct mmap_arg_struct __user *, arg) 91 90 { 92 91 struct mmap_arg_struct a; 93 92 long error = -EFAULT; ··· 109 108 * 110 109 * This is really horribly ugly. 111 110 */ 112 - asmlinkage long sys_ipc(uint call, int first, unsigned long second, 113 - unsigned long third, void __user *ptr) 111 + SYSCALL_DEFINE5(ipc, uint, call, int, first, unsigned long, second, 112 + unsigned long, third, void __user *, ptr) 114 113 { 115 114 struct ipc_kludge tmp; 116 115 int ret; ··· 176 175 } 177 176 178 177 #ifdef CONFIG_64BIT 179 - asmlinkage long s390x_newuname(struct new_utsname __user *name) 178 + SYSCALL_DEFINE1(s390_newuname, struct new_utsname __user *, name) 180 179 { 181 180 int ret = sys_newuname(name); 182 181 ··· 187 186 return ret; 188 187 } 189 188 190 - asmlinkage long s390x_personality(unsigned long personality) 189 + SYSCALL_DEFINE1(s390_personality, unsigned long, personality) 191 190 { 192 191 int ret; 193 192 ··· 206 205 */ 207 206 #ifndef CONFIG_64BIT 208 207 209 - asmlinkage long 210 - s390_fadvise64(int fd, u32 offset_high, u32 offset_low, size_t len, int advice) 208 + SYSCALL_DEFINE5(s390_fadvise64, int, fd, u32, offset_high, u32, offset_low, 209 + size_t, len, int, advice) 211 210 { 212 211 return sys_fadvise64(fd, (u64) offset_high << 32 | offset_low, 213 212 len, advice); 214 213 } 215 - 216 - #endif 217 214 218 215 struct fadvise64_64_args { 219 216 int fd; ··· 220 221 int advice; 221 222 }; 222 223 223 - asmlinkage long 224 - s390_fadvise64_64(struct fadvise64_64_args __user *args) 224 + SYSCALL_DEFINE1(s390_fadvise64_64, struct fadvise64_64_args __user *, args) 225 225 { 226 226 struct fadvise64_64_args a; 227 227 ··· 229 231 return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice); 230 232 } 231 233 232 - #ifndef CONFIG_64BIT 233 234 /* 234 235 * This is a wrapper to call sys_fallocate(). For 31 bit s390 the last 235 236 * 64 bit argument "len" is split into the upper and lower 32 bits. The ··· 241 244 * to 242 245 * %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len 243 246 */ 244 - asmlinkage long s390_fallocate(int fd, int mode, loff_t offset, 247 + SYSCALL_DEFINE(s390_fallocate)(int fd, int mode, loff_t offset, 245 248 u32 len_high, u32 len_low) 246 249 { 247 250 return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low); 248 251 } 252 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 253 + asmlinkage long SyS_s390_fallocate(long fd, long mode, loff_t offset, 254 + long len_high, long len_low) 255 + { 256 + return SYSC_s390_fallocate((int) fd, (int) mode, offset, 257 + (u32) len_high, (u32) len_low); 258 + } 259 + SYSCALL_ALIAS(sys_s390_fallocate, SyS_s390_fallocate); 260 + #endif 261 + 249 262 #endif
+6 -6
arch/s390/kernel/syscalls.S
··· 98 98 SYSCALL(sys_swapon,sys_swapon,sys32_swapon_wrapper) 99 99 SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper) 100 100 SYSCALL(sys_ni_syscall,sys_ni_syscall,old32_readdir_wrapper) /* old readdir syscall */ 101 - SYSCALL(old_mmap,old_mmap,old32_mmap_wrapper) /* 90 */ 101 + SYSCALL(sys_s390_old_mmap,sys_s390_old_mmap,old32_mmap_wrapper) /* 90 */ 102 102 SYSCALL(sys_munmap,sys_munmap,sys32_munmap_wrapper) 103 103 SYSCALL(sys_truncate,sys_truncate,sys32_truncate_wrapper) 104 104 SYSCALL(sys_ftruncate,sys_ftruncate,sys32_ftruncate_wrapper) ··· 130 130 SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) 131 131 SYSCALL(sys_clone,sys_clone,sys32_clone) /* 120 */ 132 132 SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) 133 - SYSCALL(sys_newuname,s390x_newuname,sys32_newuname_wrapper) 133 + SYSCALL(sys_newuname,sys_s390_newuname,sys32_newuname_wrapper) 134 134 NI_SYSCALL /* modify_ldt for i386 */ 135 135 SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) 136 136 SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ ··· 144 144 SYSCALL(sys_fchdir,sys_fchdir,sys32_fchdir_wrapper) 145 145 SYSCALL(sys_bdflush,sys_bdflush,sys32_bdflush_wrapper) 146 146 SYSCALL(sys_sysfs,sys_sysfs,sys32_sysfs_wrapper) /* 135 */ 147 - SYSCALL(sys_personality,s390x_personality,sys32_personality_wrapper) 147 + SYSCALL(sys_personality,sys_s390_personality,sys32_personality_wrapper) 148 148 NI_SYSCALL /* for afs_syscall */ 149 149 SYSCALL(sys_setfsuid16,sys_ni_syscall,sys32_setfsuid16_wrapper) /* old setfsuid16 syscall */ 150 150 SYSCALL(sys_setfsgid16,sys_ni_syscall,sys32_setfsgid16_wrapper) /* old setfsgid16 syscall */ ··· 261 261 SYSCALL(sys_epoll_ctl,sys_epoll_ctl,sys_epoll_ctl_wrapper) /* 250 */ 262 262 SYSCALL(sys_epoll_wait,sys_epoll_wait,sys_epoll_wait_wrapper) 263 263 SYSCALL(sys_set_tid_address,sys_set_tid_address,sys32_set_tid_address_wrapper) 264 - SYSCALL(s390_fadvise64,sys_fadvise64_64,sys32_fadvise64_wrapper) 264 + SYSCALL(sys_s390_fadvise64,sys_fadvise64_64,sys32_fadvise64_wrapper) 265 265 SYSCALL(sys_timer_create,sys_timer_create,sys32_timer_create_wrapper) 266 266 SYSCALL(sys_timer_settime,sys_timer_settime,sys32_timer_settime_wrapper) /* 255 */ 267 267 SYSCALL(sys_timer_gettime,sys_timer_gettime,sys32_timer_gettime_wrapper) ··· 272 272 SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper) 273 273 SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper) 274 274 NI_SYSCALL /* reserved for vserver */ 275 - SYSCALL(s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper) 275 + SYSCALL(sys_s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper) 276 276 SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper) 277 277 SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper) 278 278 SYSCALL(sys_remap_file_pages,sys_remap_file_pages,sys32_remap_file_pages_wrapper) ··· 322 322 SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper) 323 323 SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper) 324 324 SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper) 325 - SYSCALL(s390_fallocate,sys_fallocate,sys_fallocate_wrapper) 325 + SYSCALL(sys_s390_fallocate,sys_fallocate,sys_fallocate_wrapper) 326 326 SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat_wrapper) /* 315 */ 327 327 SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd_wrapper) 328 328 NI_SYSCALL /* 317 old sys_timer_fd */
+3 -3
arch/sh/include/asm/syscalls_32.h
··· 36 36 asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, 37 37 unsigned long r6, unsigned long r7, 38 38 struct pt_regs __regs); 39 - asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, 40 - unsigned long r6, unsigned long r7, 41 - struct pt_regs __regs); 39 + asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5, 40 + unsigned long r6, unsigned long r7, 41 + struct pt_regs __regs); 42 42 asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, 43 43 size_t count, long dummy, loff_t pos); 44 44 asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf,
+1 -1
arch/sh/kernel/sys_sh32.c
··· 22 22 * sys_pipe() is the normal C calling standard for creating 23 23 * a pipe. It's not the way Unix traditionally does this, though. 24 24 */ 25 - asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, 25 + asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5, 26 26 unsigned long r6, unsigned long r7, 27 27 struct pt_regs __regs) 28 28 {
+2 -2
arch/sh/kernel/syscalls_32.S
··· 58 58 .long sys_mkdir 59 59 .long sys_rmdir /* 40 */ 60 60 .long sys_dup 61 - .long sys_pipe 61 + .long sys_sh_pipe 62 62 .long sys_times 63 63 .long sys_ni_syscall /* old prof syscall holder */ 64 64 .long sys_brk /* 45 */ ··· 105 105 .long sys_uselib 106 106 .long sys_swapon 107 107 .long sys_reboot 108 - .long old_readdir 108 + .long sys_old_readdir 109 109 .long old_mmap /* 90 */ 110 110 .long sys_munmap 111 111 .long sys_truncate
+1 -1
arch/sh/kernel/syscalls_64.S
··· 109 109 .long sys_uselib 110 110 .long sys_swapon 111 111 .long sys_reboot 112 - .long old_readdir 112 + .long sys_old_readdir 113 113 .long old_mmap /* 90 */ 114 114 .long sys_munmap 115 115 .long sys_truncate
+2 -2
arch/sparc/kernel/entry.S
··· 1088 1088 ld [%sp + STACKFRAME_SZ + PT_I0], %o0 1089 1089 1090 1090 .align 4 1091 - .globl sys_pipe 1092 - sys_pipe: 1091 + .globl sys_sparc_pipe 1092 + sys_sparc_pipe: 1093 1093 mov %o7, %l5 1094 1094 add %sp, STACKFRAME_SZ, %o0 ! pt_regs *regs arg 1095 1095 call sparc_pipe
+1 -1
arch/sparc/kernel/syscalls.S
··· 20 20 add %sp, PTREGS_OFF, %o0 21 21 22 22 .align 32 23 - sys_pipe: 23 + sys_sparc_pipe: 24 24 ba,pt %xcc, sparc_pipe 25 25 add %sp, PTREGS_OFF, %o0 26 26 sys_nis_syscall:
+2 -2
arch/sparc/kernel/systbls_32.S
··· 24 24 /*25*/ .long sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_pause 25 25 /*30*/ .long sys_utime, sys_lchown, sys_fchown, sys_access, sys_nice 26 26 /*35*/ .long sys_chown, sys_sync, sys_kill, sys_newstat, sys_sendfile 27 - /*40*/ .long sys_newlstat, sys_dup, sys_pipe, sys_times, sys_getuid 27 + /*40*/ .long sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_getuid 28 28 /*45*/ .long sys_umount, sys_setgid16, sys_getgid16, sys_signal, sys_geteuid16 29 29 /*50*/ .long sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, sys_ioctl 30 30 /*55*/ .long sys_reboot, sys_mmap2, sys_symlink, sys_readlink, sys_execve ··· 56 56 /*185*/ .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname 57 57 /*190*/ .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl 58 58 /*195*/ .long sys_epoll_wait, sys_ioprio_set, sys_getppid, sparc_sigaction, sys_sgetmask 59 - /*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, old_readdir 59 + /*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, sys_old_readdir 60 60 /*205*/ .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64 61 61 /*210*/ .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo 62 62 /*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_ioprio_get, sys_adjtimex
+2 -2
arch/sparc/kernel/systbls_64.S
··· 26 26 /*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys_pause 27 27 /*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice 28 28 .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile 29 - /*40*/ .word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid 29 + /*40*/ .word compat_sys_newlstat, sys_dup, sys_sparc_pipe, compat_sys_times, sys_getuid 30 30 .word sys32_umount, sys_setgid16, sys_getgid16, sys32_signal, sys_geteuid16 31 31 /*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl 32 32 .word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve ··· 100 100 /*25*/ .word sys_vmsplice, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall 101 101 /*30*/ .word sys_utime, sys_nis_syscall, sys_nis_syscall, sys_access, sys_nice 102 102 .word sys_nis_syscall, sys_sync, sys_kill, sys_newstat, sys_sendfile64 103 - /*40*/ .word sys_newlstat, sys_dup, sys_pipe, sys_times, sys_nis_syscall 103 + /*40*/ .word sys_newlstat, sys_dup, sys_sparc_pipe, sys_times, sys_nis_syscall 104 104 .word sys_umount, sys_setgid, sys_getgid, sys_signal, sys_geteuid 105 105 /*50*/ .word sys_getegid, sys_acct, sys_memory_ordering, sys_nis_syscall, sys_ioctl 106 106 .word sys_reboot, sys_nis_syscall, sys_symlink, sys_readlink, sys_execve
+1 -1
arch/x86/kernel/syscall_table_32.S
··· 88 88 .long sys_uselib 89 89 .long sys_swapon 90 90 .long sys_reboot 91 - .long old_readdir 91 + .long sys_old_readdir 92 92 .long old_mmap /* 90 */ 93 93 .long sys_munmap 94 94 .long sys_truncate
+4 -8
drivers/pci/syscall.c
··· 14 14 #include <asm/uaccess.h> 15 15 #include "pci.h" 16 16 17 - asmlinkage long 18 - sys_pciconfig_read(unsigned long bus, unsigned long dfn, 19 - unsigned long off, unsigned long len, 20 - void __user *buf) 17 + SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn, 18 + unsigned long, off, unsigned long, len, void __user *, buf) 21 19 { 22 20 struct pci_dev *dev; 23 21 u8 byte; ··· 84 86 return err; 85 87 } 86 88 87 - asmlinkage long 88 - sys_pciconfig_write(unsigned long bus, unsigned long dfn, 89 - unsigned long off, unsigned long len, 90 - void __user *buf) 89 + SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, 90 + unsigned long, off, unsigned long, len, void __user *, buf) 91 91 { 92 92 struct pci_dev *dev; 93 93 u8 byte;
+11 -11
fs/aio.c
··· 1270 1270 * pointer is passed for ctxp. Will fail with -ENOSYS if not 1271 1271 * implemented. 1272 1272 */ 1273 - asmlinkage long sys_io_setup(unsigned nr_events, aio_context_t __user *ctxp) 1273 + SYSCALL_DEFINE2(io_setup, unsigned, nr_events, aio_context_t __user *, ctxp) 1274 1274 { 1275 1275 struct kioctx *ioctx = NULL; 1276 1276 unsigned long ctx; ··· 1308 1308 * implemented. May fail with -EFAULT if the context pointed to 1309 1309 * is invalid. 1310 1310 */ 1311 - asmlinkage long sys_io_destroy(aio_context_t ctx) 1311 + SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx) 1312 1312 { 1313 1313 struct kioctx *ioctx = lookup_ioctx(ctx); 1314 1314 if (likely(NULL != ioctx)) { ··· 1662 1662 * are available to queue any iocbs. Will return 0 if nr is 0. Will 1663 1663 * fail with -ENOSYS if not implemented. 1664 1664 */ 1665 - asmlinkage long sys_io_submit(aio_context_t ctx_id, long nr, 1666 - struct iocb __user * __user *iocbpp) 1665 + SYSCALL_DEFINE3(io_submit, aio_context_t, ctx_id, long, nr, 1666 + struct iocb __user * __user *, iocbpp) 1667 1667 { 1668 1668 struct kioctx *ctx; 1669 1669 long ret = 0; ··· 1737 1737 * invalid. May fail with -EAGAIN if the iocb specified was not 1738 1738 * cancelled. Will fail with -ENOSYS if not implemented. 1739 1739 */ 1740 - asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, 1741 - struct io_event __user *result) 1740 + SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, 1741 + struct io_event __user *, result) 1742 1742 { 1743 1743 int (*cancel)(struct kiocb *iocb, struct io_event *res); 1744 1744 struct kioctx *ctx; ··· 1799 1799 * will be updated if not NULL and the operation blocks. Will fail 1800 1800 * with -ENOSYS if not implemented. 1801 1801 */ 1802 - asmlinkage long sys_io_getevents(aio_context_t ctx_id, 1803 - long min_nr, 1804 - long nr, 1805 - struct io_event __user *events, 1806 - struct timespec __user *timeout) 1802 + SYSCALL_DEFINE5(io_getevents, aio_context_t, ctx_id, 1803 + long, min_nr, 1804 + long, nr, 1805 + struct io_event __user *, events, 1806 + struct timespec __user *, timeout) 1807 1807 { 1808 1808 struct kioctx *ioctx = lookup_ioctx(ctx_id); 1809 1809 long ret = -EINVAL;
+1 -1
fs/buffer.c
··· 3243 3243 * Use of bdflush() is deprecated and will be removed in a future kernel. 3244 3244 * The `pdflush' kernel threads fully replace bdflush daemons and this call. 3245 3245 */ 3246 - asmlinkage long sys_bdflush(int func, long data) 3246 + SYSCALL_DEFINE2(bdflush, int, func, long, data) 3247 3247 { 3248 3248 static int msg_count; 3249 3249
+3 -3
fs/compat.c
··· 1709 1709 } 1710 1710 1711 1711 #ifdef HAVE_SET_RESTORE_SIGMASK 1712 - asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp, 1712 + static long do_compat_pselect(int n, compat_ulong_t __user *inp, 1713 1713 compat_ulong_t __user *outp, compat_ulong_t __user *exp, 1714 1714 struct compat_timespec __user *tsp, compat_sigset_t __user *sigmask, 1715 1715 compat_size_t sigsetsize) ··· 1775 1775 (compat_size_t __user *)(sig+sizeof(up)))) 1776 1776 return -EFAULT; 1777 1777 } 1778 - return compat_sys_pselect7(n, inp, outp, exp, tsp, compat_ptr(up), 1779 - sigsetsize); 1778 + return do_compat_pselect(n, inp, outp, exp, tsp, compat_ptr(up), 1779 + sigsetsize); 1780 1780 } 1781 1781 1782 1782 asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
+1 -1
fs/dcache.c
··· 2092 2092 * return NULL; 2093 2093 * } 2094 2094 */ 2095 - asmlinkage long sys_getcwd(char __user *buf, unsigned long size) 2095 + SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size) 2096 2096 { 2097 2097 int error; 2098 2098 struct path pwd, root;
+8 -2
fs/dcookies.c
··· 145 145 /* And here is where the userspace process can look up the cookie value 146 146 * to retrieve the path. 147 147 */ 148 - asmlinkage long sys_lookup_dcookie(u64 cookie64, char __user * buf, size_t len) 148 + SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len) 149 149 { 150 150 unsigned long cookie = (unsigned long)cookie64; 151 151 int err = -EINVAL; ··· 198 198 mutex_unlock(&dcookie_mutex); 199 199 return err; 200 200 } 201 - 201 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 202 + asmlinkage long SyS_lookup_dcookie(u64 cookie64, long buf, long len) 203 + { 204 + return SYSC_lookup_dcookie(cookie64, (char __user *) buf, (size_t) len); 205 + } 206 + SYSCALL_ALIAS(sys_lookup_dcookie, SyS_lookup_dcookie); 207 + #endif 202 208 203 209 static int dcookie_init(void) 204 210 {
+2 -3
fs/eventfd.c
··· 198 198 return file; 199 199 } 200 200 201 - asmlinkage long sys_eventfd2(unsigned int count, int flags) 201 + SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags) 202 202 { 203 203 int fd; 204 204 struct eventfd_ctx *ctx; ··· 228 228 return fd; 229 229 } 230 230 231 - asmlinkage long sys_eventfd(unsigned int count) 231 + SYSCALL_DEFINE1(eventfd, unsigned int, count) 232 232 { 233 233 return sys_eventfd2(count, 0); 234 234 } 235 -
+9 -9
fs/eventpoll.c
··· 1110 1110 /* 1111 1111 * Open an eventpoll file descriptor. 1112 1112 */ 1113 - asmlinkage long sys_epoll_create1(int flags) 1113 + SYSCALL_DEFINE1(epoll_create1, int, flags) 1114 1114 { 1115 1115 int error, fd = -1; 1116 1116 struct eventpoll *ep; ··· 1150 1150 return fd; 1151 1151 } 1152 1152 1153 - asmlinkage long sys_epoll_create(int size) 1153 + SYSCALL_DEFINE1(epoll_create, int, size) 1154 1154 { 1155 1155 if (size < 0) 1156 1156 return -EINVAL; ··· 1163 1163 * the eventpoll file that enables the insertion/removal/change of 1164 1164 * file descriptors inside the interest set. 1165 1165 */ 1166 - asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, 1167 - struct epoll_event __user *event) 1166 + SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, 1167 + struct epoll_event __user *, event) 1168 1168 { 1169 1169 int error; 1170 1170 struct file *file, *tfile; ··· 1261 1261 * Implement the event wait interface for the eventpoll file. It is the kernel 1262 1262 * part of the user space epoll_wait(2). 1263 1263 */ 1264 - asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events, 1265 - int maxevents, int timeout) 1264 + SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events, 1265 + int, maxevents, int, timeout) 1266 1266 { 1267 1267 int error; 1268 1268 struct file *file; ··· 1319 1319 * Implement the event wait interface for the eventpoll file. It is the kernel 1320 1320 * part of the user space epoll_pwait(2). 1321 1321 */ 1322 - asmlinkage long sys_epoll_pwait(int epfd, struct epoll_event __user *events, 1323 - int maxevents, int timeout, const sigset_t __user *sigmask, 1324 - size_t sigsetsize) 1322 + SYSCALL_DEFINE6(epoll_pwait, int, epfd, struct epoll_event __user *, events, 1323 + int, maxevents, int, timeout, const sigset_t __user *, sigmask, 1324 + size_t, sigsetsize) 1325 1325 { 1326 1326 int error; 1327 1327 sigset_t ksigmask, sigsaved;
+1 -1
fs/exec.c
··· 99 99 * 100 100 * Also note that we take the address to load from from the file itself. 101 101 */ 102 - asmlinkage long sys_uselib(const char __user * library) 102 + SYSCALL_DEFINE1(uselib, const char __user *, library) 103 103 { 104 104 struct file *file; 105 105 struct nameidata nd;
+6 -5
fs/fcntl.c
··· 50 50 return res; 51 51 } 52 52 53 - asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags) 53 + SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags) 54 54 { 55 55 int err = -EBADF; 56 56 struct file * file, *tofree; ··· 113 113 return err; 114 114 } 115 115 116 - asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd) 116 + SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd) 117 117 { 118 118 if (unlikely(newfd == oldfd)) { /* corner case */ 119 119 struct files_struct *files = current->files; ··· 126 126 return sys_dup3(oldfd, newfd, 0); 127 127 } 128 128 129 - asmlinkage long sys_dup(unsigned int fildes) 129 + SYSCALL_DEFINE1(dup, unsigned int, fildes) 130 130 { 131 131 int ret = -EBADF; 132 132 struct file *file = fget(fildes); ··· 335 335 return err; 336 336 } 337 337 338 - asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg) 338 + SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) 339 339 { 340 340 struct file *filp; 341 341 long err = -EBADF; ··· 358 358 } 359 359 360 360 #if BITS_PER_LONG == 32 361 - asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg) 361 + SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, 362 + unsigned long, arg) 362 363 { 363 364 struct file * filp; 364 365 long err;
+1 -1
fs/filesystems.c
··· 179 179 /* 180 180 * Whee.. Weird sysv syscall. 181 181 */ 182 - asmlinkage long sys_sysfs(int option, unsigned long arg1, unsigned long arg2) 182 + SYSCALL_DEFINE3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2) 183 183 { 184 184 int retval = -EINVAL; 185 185
+1 -1
fs/ioctl.c
··· 542 542 return error; 543 543 } 544 544 545 - asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) 545 + SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) 546 546 { 547 547 struct file *filp; 548 548 int error = -EBADF;
+2 -3
fs/ioprio.c
··· 72 72 } 73 73 EXPORT_SYMBOL_GPL(set_task_ioprio); 74 74 75 - asmlinkage long sys_ioprio_set(int which, int who, int ioprio) 75 + SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio) 76 76 { 77 77 int class = IOPRIO_PRIO_CLASS(ioprio); 78 78 int data = IOPRIO_PRIO_DATA(ioprio); ··· 188 188 return aprio; 189 189 } 190 190 191 - asmlinkage long sys_ioprio_get(int which, int who) 191 + SYSCALL_DEFINE2(ioprio_get, int, which, int, who) 192 192 { 193 193 struct task_struct *g, *p; 194 194 struct user_struct *user; ··· 252 252 read_unlock(&tasklist_lock); 253 253 return ret; 254 254 } 255 -
+1 -1
fs/locks.c
··· 1564 1564 * %LOCK_MAND can be combined with %LOCK_READ or %LOCK_WRITE to allow other 1565 1565 * processes read and write access respectively. 1566 1566 */ 1567 - asmlinkage long sys_flock(unsigned int fd, unsigned int cmd) 1567 + SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) 1568 1568 { 1569 1569 struct file *filp; 1570 1570 struct file_lock *lock;
+17 -18
fs/namei.c
··· 1962 1962 } 1963 1963 } 1964 1964 1965 - asmlinkage long sys_mknodat(int dfd, const char __user *filename, int mode, 1966 - unsigned dev) 1965 + SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode, 1966 + unsigned, dev) 1967 1967 { 1968 1968 int error; 1969 1969 char *tmp; ··· 2017 2017 return error; 2018 2018 } 2019 2019 2020 - asmlinkage long sys_mknod(const char __user *filename, int mode, unsigned dev) 2020 + SYSCALL_DEFINE3(mknod, const char __user *, filename, int, mode, unsigned, dev) 2021 2021 { 2022 2022 return sys_mknodat(AT_FDCWD, filename, mode, dev); 2023 2023 } ··· 2044 2044 return error; 2045 2045 } 2046 2046 2047 - asmlinkage long sys_mkdirat(int dfd, const char __user *pathname, int mode) 2047 + SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode) 2048 2048 { 2049 2049 int error = 0; 2050 2050 char * tmp; ··· 2081 2081 return error; 2082 2082 } 2083 2083 2084 - asmlinkage long sys_mkdir(const char __user *pathname, int mode) 2084 + SYSCALL_DEFINE2(mkdir, const char __user *, pathname, int, mode) 2085 2085 { 2086 2086 return sys_mkdirat(AT_FDCWD, pathname, mode); 2087 2087 } ··· 2195 2195 return error; 2196 2196 } 2197 2197 2198 - asmlinkage long sys_rmdir(const char __user *pathname) 2198 + SYSCALL_DEFINE1(rmdir, const char __user *, pathname) 2199 2199 { 2200 2200 return do_rmdir(AT_FDCWD, pathname); 2201 2201 } ··· 2291 2291 goto exit2; 2292 2292 } 2293 2293 2294 - asmlinkage long sys_unlinkat(int dfd, const char __user *pathname, int flag) 2294 + SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag) 2295 2295 { 2296 2296 if ((flag & ~AT_REMOVEDIR) != 0) 2297 2297 return -EINVAL; ··· 2302 2302 return do_unlinkat(dfd, pathname); 2303 2303 } 2304 2304 2305 - asmlinkage long sys_unlink(const char __user *pathname) 2305 + SYSCALL_DEFINE1(unlink, const char __user *, pathname) 2306 2306 { 2307 2307 return do_unlinkat(AT_FDCWD, pathname); 2308 2308 } ··· 2328 2328 return error; 2329 2329 } 2330 2330 2331 - asmlinkage long sys_symlinkat(const char __user *oldname, 2332 - int newdfd, const char __user *newname) 2331 + SYSCALL_DEFINE3(symlinkat, const char __user *, oldname, 2332 + int, newdfd, const char __user *, newname) 2333 2333 { 2334 2334 int error; 2335 2335 char *from; ··· 2370 2370 return error; 2371 2371 } 2372 2372 2373 - asmlinkage long sys_symlink(const char __user *oldname, const char __user *newname) 2373 + SYSCALL_DEFINE2(symlink, const char __user *, oldname, const char __user *, newname) 2374 2374 { 2375 2375 return sys_symlinkat(oldname, AT_FDCWD, newname); 2376 2376 } ··· 2422 2422 * with linux 2.0, and to avoid hard-linking to directories 2423 2423 * and other special files. --ADM 2424 2424 */ 2425 - asmlinkage long sys_linkat(int olddfd, const char __user *oldname, 2426 - int newdfd, const char __user *newname, 2427 - int flags) 2425 + SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname, 2426 + int, newdfd, const char __user *, newname, int, flags) 2428 2427 { 2429 2428 struct dentry *new_dentry; 2430 2429 struct nameidata nd; ··· 2472 2473 return error; 2473 2474 } 2474 2475 2475 - asmlinkage long sys_link(const char __user *oldname, const char __user *newname) 2476 + SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname) 2476 2477 { 2477 2478 return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0); 2478 2479 } ··· 2623 2624 return error; 2624 2625 } 2625 2626 2626 - asmlinkage long sys_renameat(int olddfd, const char __user *oldname, 2627 - int newdfd, const char __user *newname) 2627 + SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname, 2628 + int, newdfd, const char __user *, newname) 2628 2629 { 2629 2630 struct dentry *old_dir, *new_dir; 2630 2631 struct dentry *old_dentry, *new_dentry; ··· 2717 2718 return error; 2718 2719 } 2719 2720 2720 - asmlinkage long sys_rename(const char __user *oldname, const char __user *newname) 2721 + SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newname) 2721 2722 { 2722 2723 return sys_renameat(AT_FDCWD, oldname, AT_FDCWD, newname); 2723 2724 }
+6 -7
fs/namespace.c
··· 1128 1128 * unixes. Our API is identical to OSF/1 to avoid making a mess of AMD 1129 1129 */ 1130 1130 1131 - asmlinkage long sys_umount(char __user * name, int flags) 1131 + SYSCALL_DEFINE2(umount, char __user *, name, int, flags) 1132 1132 { 1133 1133 struct path path; 1134 1134 int retval; ··· 1160 1160 /* 1161 1161 * The 2.0 compatible umount. No flags. 1162 1162 */ 1163 - asmlinkage long sys_oldumount(char __user * name) 1163 + SYSCALL_DEFINE1(oldumount, char __user *, name) 1164 1164 { 1165 1165 return sys_umount(name, 0); 1166 1166 } ··· 2045 2045 return new_ns; 2046 2046 } 2047 2047 2048 - asmlinkage long sys_mount(char __user * dev_name, char __user * dir_name, 2049 - char __user * type, unsigned long flags, 2050 - void __user * data) 2048 + SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name, 2049 + char __user *, type, unsigned long, flags, void __user *, data) 2051 2050 { 2052 2051 int retval; 2053 2052 unsigned long data_page; ··· 2171 2172 * though, so you may need to say mount --bind /nfs/my_root /nfs/my_root 2172 2173 * first. 2173 2174 */ 2174 - asmlinkage long sys_pivot_root(const char __user * new_root, 2175 - const char __user * put_old) 2175 + SYSCALL_DEFINE2(pivot_root, const char __user *, new_root, 2176 + const char __user *, put_old) 2176 2177 { 2177 2178 struct vfsmount *tmp; 2178 2179 struct path new, old, parent_path, root_parent, root;
+2 -2
fs/nfsctl.c
··· 86 86 }, 87 87 }; 88 88 89 - long 90 - asmlinkage sys_nfsservctl(int cmd, struct nfsctl_arg __user *arg, void __user *res) 89 + SYSCALL_DEFINE3(nfsservctl, int, cmd, struct nfsctl_arg __user *, arg, 90 + void __user *, res) 91 91 { 92 92 struct file *file; 93 93 void __user *p = &arg->u;
+5 -4
fs/notify/inotify/inotify_user.c
··· 576 576 .destroy_watch = free_inotify_user_watch, 577 577 }; 578 578 579 - asmlinkage long sys_inotify_init1(int flags) 579 + SYSCALL_DEFINE1(inotify_init1, int, flags) 580 580 { 581 581 struct inotify_device *dev; 582 582 struct inotify_handle *ih; ··· 655 655 return ret; 656 656 } 657 657 658 - asmlinkage long sys_inotify_init(void) 658 + SYSCALL_DEFINE0(inotify_init) 659 659 { 660 660 return sys_inotify_init1(0); 661 661 } 662 662 663 - asmlinkage long sys_inotify_add_watch(int fd, const char __user *pathname, u32 mask) 663 + SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, 664 + u32, mask) 664 665 { 665 666 struct inode *inode; 666 667 struct inotify_device *dev; ··· 705 704 return ret; 706 705 } 707 706 708 - asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd) 707 + SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd) 709 708 { 710 709 struct file *filp; 711 710 struct inotify_device *dev;
+49 -33
fs/open.c
··· 122 122 return 0; 123 123 } 124 124 125 - asmlinkage long sys_statfs(const char __user *pathname, struct statfs __user * buf) 125 + SYSCALL_DEFINE2(statfs, const char __user *, pathname, struct statfs __user *, buf) 126 126 { 127 127 struct path path; 128 128 int error; ··· 138 138 return error; 139 139 } 140 140 141 - 142 - asmlinkage long sys_statfs64(const char __user *pathname, size_t sz, struct statfs64 __user *buf) 141 + SYSCALL_DEFINE3(statfs64, const char __user *, pathname, size_t, sz, struct statfs64 __user *, buf) 143 142 { 144 143 struct path path; 145 144 long error; ··· 156 157 return error; 157 158 } 158 159 159 - 160 - asmlinkage long sys_fstatfs(unsigned int fd, struct statfs __user * buf) 160 + SYSCALL_DEFINE2(fstatfs, unsigned int, fd, struct statfs __user *, buf) 161 161 { 162 162 struct file * file; 163 163 struct statfs tmp; ··· 174 176 return error; 175 177 } 176 178 177 - asmlinkage long sys_fstatfs64(unsigned int fd, size_t sz, struct statfs64 __user *buf) 179 + SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, size_t, sz, struct statfs64 __user *, buf) 178 180 { 179 181 struct file * file; 180 182 struct statfs64 tmp; ··· 287 289 return error; 288 290 } 289 291 290 - asmlinkage long sys_truncate(const char __user * path, unsigned long length) 292 + SYSCALL_DEFINE2(truncate, const char __user *, path, unsigned long, length) 291 293 { 292 294 /* on 32-bit boxen it will cut the range 2^31--2^32-1 off */ 293 295 return do_sys_truncate(path, (long)length); ··· 339 341 return error; 340 342 } 341 343 342 - asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length) 344 + SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length) 343 345 { 344 346 long ret = do_sys_ftruncate(fd, length, 1); 345 347 /* avoid REGPARM breakage on x86: */ ··· 349 351 350 352 /* LFS versions of truncate are only needed on 32 bit machines */ 351 353 #if BITS_PER_LONG == 32 352 - asmlinkage long sys_truncate64(const char __user * path, loff_t length) 354 + SYSCALL_DEFINE(truncate64)(const char __user * path, loff_t length) 353 355 { 354 356 return do_sys_truncate(path, length); 355 357 } 358 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 359 + asmlinkage long SyS_truncate64(long path, loff_t length) 360 + { 361 + return SYSC_truncate64((const char __user *) path, length); 362 + } 363 + SYSCALL_ALIAS(sys_truncate64, SyS_truncate64); 364 + #endif 356 365 357 - asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length) 366 + SYSCALL_DEFINE(ftruncate64)(unsigned int fd, loff_t length) 358 367 { 359 368 long ret = do_sys_ftruncate(fd, length, 0); 360 369 /* avoid REGPARM breakage on x86: */ 361 370 asmlinkage_protect(2, ret, fd, length); 362 371 return ret; 363 372 } 373 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 374 + asmlinkage long SyS_ftruncate64(long fd, loff_t length) 375 + { 376 + return SYSC_ftruncate64((unsigned int) fd, length); 377 + } 378 + SYSCALL_ALIAS(sys_ftruncate64, SyS_ftruncate64); 364 379 #endif 380 + #endif /* BITS_PER_LONG == 32 */ 365 381 366 - asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len) 382 + SYSCALL_DEFINE(fallocate)(int fd, int mode, loff_t offset, loff_t len) 367 383 { 368 384 struct file *file; 369 385 struct inode *inode; ··· 434 422 out: 435 423 return ret; 436 424 } 425 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 426 + asmlinkage long SyS_fallocate(long fd, long mode, loff_t offset, loff_t len) 427 + { 428 + return SYSC_fallocate((int)fd, (int)mode, offset, len); 429 + } 430 + SYSCALL_ALIAS(sys_fallocate, SyS_fallocate); 431 + #endif 437 432 438 433 /* 439 434 * access() needs to use the real uid/gid, not the effective uid/gid. 440 435 * We do this by temporarily clearing all FS-related capabilities and 441 436 * switching the fsuid/fsgid around to the real ones. 442 437 */ 443 - asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode) 438 + SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) 444 439 { 445 440 const struct cred *old_cred; 446 441 struct cred *override_cred; ··· 517 498 return res; 518 499 } 519 500 520 - asmlinkage long sys_access(const char __user *filename, int mode) 501 + SYSCALL_DEFINE2(access, const char __user *, filename, int, mode) 521 502 { 522 503 return sys_faccessat(AT_FDCWD, filename, mode); 523 504 } 524 505 525 - asmlinkage long sys_chdir(const char __user * filename) 506 + SYSCALL_DEFINE1(chdir, const char __user *, filename) 526 507 { 527 508 struct path path; 528 509 int error; ··· 543 524 return error; 544 525 } 545 526 546 - asmlinkage long sys_fchdir(unsigned int fd) 527 + SYSCALL_DEFINE1(fchdir, unsigned int, fd) 547 528 { 548 529 struct file *file; 549 530 struct inode *inode; ··· 569 550 return error; 570 551 } 571 552 572 - asmlinkage long sys_chroot(const char __user * filename) 553 + SYSCALL_DEFINE1(chroot, const char __user *, filename) 573 554 { 574 555 struct path path; 575 556 int error; ··· 594 575 return error; 595 576 } 596 577 597 - asmlinkage long sys_fchmod(unsigned int fd, mode_t mode) 578 + SYSCALL_DEFINE2(fchmod, unsigned int, fd, mode_t, mode) 598 579 { 599 580 struct inode * inode; 600 581 struct dentry * dentry; ··· 628 609 return err; 629 610 } 630 611 631 - asmlinkage long sys_fchmodat(int dfd, const char __user *filename, 632 - mode_t mode) 612 + SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, mode_t, mode) 633 613 { 634 614 struct path path; 635 615 struct inode *inode; ··· 657 639 return error; 658 640 } 659 641 660 - asmlinkage long sys_chmod(const char __user *filename, mode_t mode) 642 + SYSCALL_DEFINE2(chmod, const char __user *, filename, mode_t, mode) 661 643 { 662 644 return sys_fchmodat(AT_FDCWD, filename, mode); 663 645 } ··· 687 669 return error; 688 670 } 689 671 690 - asmlinkage long sys_chown(const char __user * filename, uid_t user, gid_t group) 672 + SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group) 691 673 { 692 674 struct path path; 693 675 int error; ··· 706 688 return error; 707 689 } 708 690 709 - asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user, 710 - gid_t group, int flag) 691 + SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user, 692 + gid_t, group, int, flag) 711 693 { 712 694 struct path path; 713 695 int error = -EINVAL; ··· 731 713 return error; 732 714 } 733 715 734 - asmlinkage long sys_lchown(const char __user * filename, uid_t user, gid_t group) 716 + SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group) 735 717 { 736 718 struct path path; 737 719 int error; ··· 750 732 return error; 751 733 } 752 734 753 - 754 - asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group) 735 + SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group) 755 736 { 756 737 struct file * file; 757 738 int error = -EBADF; ··· 1046 1029 return fd; 1047 1030 } 1048 1031 1049 - asmlinkage long sys_open(const char __user *filename, int flags, int mode) 1032 + SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, int, mode) 1050 1033 { 1051 1034 long ret; 1052 1035 ··· 1059 1042 return ret; 1060 1043 } 1061 1044 1062 - asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, 1063 - int mode) 1045 + SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, 1046 + int, mode) 1064 1047 { 1065 1048 long ret; 1066 1049 ··· 1079 1062 * For backward compatibility? Maybe this should be moved 1080 1063 * into arch/i386 instead? 1081 1064 */ 1082 - asmlinkage long sys_creat(const char __user * pathname, int mode) 1065 + SYSCALL_DEFINE2(creat, const char __user *, pathname, int, mode) 1083 1066 { 1084 1067 return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); 1085 1068 } ··· 1115 1098 * releasing the fd. This ensures that one clone task can't release 1116 1099 * an fd while another clone is opening it. 1117 1100 */ 1118 - asmlinkage long sys_close(unsigned int fd) 1101 + SYSCALL_DEFINE1(close, unsigned int, fd) 1119 1102 { 1120 1103 struct file * filp; 1121 1104 struct files_struct *files = current->files; ··· 1148 1131 spin_unlock(&files->file_lock); 1149 1132 return -EBADF; 1150 1133 } 1151 - 1152 1134 EXPORT_SYMBOL(sys_close); 1153 1135 1154 1136 /* 1155 1137 * This routine simulates a hangup on the tty, to arrange that users 1156 1138 * are given clean terminals at login time. 1157 1139 */ 1158 - asmlinkage long sys_vhangup(void) 1140 + SYSCALL_DEFINE0(vhangup) 1159 1141 { 1160 1142 if (capable(CAP_SYS_TTY_CONFIG)) { 1161 1143 tty_vhangup_self();
+2 -2
fs/pipe.c
··· 1043 1043 * sys_pipe() is the normal C calling standard for creating 1044 1044 * a pipe. It's not the way Unix traditionally does this, though. 1045 1045 */ 1046 - asmlinkage long __weak sys_pipe2(int __user *fildes, int flags) 1046 + SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags) 1047 1047 { 1048 1048 int fd[2]; 1049 1049 int error; ··· 1059 1059 return error; 1060 1060 } 1061 1061 1062 - asmlinkage long __weak sys_pipe(int __user *fildes) 1062 + SYSCALL_DEFINE1(pipe, int __user *, fildes) 1063 1063 { 1064 1064 return sys_pipe2(fildes, 0); 1065 1065 }
+2 -1
fs/quota.c
··· 371 371 * calls. Maybe we need to add the process quotas etc. in the future, 372 372 * but we probably should use rlimits for that. 373 373 */ 374 - asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special, qid_t id, void __user *addr) 374 + SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special, 375 + qid_t, id, void __user *, addr) 375 376 { 376 377 uint cmds, type; 377 378 struct super_block *sb = NULL;
+33 -16
fs/read_write.c
··· 147 147 } 148 148 EXPORT_SYMBOL(vfs_llseek); 149 149 150 - asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin) 150 + SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, origin) 151 151 { 152 152 off_t retval; 153 153 struct file * file; ··· 171 171 } 172 172 173 173 #ifdef __ARCH_WANT_SYS_LLSEEK 174 - asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, 175 - unsigned long offset_low, loff_t __user * result, 176 - unsigned int origin) 174 + SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high, 175 + unsigned long, offset_low, loff_t __user *, result, 176 + unsigned int, origin) 177 177 { 178 178 int retval; 179 179 struct file * file; ··· 369 369 file->f_pos = pos; 370 370 } 371 371 372 - asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count) 372 + SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count) 373 373 { 374 374 struct file *file; 375 375 ssize_t ret = -EBADF; ··· 386 386 return ret; 387 387 } 388 388 389 - asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf, size_t count) 389 + SYSCALL_DEFINE3(write, unsigned int, fd, const char __user *, buf, 390 + size_t, count) 390 391 { 391 392 struct file *file; 392 393 ssize_t ret = -EBADF; ··· 404 403 return ret; 405 404 } 406 405 407 - asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, 408 - size_t count, loff_t pos) 406 + SYSCALL_DEFINE(pread64)(unsigned int fd, char __user *buf, 407 + size_t count, loff_t pos) 409 408 { 410 409 struct file *file; 411 410 ssize_t ret = -EBADF; ··· 424 423 425 424 return ret; 426 425 } 426 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 427 + asmlinkage long SyS_pread64(long fd, long buf, long count, loff_t pos) 428 + { 429 + return SYSC_pread64((unsigned int) fd, (char __user *) buf, 430 + (size_t) count, pos); 431 + } 432 + SYSCALL_ALIAS(sys_pread64, SyS_pread64); 433 + #endif 427 434 428 - asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf, 429 - size_t count, loff_t pos) 435 + SYSCALL_DEFINE(pwrite64)(unsigned int fd, const char __user *buf, 436 + size_t count, loff_t pos) 430 437 { 431 438 struct file *file; 432 439 ssize_t ret = -EBADF; ··· 453 444 454 445 return ret; 455 446 } 447 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 448 + asmlinkage long SyS_pwrite64(long fd, long buf, long count, loff_t pos) 449 + { 450 + return SYSC_pwrite64((unsigned int) fd, (const char __user *) buf, 451 + (size_t) count, pos); 452 + } 453 + SYSCALL_ALIAS(sys_pwrite64, SyS_pwrite64); 454 + #endif 456 455 457 456 /* 458 457 * Reduce an iovec's length in-place. Return the resulting number of segments ··· 689 672 690 673 EXPORT_SYMBOL(vfs_writev); 691 674 692 - asmlinkage ssize_t 693 - sys_readv(unsigned long fd, const struct iovec __user *vec, unsigned long vlen) 675 + SYSCALL_DEFINE3(readv, unsigned long, fd, const struct iovec __user *, vec, 676 + unsigned long, vlen) 694 677 { 695 678 struct file *file; 696 679 ssize_t ret = -EBADF; ··· 710 693 return ret; 711 694 } 712 695 713 - asmlinkage ssize_t 714 - sys_writev(unsigned long fd, const struct iovec __user *vec, unsigned long vlen) 696 + SYSCALL_DEFINE3(writev, unsigned long, fd, const struct iovec __user *, vec, 697 + unsigned long, vlen) 715 698 { 716 699 struct file *file; 717 700 ssize_t ret = -EBADF; ··· 829 812 return retval; 830 813 } 831 814 832 - asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t __user *offset, size_t count) 815 + SYSCALL_DEFINE4(sendfile, int, out_fd, int, in_fd, off_t __user *, offset, size_t, count) 833 816 { 834 817 loff_t pos; 835 818 off_t off; ··· 848 831 return do_sendfile(out_fd, in_fd, NULL, count, 0); 849 832 } 850 833 851 - asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t __user *offset, size_t count) 834 + SYSCALL_DEFINE4(sendfile64, int, out_fd, int, in_fd, loff_t __user *, offset, size_t, count) 852 835 { 853 836 loff_t pos; 854 837 ssize_t ret;
+6 -3
fs/readdir.c
··· 102 102 return -EFAULT; 103 103 } 104 104 105 - asmlinkage long old_readdir(unsigned int fd, struct old_linux_dirent __user * dirent, unsigned int count) 105 + SYSCALL_DEFINE3(old_readdir, unsigned int, fd, 106 + struct old_linux_dirent __user *, dirent, unsigned int, count) 106 107 { 107 108 int error; 108 109 struct file * file; ··· 188 187 return -EFAULT; 189 188 } 190 189 191 - asmlinkage long sys_getdents(unsigned int fd, struct linux_dirent __user * dirent, unsigned int count) 190 + SYSCALL_DEFINE3(getdents, unsigned int, fd, 191 + struct linux_dirent __user *, dirent, unsigned int, count) 192 192 { 193 193 struct file * file; 194 194 struct linux_dirent __user * lastdirent; ··· 270 268 return -EFAULT; 271 269 } 272 270 273 - asmlinkage long sys_getdents64(unsigned int fd, struct linux_dirent64 __user * dirent, unsigned int count) 271 + SYSCALL_DEFINE3(getdents64, unsigned int, fd, 272 + struct linux_dirent64 __user *, dirent, unsigned int, count) 274 273 { 275 274 struct file * file; 276 275 struct linux_dirent64 __user * lastdirent;
+14 -13
fs/select.c
··· 557 557 return ret; 558 558 } 559 559 560 - asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, 561 - fd_set __user *exp, struct timeval __user *tvp) 560 + SYSCALL_DEFINE5(select, int, n, fd_set __user *, inp, fd_set __user *, outp, 561 + fd_set __user *, exp, struct timeval __user *, tvp) 562 562 { 563 563 struct timespec end_time, *to = NULL; 564 564 struct timeval tv; ··· 582 582 } 583 583 584 584 #ifdef HAVE_SET_RESTORE_SIGMASK 585 - asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp, 586 - fd_set __user *exp, struct timespec __user *tsp, 587 - const sigset_t __user *sigmask, size_t sigsetsize) 585 + static long do_pselect(int n, fd_set __user *inp, fd_set __user *outp, 586 + fd_set __user *exp, struct timespec __user *tsp, 587 + const sigset_t __user *sigmask, size_t sigsetsize) 588 588 { 589 589 sigset_t ksigmask, sigsaved; 590 590 struct timespec ts, end_time, *to = NULL; ··· 636 636 * which has a pointer to the sigset_t itself followed by a size_t containing 637 637 * the sigset size. 638 638 */ 639 - asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp, 640 - fd_set __user *exp, struct timespec __user *tsp, void __user *sig) 639 + SYSCALL_DEFINE6(pselect6, int, n, fd_set __user *, inp, fd_set __user *, outp, 640 + fd_set __user *, exp, struct timespec __user *, tsp, 641 + void __user *, sig) 641 642 { 642 643 size_t sigsetsize = 0; 643 644 sigset_t __user *up = NULL; ··· 651 650 return -EFAULT; 652 651 } 653 652 654 - return sys_pselect7(n, inp, outp, exp, tsp, up, sigsetsize); 653 + return do_pselect(n, inp, outp, exp, tsp, up, sigsetsize); 655 654 } 656 655 #endif /* HAVE_SET_RESTORE_SIGMASK */ 657 656 ··· 855 854 return ret; 856 855 } 857 856 858 - asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, 859 - long timeout_msecs) 857 + SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds, 858 + long, timeout_msecs) 860 859 { 861 860 struct timespec end_time, *to = NULL; 862 861 int ret; ··· 890 889 } 891 890 892 891 #ifdef HAVE_SET_RESTORE_SIGMASK 893 - asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds, 894 - struct timespec __user *tsp, const sigset_t __user *sigmask, 895 - size_t sigsetsize) 892 + SYSCALL_DEFINE5(ppoll, struct pollfd __user *, ufds, unsigned int, nfds, 893 + struct timespec __user *, tsp, const sigset_t __user *, sigmask, 894 + size_t, sigsetsize) 896 895 { 897 896 sigset_t ksigmask, sigsaved; 898 897 struct timespec ts, end_time, *to = NULL;
+4 -4
fs/signalfd.c
··· 205 205 .read = signalfd_read, 206 206 }; 207 207 208 - asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask, 209 - size_t sizemask, int flags) 208 + SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask, 209 + size_t, sizemask, int, flags) 210 210 { 211 211 sigset_t sigmask; 212 212 struct signalfd_ctx *ctx; ··· 259 259 return ufd; 260 260 } 261 261 262 - asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, 263 - size_t sizemask) 262 + SYSCALL_DEFINE3(signalfd, int, ufd, sigset_t __user *, user_mask, 263 + size_t, sizemask) 264 264 { 265 265 return sys_signalfd4(ufd, user_mask, sizemask, 0); 266 266 }
+6 -6
fs/splice.c
··· 1435 1435 * Currently we punt and implement it as a normal copy, see pipe_to_user(). 1436 1436 * 1437 1437 */ 1438 - asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov, 1439 - unsigned long nr_segs, unsigned int flags) 1438 + SYSCALL_DEFINE4(vmsplice, int, fd, const struct iovec __user *, iov, 1439 + unsigned long, nr_segs, unsigned int, flags) 1440 1440 { 1441 1441 struct file *file; 1442 1442 long error; ··· 1461 1461 return error; 1462 1462 } 1463 1463 1464 - asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, 1465 - int fd_out, loff_t __user *off_out, 1466 - size_t len, unsigned int flags) 1464 + SYSCALL_DEFINE6(splice, int, fd_in, loff_t __user *, off_in, 1465 + int, fd_out, loff_t __user *, off_out, 1466 + size_t, len, unsigned int, flags) 1467 1467 { 1468 1468 long error; 1469 1469 struct file *in, *out; ··· 1685 1685 return ret; 1686 1686 } 1687 1687 1688 - asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags) 1688 + SYSCALL_DEFINE4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags) 1689 1689 { 1690 1690 struct file *in; 1691 1691 int error, fput_in;
+21 -17
fs/stat.c
··· 152 152 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 153 153 } 154 154 155 - asmlinkage long sys_stat(char __user * filename, struct __old_kernel_stat __user * statbuf) 155 + SYSCALL_DEFINE2(stat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) 156 156 { 157 157 struct kstat stat; 158 158 int error = vfs_stat_fd(AT_FDCWD, filename, &stat); ··· 162 162 163 163 return error; 164 164 } 165 - asmlinkage long sys_lstat(char __user * filename, struct __old_kernel_stat __user * statbuf) 165 + 166 + SYSCALL_DEFINE2(lstat, char __user *, filename, struct __old_kernel_stat __user *, statbuf) 166 167 { 167 168 struct kstat stat; 168 169 int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); ··· 173 172 174 173 return error; 175 174 } 176 - asmlinkage long sys_fstat(unsigned int fd, struct __old_kernel_stat __user * statbuf) 175 + 176 + SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, statbuf) 177 177 { 178 178 struct kstat stat; 179 179 int error = vfs_fstat(fd, &stat); ··· 237 235 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 238 236 } 239 237 240 - asmlinkage long sys_newstat(char __user *filename, struct stat __user *statbuf) 238 + SYSCALL_DEFINE2(newstat, char __user *, filename, struct stat __user *, statbuf) 241 239 { 242 240 struct kstat stat; 243 241 int error = vfs_stat_fd(AT_FDCWD, filename, &stat); ··· 248 246 return error; 249 247 } 250 248 251 - asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf) 249 + SYSCALL_DEFINE2(newlstat, char __user *, filename, struct stat __user *, statbuf) 252 250 { 253 251 struct kstat stat; 254 252 int error = vfs_lstat_fd(AT_FDCWD, filename, &stat); ··· 260 258 } 261 259 262 260 #if !defined(__ARCH_WANT_STAT64) || defined(__ARCH_WANT_SYS_NEWFSTATAT) 263 - asmlinkage long sys_newfstatat(int dfd, char __user *filename, 264 - struct stat __user *statbuf, int flag) 261 + SYSCALL_DEFINE4(newfstatat, int, dfd, char __user *, filename, 262 + struct stat __user *, statbuf, int, flag) 265 263 { 266 264 struct kstat stat; 267 265 int error = -EINVAL; ··· 282 280 } 283 281 #endif 284 282 285 - asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf) 283 + SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf) 286 284 { 287 285 struct kstat stat; 288 286 int error = vfs_fstat(fd, &stat); ··· 293 291 return error; 294 292 } 295 293 296 - asmlinkage long sys_readlinkat(int dfd, const char __user *pathname, 297 - char __user *buf, int bufsiz) 294 + SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname, 295 + char __user *, buf, int, bufsiz) 298 296 { 299 297 struct path path; 300 298 int error; ··· 320 318 return error; 321 319 } 322 320 323 - asmlinkage long sys_readlink(const char __user *path, char __user *buf, 324 - int bufsiz) 321 + SYSCALL_DEFINE3(readlink, const char __user *, path, char __user *, buf, 322 + int, bufsiz) 325 323 { 326 324 return sys_readlinkat(AT_FDCWD, path, buf, bufsiz); 327 325 } ··· 367 365 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 368 366 } 369 367 370 - asmlinkage long sys_stat64(char __user * filename, struct stat64 __user * statbuf) 368 + SYSCALL_DEFINE2(stat64, char __user *, filename, struct stat64 __user *, statbuf) 371 369 { 372 370 struct kstat stat; 373 371 int error = vfs_stat(filename, &stat); ··· 377 375 378 376 return error; 379 377 } 380 - asmlinkage long sys_lstat64(char __user * filename, struct stat64 __user * statbuf) 378 + 379 + SYSCALL_DEFINE2(lstat64, char __user *, filename, struct stat64 __user *, statbuf) 381 380 { 382 381 struct kstat stat; 383 382 int error = vfs_lstat(filename, &stat); ··· 388 385 389 386 return error; 390 387 } 391 - asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf) 388 + 389 + SYSCALL_DEFINE2(fstat64, unsigned long, fd, struct stat64 __user *, statbuf) 392 390 { 393 391 struct kstat stat; 394 392 int error = vfs_fstat(fd, &stat); ··· 400 396 return error; 401 397 } 402 398 403 - asmlinkage long sys_fstatat64(int dfd, char __user *filename, 404 - struct stat64 __user *statbuf, int flag) 399 + SYSCALL_DEFINE4(fstatat64, int, dfd, char __user *, filename, 400 + struct stat64 __user *, statbuf, int, flag) 405 401 { 406 402 struct kstat stat; 407 403 int error = -EINVAL;
+1 -1
fs/super.c
··· 544 544 return NULL; 545 545 } 546 546 547 - asmlinkage long sys_ustat(unsigned dev, struct ustat __user * ubuf) 547 + SYSCALL_DEFINE2(ustat, unsigned, dev, struct ustat __user *, ubuf) 548 548 { 549 549 struct super_block *s; 550 550 struct ustat tmp;
+25 -7
fs/sync.c
··· 36 36 laptop_sync_completion(); 37 37 } 38 38 39 - asmlinkage long sys_sync(void) 39 + SYSCALL_DEFINE0(sync) 40 40 { 41 41 do_sync(1); 42 42 return 0; ··· 144 144 return ret; 145 145 } 146 146 147 - asmlinkage long sys_fsync(unsigned int fd) 147 + SYSCALL_DEFINE1(fsync, unsigned int, fd) 148 148 { 149 149 return do_fsync(fd, 0); 150 150 } 151 151 152 - asmlinkage long sys_fdatasync(unsigned int fd) 152 + SYSCALL_DEFINE1(fdatasync, unsigned int, fd) 153 153 { 154 154 return do_fsync(fd, 1); 155 155 } ··· 201 201 * already-instantiated disk blocks, there are no guarantees here that the data 202 202 * will be available after a crash. 203 203 */ 204 - asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, 205 - unsigned int flags) 204 + SYSCALL_DEFINE(sync_file_range)(int fd, loff_t offset, loff_t nbytes, 205 + unsigned int flags) 206 206 { 207 207 int ret; 208 208 struct file *file; ··· 262 262 out: 263 263 return ret; 264 264 } 265 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 266 + asmlinkage long SyS_sync_file_range(long fd, loff_t offset, loff_t nbytes, 267 + long flags) 268 + { 269 + return SYSC_sync_file_range((int) fd, offset, nbytes, 270 + (unsigned int) flags); 271 + } 272 + SYSCALL_ALIAS(sys_sync_file_range, SyS_sync_file_range); 273 + #endif 265 274 266 275 /* It would be nice if people remember that not all the world's an i386 267 276 when they introduce new system calls */ 268 - asmlinkage long sys_sync_file_range2(int fd, unsigned int flags, 269 - loff_t offset, loff_t nbytes) 277 + SYSCALL_DEFINE(sync_file_range2)(int fd, unsigned int flags, 278 + loff_t offset, loff_t nbytes) 270 279 { 271 280 return sys_sync_file_range(fd, offset, nbytes, flags); 272 281 } 282 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 283 + asmlinkage long SyS_sync_file_range2(long fd, long flags, 284 + loff_t offset, loff_t nbytes) 285 + { 286 + return SYSC_sync_file_range2((int) fd, (unsigned int) flags, 287 + offset, nbytes); 288 + } 289 + SYSCALL_ALIAS(sys_sync_file_range2, SyS_sync_file_range2); 290 + #endif 273 291 274 292 /* 275 293 * `endbyte' is inclusive
+5 -5
fs/timerfd.c
··· 177 177 return file; 178 178 } 179 179 180 - asmlinkage long sys_timerfd_create(int clockid, int flags) 180 + SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags) 181 181 { 182 182 int ufd; 183 183 struct timerfd_ctx *ctx; ··· 208 208 return ufd; 209 209 } 210 210 211 - asmlinkage long sys_timerfd_settime(int ufd, int flags, 212 - const struct itimerspec __user *utmr, 213 - struct itimerspec __user *otmr) 211 + SYSCALL_DEFINE4(timerfd_settime, int, ufd, int, flags, 212 + const struct itimerspec __user *, utmr, 213 + struct itimerspec __user *, otmr) 214 214 { 215 215 struct file *file; 216 216 struct timerfd_ctx *ctx; ··· 265 265 return 0; 266 266 } 267 267 268 - asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr) 268 + SYSCALL_DEFINE2(timerfd_gettime, int, ufd, struct itimerspec __user *, otmr) 269 269 { 270 270 struct file *file; 271 271 struct timerfd_ctx *ctx;
+7 -4
fs/utimes.c
··· 24 24 * must be owner or have write permission. 25 25 * Else, update from *times, must be owner or super user. 26 26 */ 27 - asmlinkage long sys_utime(char __user *filename, struct utimbuf __user *times) 27 + SYSCALL_DEFINE2(utime, char __user *, filename, struct utimbuf __user *, times) 28 28 { 29 29 struct timespec tv[2]; 30 30 ··· 170 170 return error; 171 171 } 172 172 173 - asmlinkage long sys_utimensat(int dfd, char __user *filename, struct timespec __user *utimes, int flags) 173 + SYSCALL_DEFINE4(utimensat, int, dfd, char __user *, filename, 174 + struct timespec __user *, utimes, int, flags) 174 175 { 175 176 struct timespec tstimes[2]; 176 177 ··· 188 187 return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags); 189 188 } 190 189 191 - asmlinkage long sys_futimesat(int dfd, char __user *filename, struct timeval __user *utimes) 190 + SYSCALL_DEFINE3(futimesat, int, dfd, char __user *, filename, 191 + struct timeval __user *, utimes) 192 192 { 193 193 struct timeval times[2]; 194 194 struct timespec tstimes[2]; ··· 216 214 return do_utimes(dfd, filename, utimes ? tstimes : NULL, 0); 217 215 } 218 216 219 - asmlinkage long sys_utimes(char __user *filename, struct timeval __user *utimes) 217 + SYSCALL_DEFINE2(utimes, char __user *, filename, 218 + struct timeval __user *, utimes) 220 219 { 221 220 return sys_futimesat(AT_FDCWD, filename, utimes); 222 221 }
+24 -29
fs/xattr.c
··· 251 251 return error; 252 252 } 253 253 254 - asmlinkage long 255 - sys_setxattr(const char __user *pathname, const char __user *name, 256 - const void __user *value, size_t size, int flags) 254 + SYSCALL_DEFINE5(setxattr, const char __user *, pathname, 255 + const char __user *, name, const void __user *, value, 256 + size_t, size, int, flags) 257 257 { 258 258 struct path path; 259 259 int error; ··· 270 270 return error; 271 271 } 272 272 273 - asmlinkage long 274 - sys_lsetxattr(const char __user *pathname, const char __user *name, 275 - const void __user *value, size_t size, int flags) 273 + SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname, 274 + const char __user *, name, const void __user *, value, 275 + size_t, size, int, flags) 276 276 { 277 277 struct path path; 278 278 int error; ··· 289 289 return error; 290 290 } 291 291 292 - asmlinkage long 293 - sys_fsetxattr(int fd, const char __user *name, const void __user *value, 294 - size_t size, int flags) 292 + SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name, 293 + const void __user *,value, size_t, size, int, flags) 295 294 { 296 295 struct file *f; 297 296 struct dentry *dentry; ··· 348 349 return error; 349 350 } 350 351 351 - asmlinkage ssize_t 352 - sys_getxattr(const char __user *pathname, const char __user *name, 353 - void __user *value, size_t size) 352 + SYSCALL_DEFINE4(getxattr, const char __user *, pathname, 353 + const char __user *, name, void __user *, value, size_t, size) 354 354 { 355 355 struct path path; 356 356 ssize_t error; ··· 362 364 return error; 363 365 } 364 366 365 - asmlinkage ssize_t 366 - sys_lgetxattr(const char __user *pathname, const char __user *name, void __user *value, 367 - size_t size) 367 + SYSCALL_DEFINE4(lgetxattr, const char __user *, pathname, 368 + const char __user *, name, void __user *, value, size_t, size) 368 369 { 369 370 struct path path; 370 371 ssize_t error; ··· 376 379 return error; 377 380 } 378 381 379 - asmlinkage ssize_t 380 - sys_fgetxattr(int fd, const char __user *name, void __user *value, size_t size) 382 + SYSCALL_DEFINE4(fgetxattr, int, fd, const char __user *, name, 383 + void __user *, value, size_t, size) 381 384 { 382 385 struct file *f; 383 386 ssize_t error = -EBADF; ··· 421 424 return error; 422 425 } 423 426 424 - asmlinkage ssize_t 425 - sys_listxattr(const char __user *pathname, char __user *list, size_t size) 427 + SYSCALL_DEFINE3(listxattr, const char __user *, pathname, char __user *, list, 428 + size_t, size) 426 429 { 427 430 struct path path; 428 431 ssize_t error; ··· 435 438 return error; 436 439 } 437 440 438 - asmlinkage ssize_t 439 - sys_llistxattr(const char __user *pathname, char __user *list, size_t size) 441 + SYSCALL_DEFINE3(llistxattr, const char __user *, pathname, char __user *, list, 442 + size_t, size) 440 443 { 441 444 struct path path; 442 445 ssize_t error; ··· 449 452 return error; 450 453 } 451 454 452 - asmlinkage ssize_t 453 - sys_flistxattr(int fd, char __user *list, size_t size) 455 + SYSCALL_DEFINE3(flistxattr, int, fd, char __user *, list, size_t, size) 454 456 { 455 457 struct file *f; 456 458 ssize_t error = -EBADF; ··· 481 485 return vfs_removexattr(d, kname); 482 486 } 483 487 484 - asmlinkage long 485 - sys_removexattr(const char __user *pathname, const char __user *name) 488 + SYSCALL_DEFINE2(removexattr, const char __user *, pathname, 489 + const char __user *, name) 486 490 { 487 491 struct path path; 488 492 int error; ··· 499 503 return error; 500 504 } 501 505 502 - asmlinkage long 503 - sys_lremovexattr(const char __user *pathname, const char __user *name) 506 + SYSCALL_DEFINE2(lremovexattr, const char __user *, pathname, 507 + const char __user *, name) 504 508 { 505 509 struct path path; 506 510 int error; ··· 517 521 return error; 518 522 } 519 523 520 - asmlinkage long 521 - sys_fremovexattr(int fd, const char __user *name) 524 + SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name) 522 525 { 523 526 struct file *f; 524 527 struct dentry *dentry;
+13
include/linux/compat.h
··· 280 280 asmlinkage long compat_sys_timerfd_gettime(int ufd, 281 281 struct compat_itimerspec __user *otmr); 282 282 283 + asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, 284 + __u32 __user *pages, 285 + const int __user *nodes, 286 + int __user *status, 287 + int flags); 288 + asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, 289 + struct compat_timeval __user *t); 290 + asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, 291 + struct compat_stat __user *statbuf, 292 + int flag); 293 + asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, 294 + int flags, int mode); 295 + 283 296 #endif /* CONFIG_COMPAT */ 284 297 #endif /* _LINUX_COMPAT_H */
+117 -52
include/linux/syscalls.h
··· 54 54 struct compat_timeval; 55 55 struct robust_list_head; 56 56 struct getcpu_cache; 57 + struct old_linux_dirent; 57 58 58 59 #include <linux/types.h> 59 60 #include <linux/aio_abi.h> ··· 65 64 #include <asm/signal.h> 66 65 #include <linux/quota.h> 67 66 #include <linux/key.h> 67 + 68 + #define __SC_DECL1(t1, a1) t1 a1 69 + #define __SC_DECL2(t2, a2, ...) t2 a2, __SC_DECL1(__VA_ARGS__) 70 + #define __SC_DECL3(t3, a3, ...) t3 a3, __SC_DECL2(__VA_ARGS__) 71 + #define __SC_DECL4(t4, a4, ...) t4 a4, __SC_DECL3(__VA_ARGS__) 72 + #define __SC_DECL5(t5, a5, ...) t5 a5, __SC_DECL4(__VA_ARGS__) 73 + #define __SC_DECL6(t6, a6, ...) t6 a6, __SC_DECL5(__VA_ARGS__) 74 + 75 + #define __SC_LONG1(t1, a1) long a1 76 + #define __SC_LONG2(t2, a2, ...) long a2, __SC_LONG1(__VA_ARGS__) 77 + #define __SC_LONG3(t3, a3, ...) long a3, __SC_LONG2(__VA_ARGS__) 78 + #define __SC_LONG4(t4, a4, ...) long a4, __SC_LONG3(__VA_ARGS__) 79 + #define __SC_LONG5(t5, a5, ...) long a5, __SC_LONG4(__VA_ARGS__) 80 + #define __SC_LONG6(t6, a6, ...) long a6, __SC_LONG5(__VA_ARGS__) 81 + 82 + #define __SC_CAST1(t1, a1) (t1) a1 83 + #define __SC_CAST2(t2, a2, ...) (t2) a2, __SC_CAST1(__VA_ARGS__) 84 + #define __SC_CAST3(t3, a3, ...) (t3) a3, __SC_CAST2(__VA_ARGS__) 85 + #define __SC_CAST4(t4, a4, ...) (t4) a4, __SC_CAST3(__VA_ARGS__) 86 + #define __SC_CAST5(t5, a5, ...) (t5) a5, __SC_CAST4(__VA_ARGS__) 87 + #define __SC_CAST6(t6, a6, ...) (t6) a6, __SC_CAST5(__VA_ARGS__) 88 + 89 + #define __SC_TEST(type) BUILD_BUG_ON(sizeof(type) > sizeof(long)) 90 + #define __SC_TEST1(t1, a1) __SC_TEST(t1) 91 + #define __SC_TEST2(t2, a2, ...) __SC_TEST(t2); __SC_TEST1(__VA_ARGS__) 92 + #define __SC_TEST3(t3, a3, ...) __SC_TEST(t3); __SC_TEST2(__VA_ARGS__) 93 + #define __SC_TEST4(t4, a4, ...) __SC_TEST(t4); __SC_TEST3(__VA_ARGS__) 94 + #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) 95 + #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) 96 + 97 + #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) 98 + #define SYSCALL_DEFINE1(...) SYSCALL_DEFINEx(1, __VA_ARGS__) 99 + #define SYSCALL_DEFINE2(...) SYSCALL_DEFINEx(2, __VA_ARGS__) 100 + #define SYSCALL_DEFINE3(...) SYSCALL_DEFINEx(3, __VA_ARGS__) 101 + #define SYSCALL_DEFINE4(...) SYSCALL_DEFINEx(4, __VA_ARGS__) 102 + #define SYSCALL_DEFINE5(...) SYSCALL_DEFINEx(5, __VA_ARGS__) 103 + #define SYSCALL_DEFINE6(...) SYSCALL_DEFINEx(6, __VA_ARGS__) 104 + 105 + #ifdef CONFIG_PPC64 106 + #define SYSCALL_ALIAS(alias, name) \ 107 + asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \ 108 + "\t.globl ." #alias "\n\t.set ." #alias ", ." #name) 109 + #else 110 + #define SYSCALL_ALIAS(alias, name) \ 111 + asm ("\t.globl " #alias "\n\t.set " #alias ", " #name) 112 + #endif 113 + 114 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 115 + 116 + #define SYSCALL_DEFINE(name) static inline long SYSC_##name 117 + #define SYSCALL_DEFINEx(x, name, ...) \ 118 + asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)); \ 119 + static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)); \ 120 + asmlinkage long SyS_##name(__SC_LONG##x(__VA_ARGS__)) \ 121 + { \ 122 + __SC_TEST##x(__VA_ARGS__); \ 123 + return (long) SYSC_##name(__SC_CAST##x(__VA_ARGS__)); \ 124 + } \ 125 + SYSCALL_ALIAS(sys_##name, SyS_##name); \ 126 + static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)) 127 + 128 + #else /* CONFIG_HAVE_SYSCALL_WRAPPERS */ 129 + 130 + #define SYSCALL_DEFINE(name) asmlinkage long sys_##name 131 + #define SYSCALL_DEFINEx(x, name, ...) \ 132 + asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)) 133 + 134 + #endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */ 68 135 69 136 asmlinkage long sys_time(time_t __user *tloc); 70 137 asmlinkage long sys_stime(time_t __user *tptr); ··· 146 77 147 78 asmlinkage long sys_gettid(void); 148 79 asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp); 149 - asmlinkage unsigned long sys_alarm(unsigned int seconds); 80 + asmlinkage long sys_alarm(unsigned int seconds); 150 81 asmlinkage long sys_getpid(void); 151 82 asmlinkage long sys_getppid(void); 152 83 asmlinkage long sys_getuid(void); ··· 235 166 unsigned long flags); 236 167 237 168 asmlinkage long sys_exit(int error_code); 238 - asmlinkage void sys_exit_group(int error_code); 169 + asmlinkage long sys_exit_group(int error_code); 239 170 asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr, 240 171 int options, struct rusage __user *ru); 241 172 asmlinkage long sys_waitid(int which, pid_t pid, ··· 265 196 asmlinkage long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo); 266 197 asmlinkage long sys_sgetmask(void); 267 198 asmlinkage long sys_ssetmask(int newmask); 268 - asmlinkage unsigned long sys_signal(int sig, __sighandler_t handler); 199 + asmlinkage long sys_signal(int sig, __sighandler_t handler); 269 200 asmlinkage long sys_pause(void); 270 201 271 202 asmlinkage long sys_sync(void); ··· 315 246 const void __user *value, size_t size, int flags); 316 247 asmlinkage long sys_fsetxattr(int fd, const char __user *name, 317 248 const void __user *value, size_t size, int flags); 318 - asmlinkage ssize_t sys_getxattr(const char __user *path, const char __user *name, 319 - void __user *value, size_t size); 320 - asmlinkage ssize_t sys_lgetxattr(const char __user *path, const char __user *name, 321 - void __user *value, size_t size); 322 - asmlinkage ssize_t sys_fgetxattr(int fd, const char __user *name, 323 - void __user *value, size_t size); 324 - asmlinkage ssize_t sys_listxattr(const char __user *path, char __user *list, 325 - size_t size); 326 - asmlinkage ssize_t sys_llistxattr(const char __user *path, char __user *list, 327 - size_t size); 328 - asmlinkage ssize_t sys_flistxattr(int fd, char __user *list, size_t size); 249 + asmlinkage long sys_getxattr(const char __user *path, const char __user *name, 250 + void __user *value, size_t size); 251 + asmlinkage long sys_lgetxattr(const char __user *path, const char __user *name, 252 + void __user *value, size_t size); 253 + asmlinkage long sys_fgetxattr(int fd, const char __user *name, 254 + void __user *value, size_t size); 255 + asmlinkage long sys_listxattr(const char __user *path, char __user *list, 256 + size_t size); 257 + asmlinkage long sys_llistxattr(const char __user *path, char __user *list, 258 + size_t size); 259 + asmlinkage long sys_flistxattr(int fd, char __user *list, size_t size); 329 260 asmlinkage long sys_removexattr(const char __user *path, 330 261 const char __user *name); 331 262 asmlinkage long sys_lremovexattr(const char __user *path, 332 263 const char __user *name); 333 264 asmlinkage long sys_fremovexattr(int fd, const char __user *name); 334 265 335 - asmlinkage unsigned long sys_brk(unsigned long brk); 266 + asmlinkage long sys_brk(unsigned long brk); 336 267 asmlinkage long sys_mprotect(unsigned long start, size_t len, 337 268 unsigned long prot); 338 - asmlinkage unsigned long sys_mremap(unsigned long addr, 339 - unsigned long old_len, unsigned long new_len, 340 - unsigned long flags, unsigned long new_addr); 269 + asmlinkage long sys_mremap(unsigned long addr, 270 + unsigned long old_len, unsigned long new_len, 271 + unsigned long flags, unsigned long new_addr); 341 272 asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, 342 273 unsigned long prot, unsigned long pgoff, 343 274 unsigned long flags); ··· 390 321 struct iocb __user * __user *); 391 322 asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, 392 323 struct io_event __user *result); 393 - asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, 394 - off_t __user *offset, size_t count); 395 - asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, 396 - loff_t __user *offset, size_t count); 324 + asmlinkage long sys_sendfile(int out_fd, int in_fd, 325 + off_t __user *offset, size_t count); 326 + asmlinkage long sys_sendfile64(int out_fd, int in_fd, 327 + loff_t __user *offset, size_t count); 397 328 asmlinkage long sys_readlink(const char __user *path, 398 329 char __user *buf, int bufsiz); 399 330 asmlinkage long sys_creat(const char __user *pathname, int mode); ··· 437 368 struct utimbuf __user *times); 438 369 asmlinkage long sys_utimes(char __user *filename, 439 370 struct timeval __user *utimes); 440 - asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, 441 - unsigned int origin); 371 + asmlinkage long sys_lseek(unsigned int fd, off_t offset, 372 + unsigned int origin); 442 373 asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, 443 374 unsigned long offset_low, loff_t __user *result, 444 375 unsigned int origin); 445 - asmlinkage ssize_t sys_read(unsigned int fd, char __user *buf, 446 - size_t count); 447 - asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count); 448 - asmlinkage ssize_t sys_readv(unsigned long fd, 449 - const struct iovec __user *vec, 450 - unsigned long vlen); 451 - asmlinkage ssize_t sys_write(unsigned int fd, const char __user *buf, 452 - size_t count); 453 - asmlinkage ssize_t sys_writev(unsigned long fd, 454 - const struct iovec __user *vec, 455 - unsigned long vlen); 456 - asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf, 457 - size_t count, loff_t pos); 458 - asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf, 459 - size_t count, loff_t pos); 376 + asmlinkage long sys_read(unsigned int fd, char __user *buf, size_t count); 377 + asmlinkage long sys_readahead(int fd, loff_t offset, size_t count); 378 + asmlinkage long sys_readv(unsigned long fd, 379 + const struct iovec __user *vec, 380 + unsigned long vlen); 381 + asmlinkage long sys_write(unsigned int fd, const char __user *buf, 382 + size_t count); 383 + asmlinkage long sys_writev(unsigned long fd, 384 + const struct iovec __user *vec, 385 + unsigned long vlen); 386 + asmlinkage long sys_pread64(unsigned int fd, char __user *buf, 387 + size_t count, loff_t pos); 388 + asmlinkage long sys_pwrite64(unsigned int fd, const char __user *buf, 389 + size_t count, loff_t pos); 460 390 asmlinkage long sys_getcwd(char __user *buf, unsigned long size); 461 391 asmlinkage long sys_mkdir(const char __user *pathname, int mode); 462 392 asmlinkage long sys_chdir(const char __user *filename); ··· 544 476 asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); 545 477 asmlinkage long sys_mq_unlink(const char __user *name); 546 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); 547 - 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); 479 + 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); 548 480 asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification); 549 481 asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat); 550 482 ··· 598 530 const int __user *nodes, 599 531 int __user *status, 600 532 int flags); 601 - asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, 602 - __u32 __user *pages, 603 - const int __user *nodes, 604 - int __user *status, 605 - int flags); 606 533 asmlinkage long sys_mbind(unsigned long start, unsigned long len, 607 534 unsigned long mode, 608 535 unsigned long __user *nmask, ··· 646 583 int bufsiz); 647 584 asmlinkage long sys_utimensat(int dfd, char __user *filename, 648 585 struct timespec __user *utimes, int flags); 649 - asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, 650 - struct compat_timeval __user *t); 651 - asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, 652 - struct compat_stat __user *statbuf, 653 - int flag); 654 - asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, 655 - int flags, int mode); 656 586 asmlinkage long sys_unshare(unsigned long unshare_flags); 657 587 658 588 asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, ··· 677 621 asmlinkage long sys_eventfd(unsigned int count); 678 622 asmlinkage long sys_eventfd2(unsigned int count, int flags); 679 623 asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); 624 + asmlinkage long sys_old_readdir(unsigned int, struct old_linux_dirent __user *, unsigned int); 625 + asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *, 626 + fd_set __user *, struct timespec __user *, 627 + void __user *); 628 + asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, 629 + struct timespec __user *, const sigset_t __user *, 630 + size_t); 631 + asmlinkage long sys_pipe2(int __user *, int); 632 + asmlinkage long sys_pipe(int __user *); 680 633 681 634 int kernel_execve(const char *filename, char *const argv[], char *const envp[]); 682 635
+14 -14
ipc/mqueue.c
··· 650 650 return dentry_open(dentry, mqueue_mnt, oflag, cred); 651 651 } 652 652 653 - asmlinkage long sys_mq_open(const char __user *u_name, int oflag, mode_t mode, 654 - struct mq_attr __user *u_attr) 653 + SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, mode_t, mode, 654 + struct mq_attr __user *, u_attr) 655 655 { 656 656 struct dentry *dentry; 657 657 struct file *filp; ··· 721 721 return fd; 722 722 } 723 723 724 - asmlinkage long sys_mq_unlink(const char __user *u_name) 724 + SYSCALL_DEFINE1(mq_unlink, const char __user *, u_name) 725 725 { 726 726 int err; 727 727 char *name; ··· 814 814 sender->state = STATE_READY; 815 815 } 816 816 817 - asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr, 818 - size_t msg_len, unsigned int msg_prio, 819 - const struct timespec __user *u_abs_timeout) 817 + SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr, 818 + size_t, msg_len, unsigned int, msg_prio, 819 + const struct timespec __user *, u_abs_timeout) 820 820 { 821 821 struct file *filp; 822 822 struct inode *inode; ··· 907 907 return ret; 908 908 } 909 909 910 - asmlinkage ssize_t sys_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, 911 - size_t msg_len, unsigned int __user *u_msg_prio, 912 - const struct timespec __user *u_abs_timeout) 910 + SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr, 911 + size_t, msg_len, unsigned int __user *, u_msg_prio, 912 + const struct timespec __user *, u_abs_timeout) 913 913 { 914 914 long timeout; 915 915 ssize_t ret; ··· 997 997 * and he isn't currently owner of notification, will be silently discarded. 998 998 * It isn't explicitly defined in the POSIX. 999 999 */ 1000 - asmlinkage long sys_mq_notify(mqd_t mqdes, 1001 - const struct sigevent __user *u_notification) 1000 + SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes, 1001 + const struct sigevent __user *, u_notification) 1002 1002 { 1003 1003 int ret; 1004 1004 struct file *filp; ··· 1123 1123 return ret; 1124 1124 } 1125 1125 1126 - asmlinkage long sys_mq_getsetattr(mqd_t mqdes, 1127 - const struct mq_attr __user *u_mqstat, 1128 - struct mq_attr __user *u_omqstat) 1126 + SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes, 1127 + const struct mq_attr __user *, u_mqstat, 1128 + struct mq_attr __user *, u_omqstat) 1129 1129 { 1130 1130 int ret; 1131 1131 struct mq_attr mqstat, omqstat;
+6 -6
ipc/msg.c
··· 309 309 return security_msg_queue_associate(msq, msgflg); 310 310 } 311 311 312 - asmlinkage long sys_msgget(key_t key, int msgflg) 312 + SYSCALL_DEFINE2(msgget, key_t, key, int, msgflg) 313 313 { 314 314 struct ipc_namespace *ns; 315 315 struct ipc_ops msg_ops; ··· 466 466 return err; 467 467 } 468 468 469 - asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf) 469 + SYSCALL_DEFINE3(msgctl, int, msqid, int, cmd, struct msqid_ds __user *, buf) 470 470 { 471 471 struct msg_queue *msq; 472 472 int err, version; ··· 723 723 return err; 724 724 } 725 725 726 - asmlinkage long 727 - sys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz, int msgflg) 726 + SYSCALL_DEFINE4(msgsnd, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz, 727 + int, msgflg) 728 728 { 729 729 long mtype; 730 730 ··· 904 904 return msgsz; 905 905 } 906 906 907 - asmlinkage long sys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz, 908 - long msgtyp, int msgflg) 907 + SYSCALL_DEFINE5(msgrcv, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz, 908 + long, msgtyp, int, msgflg) 909 909 { 910 910 long err, mtype; 911 911
+13 -5
ipc/sem.c
··· 308 308 return 0; 309 309 } 310 310 311 - asmlinkage long sys_semget(key_t key, int nsems, int semflg) 311 + SYSCALL_DEFINE3(semget, key_t, key, int, nsems, int, semflg) 312 312 { 313 313 struct ipc_namespace *ns; 314 314 struct ipc_ops sem_ops; ··· 887 887 return err; 888 888 } 889 889 890 - asmlinkage long sys_semctl (int semid, int semnum, int cmd, union semun arg) 890 + SYSCALL_DEFINE(semctl)(int semid, int semnum, int cmd, union semun arg) 891 891 { 892 892 int err = -EINVAL; 893 893 int version; ··· 923 923 return -EINVAL; 924 924 } 925 925 } 926 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 927 + asmlinkage long SyS_semctl(int semid, int semnum, int cmd, union semun arg) 928 + { 929 + return SYSC_semctl((int) semid, (int) semnum, (int) cmd, arg); 930 + } 931 + SYSCALL_ALIAS(sys_semctl, SyS_semctl); 932 + #endif 926 933 927 934 /* If the task doesn't already have a undo_list, then allocate one 928 935 * here. We guarantee there is only one thread using this undo list, ··· 1055 1048 return un; 1056 1049 } 1057 1050 1058 - asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops, 1059 - unsigned nsops, const struct timespec __user *timeout) 1051 + SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, 1052 + unsigned, nsops, const struct timespec __user *, timeout) 1060 1053 { 1061 1054 int error = -EINVAL; 1062 1055 struct sem_array *sma; ··· 1232 1225 return error; 1233 1226 } 1234 1227 1235 - asmlinkage long sys_semop (int semid, struct sembuf __user *tsops, unsigned nsops) 1228 + SYSCALL_DEFINE3(semop, int, semid, struct sembuf __user *, tsops, 1229 + unsigned, nsops) 1236 1230 { 1237 1231 return sys_semtimedop(semid, tsops, nsops, NULL); 1238 1232 }
+4 -4
ipc/shm.c
··· 440 440 return 0; 441 441 } 442 442 443 - asmlinkage long sys_shmget (key_t key, size_t size, int shmflg) 443 + SYSCALL_DEFINE3(shmget, key_t, key, size_t, size, int, shmflg) 444 444 { 445 445 struct ipc_namespace *ns; 446 446 struct ipc_ops shm_ops; ··· 621 621 return err; 622 622 } 623 623 624 - asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf) 624 + SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) 625 625 { 626 626 struct shmid_kernel *shp; 627 627 int err, version; ··· 939 939 goto out_nattch; 940 940 } 941 941 942 - asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg) 942 + SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg) 943 943 { 944 944 unsigned long ret; 945 945 long err; ··· 955 955 * detach and kill segment if marked destroyed. 956 956 * The work is done in shm_close. 957 957 */ 958 - asmlinkage long sys_shmdt(char __user *shmaddr) 958 + SYSCALL_DEFINE1(shmdt, char __user *, shmaddr) 959 959 { 960 960 struct mm_struct *mm = current->mm; 961 961 struct vm_area_struct *vma, *next;
+1 -1
kernel/acct.c
··· 277 277 * should be written. If the filename is NULL, accounting will be 278 278 * shutdown. 279 279 */ 280 - asmlinkage long sys_acct(const char __user *name) 280 + SYSCALL_DEFINE1(acct, const char __user *, name) 281 281 { 282 282 int error; 283 283
+2 -2
kernel/capability.c
··· 161 161 * 162 162 * Returns 0 on success and < 0 on error. 163 163 */ 164 - asmlinkage long sys_capget(cap_user_header_t header, cap_user_data_t dataptr) 164 + SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr) 165 165 { 166 166 int ret = 0; 167 167 pid_t pid; ··· 235 235 * 236 236 * Returns 0 on success and < 0 on error. 237 237 */ 238 - asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data) 238 + SYSCALL_DEFINE2(capset, cap_user_header_t, header, const cap_user_data_t, data) 239 239 { 240 240 struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S]; 241 241 unsigned i, tocopy;
+1 -2
kernel/exec_domain.c
··· 209 209 module_init(proc_execdomains_init); 210 210 #endif 211 211 212 - asmlinkage long 213 - sys_personality(u_long personality) 212 + SYSCALL_DEFINE1(personality, u_long, personality) 214 213 { 215 214 u_long old = current->personality; 216 215
+9 -8
kernel/exit.c
··· 1141 1141 1142 1142 EXPORT_SYMBOL(complete_and_exit); 1143 1143 1144 - asmlinkage long sys_exit(int error_code) 1144 + SYSCALL_DEFINE1(exit, int, error_code) 1145 1145 { 1146 1146 do_exit((error_code&0xff)<<8); 1147 1147 } ··· 1182 1182 * wait4()-ing process will get the correct exit code - even if this 1183 1183 * thread is not the thread group leader. 1184 1184 */ 1185 - asmlinkage void sys_exit_group(int error_code) 1185 + SYSCALL_DEFINE1(exit_group, int, error_code) 1186 1186 { 1187 1187 do_group_exit((error_code & 0xff) << 8); 1188 + /* NOTREACHED */ 1189 + return 0; 1188 1190 } 1189 1191 1190 1192 static struct pid *task_pid_type(struct task_struct *task, enum pid_type type) ··· 1754 1752 return retval; 1755 1753 } 1756 1754 1757 - asmlinkage long sys_waitid(int which, pid_t upid, 1758 - struct siginfo __user *infop, int options, 1759 - struct rusage __user *ru) 1755 + SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *, 1756 + infop, int, options, struct rusage __user *, ru) 1760 1757 { 1761 1758 struct pid *pid = NULL; 1762 1759 enum pid_type type; ··· 1794 1793 return ret; 1795 1794 } 1796 1795 1797 - asmlinkage long sys_wait4(pid_t upid, int __user *stat_addr, 1798 - int options, struct rusage __user *ru) 1796 + SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr, 1797 + int, options, struct rusage __user *, ru) 1799 1798 { 1800 1799 struct pid *pid = NULL; 1801 1800 enum pid_type type; ··· 1832 1831 * sys_waitpid() remains for compatibility. waitpid() should be 1833 1832 * implemented by calling sys_wait4() from libc.a. 1834 1833 */ 1835 - asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options) 1834 + SYSCALL_DEFINE3(waitpid, pid_t, pid, int __user *, stat_addr, int, options) 1836 1835 { 1837 1836 return sys_wait4(pid, stat_addr, options, NULL); 1838 1837 }
+2 -2
kernel/fork.c
··· 901 901 clear_freeze_flag(p); 902 902 } 903 903 904 - asmlinkage long sys_set_tid_address(int __user *tidptr) 904 + SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr) 905 905 { 906 906 current->clear_child_tid = tidptr; 907 907 ··· 1603 1603 * constructed. Here we are modifying the current, active, 1604 1604 * task_struct. 1605 1605 */ 1606 - asmlinkage long sys_unshare(unsigned long unshare_flags) 1606 + SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) 1607 1607 { 1608 1608 int err = 0; 1609 1609 struct fs_struct *fs, *new_fs = NULL;
+8 -9
kernel/futex.c
··· 1733 1733 * @head: pointer to the list-head 1734 1734 * @len: length of the list-head, as userspace expects 1735 1735 */ 1736 - asmlinkage long 1737 - sys_set_robust_list(struct robust_list_head __user *head, 1738 - size_t len) 1736 + SYSCALL_DEFINE2(set_robust_list, struct robust_list_head __user *, head, 1737 + size_t, len) 1739 1738 { 1740 1739 if (!futex_cmpxchg_enabled) 1741 1740 return -ENOSYS; ··· 1755 1756 * @head_ptr: pointer to a list-head pointer, the kernel fills it in 1756 1757 * @len_ptr: pointer to a length field, the kernel fills in the header size 1757 1758 */ 1758 - asmlinkage long 1759 - sys_get_robust_list(int pid, struct robust_list_head __user * __user *head_ptr, 1760 - size_t __user *len_ptr) 1759 + SYSCALL_DEFINE3(get_robust_list, int, pid, 1760 + struct robust_list_head __user * __user *, head_ptr, 1761 + size_t __user *, len_ptr) 1761 1762 { 1762 1763 struct robust_list_head __user *head; 1763 1764 unsigned long ret; ··· 1977 1978 } 1978 1979 1979 1980 1980 - asmlinkage long sys_futex(u32 __user *uaddr, int op, u32 val, 1981 - struct timespec __user *utime, u32 __user *uaddr2, 1982 - u32 val3) 1981 + SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val, 1982 + struct timespec __user *, utime, u32 __user *, uaddr2, 1983 + u32, val3) 1983 1984 { 1984 1985 struct timespec ts; 1985 1986 ktime_t t, *tp = NULL;
+2 -2
kernel/hrtimer.c
··· 1467 1467 return ret; 1468 1468 } 1469 1469 1470 - asmlinkage long 1471 - sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp) 1470 + SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp, 1471 + struct timespec __user *, rmtp) 1472 1472 { 1473 1473 struct timespec tu; 1474 1474
+3 -4
kernel/itimer.c
··· 100 100 return 0; 101 101 } 102 102 103 - asmlinkage long sys_getitimer(int which, struct itimerval __user *value) 103 + SYSCALL_DEFINE2(getitimer, int, which, struct itimerval __user *, value) 104 104 { 105 105 int error = -EFAULT; 106 106 struct itimerval get_buffer; ··· 260 260 return it_old.it_value.tv_sec; 261 261 } 262 262 263 - asmlinkage long sys_setitimer(int which, 264 - struct itimerval __user *value, 265 - struct itimerval __user *ovalue) 263 + SYSCALL_DEFINE3(setitimer, int, which, struct itimerval __user *, value, 264 + struct itimerval __user *, ovalue) 266 265 { 267 266 struct itimerval set_buffer, get_buffer; 268 267 int error;
+2 -3
kernel/kexec.c
··· 934 934 935 935 static DEFINE_MUTEX(kexec_mutex); 936 936 937 - asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments, 938 - struct kexec_segment __user *segments, 939 - unsigned long flags) 937 + SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments, 938 + struct kexec_segment __user *, segments, unsigned long, flags) 940 939 { 941 940 struct kimage **dest_image, *image; 942 941 int result;
+4 -6
kernel/module.c
··· 743 743 mutex_lock(&module_mutex); 744 744 } 745 745 746 - asmlinkage long 747 - sys_delete_module(const char __user *name_user, unsigned int flags) 746 + SYSCALL_DEFINE2(delete_module, const char __user *, name_user, 747 + unsigned int, flags) 748 748 { 749 749 struct module *mod; 750 750 char name[MODULE_NAME_LEN]; ··· 2296 2296 } 2297 2297 2298 2298 /* This is where the real work happens */ 2299 - asmlinkage long 2300 - sys_init_module(void __user *umod, 2301 - unsigned long len, 2302 - const char __user *uargs) 2299 + SYSCALL_DEFINE3(init_module, void __user *, umod, 2300 + unsigned long, len, const char __user *, uargs) 2303 2301 { 2304 2302 struct module *mod; 2305 2303 int ret = 0;
+19 -24
kernel/posix-timers.c
··· 477 477 478 478 /* Create a POSIX.1b interval timer. */ 479 479 480 - asmlinkage long 481 - sys_timer_create(const clockid_t which_clock, 482 - struct sigevent __user *timer_event_spec, 483 - timer_t __user * created_timer_id) 480 + SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock, 481 + struct sigevent __user *, timer_event_spec, 482 + timer_t __user *, created_timer_id) 484 483 { 485 484 struct k_itimer *new_timer; 486 485 int error, new_timer_id; ··· 660 661 } 661 662 662 663 /* Get the time remaining on a POSIX.1b interval timer. */ 663 - asmlinkage long 664 - sys_timer_gettime(timer_t timer_id, struct itimerspec __user *setting) 664 + SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, 665 + struct itimerspec __user *, setting) 665 666 { 666 667 struct k_itimer *timr; 667 668 struct itimerspec cur_setting; ··· 690 691 * the call back to do_schedule_next_timer(). So all we need to do is 691 692 * to pick up the frozen overrun. 692 693 */ 693 - asmlinkage long 694 - sys_timer_getoverrun(timer_t timer_id) 694 + SYSCALL_DEFINE1(timer_getoverrun, timer_t, timer_id) 695 695 { 696 696 struct k_itimer *timr; 697 697 int overrun; ··· 758 760 } 759 761 760 762 /* Set a POSIX.1b interval timer */ 761 - asmlinkage long 762 - sys_timer_settime(timer_t timer_id, int flags, 763 - const struct itimerspec __user *new_setting, 764 - struct itimerspec __user *old_setting) 763 + SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags, 764 + const struct itimerspec __user *, new_setting, 765 + struct itimerspec __user *, old_setting) 765 766 { 766 767 struct k_itimer *timr; 767 768 struct itimerspec new_spec, old_spec; ··· 813 816 } 814 817 815 818 /* Delete a POSIX.1b interval timer. */ 816 - asmlinkage long 817 - sys_timer_delete(timer_t timer_id) 819 + SYSCALL_DEFINE1(timer_delete, timer_t, timer_id) 818 820 { 819 821 struct k_itimer *timer; 820 822 unsigned long flags; ··· 899 903 } 900 904 EXPORT_SYMBOL_GPL(do_posix_clock_nonanosleep); 901 905 902 - asmlinkage long sys_clock_settime(const clockid_t which_clock, 903 - const struct timespec __user *tp) 906 + SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, 907 + const struct timespec __user *, tp) 904 908 { 905 909 struct timespec new_tp; 906 910 ··· 912 916 return CLOCK_DISPATCH(which_clock, clock_set, (which_clock, &new_tp)); 913 917 } 914 918 915 - asmlinkage long 916 - sys_clock_gettime(const clockid_t which_clock, struct timespec __user *tp) 919 + SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock, 920 + struct timespec __user *,tp) 917 921 { 918 922 struct timespec kernel_tp; 919 923 int error; ··· 929 933 930 934 } 931 935 932 - asmlinkage long 933 - sys_clock_getres(const clockid_t which_clock, struct timespec __user *tp) 936 + SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, 937 + struct timespec __user *, tp) 934 938 { 935 939 struct timespec rtn_tp; 936 940 int error; ··· 959 963 which_clock); 960 964 } 961 965 962 - asmlinkage long 963 - sys_clock_nanosleep(const clockid_t which_clock, int flags, 964 - const struct timespec __user *rqtp, 965 - struct timespec __user *rmtp) 966 + SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags, 967 + const struct timespec __user *, rqtp, 968 + struct timespec __user *, rmtp) 966 969 { 967 970 struct timespec t; 968 971
+1 -6
kernel/printk.c
··· 382 382 return error; 383 383 } 384 384 385 - asmlinkage long sys_syslog(int type, char __user *buf, int len) 385 + SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) 386 386 { 387 387 return do_syslog(type, buf, len); 388 388 } ··· 741 741 EXPORT_SYMBOL(vprintk); 742 742 743 743 #else 744 - 745 - asmlinkage long sys_syslog(int type, char __user *buf, int len) 746 - { 747 - return -ENOSYS; 748 - } 749 744 750 745 static void call_console_drivers(unsigned start, unsigned end) 751 746 {
+1 -1
kernel/ptrace.c
··· 574 574 #define arch_ptrace_attach(child) do { } while (0) 575 575 #endif 576 576 577 - asmlinkage long sys_ptrace(long request, long pid, long addr, long data) 577 + SYSCALL_DEFINE4(ptrace, long, request, long, pid, long, addr, long, data) 578 578 { 579 579 struct task_struct *child; 580 580 long ret;
+15 -15
kernel/sched.c
··· 5126 5126 * sys_setpriority is a more generic, but much slower function that 5127 5127 * does similar things. 5128 5128 */ 5129 - asmlinkage long sys_nice(int increment) 5129 + SYSCALL_DEFINE1(nice, int, increment) 5130 5130 { 5131 5131 long nice, retval; 5132 5132 ··· 5433 5433 * @policy: new policy. 5434 5434 * @param: structure containing the new RT priority. 5435 5435 */ 5436 - asmlinkage long 5437 - sys_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param) 5436 + SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy, 5437 + struct sched_param __user *, param) 5438 5438 { 5439 5439 /* negative values for policy are not valid */ 5440 5440 if (policy < 0) ··· 5448 5448 * @pid: the pid in question. 5449 5449 * @param: structure containing the new RT priority. 5450 5450 */ 5451 - asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param __user *param) 5451 + SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param) 5452 5452 { 5453 5453 return do_sched_setscheduler(pid, -1, param); 5454 5454 } ··· 5457 5457 * sys_sched_getscheduler - get the policy (scheduling class) of a thread 5458 5458 * @pid: the pid in question. 5459 5459 */ 5460 - asmlinkage long sys_sched_getscheduler(pid_t pid) 5460 + SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid) 5461 5461 { 5462 5462 struct task_struct *p; 5463 5463 int retval; ··· 5482 5482 * @pid: the pid in question. 5483 5483 * @param: structure containing the RT priority. 5484 5484 */ 5485 - asmlinkage long sys_sched_getparam(pid_t pid, struct sched_param __user *param) 5485 + SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param) 5486 5486 { 5487 5487 struct sched_param lp; 5488 5488 struct task_struct *p; ··· 5600 5600 * @len: length in bytes of the bitmask pointed to by user_mask_ptr 5601 5601 * @user_mask_ptr: user-space pointer to the new cpu mask 5602 5602 */ 5603 - asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, 5604 - unsigned long __user *user_mask_ptr) 5603 + SYSCALL_DEFINE3(sched_setaffinity, pid_t, pid, unsigned int, len, 5604 + unsigned long __user *, user_mask_ptr) 5605 5605 { 5606 5606 cpumask_var_t new_mask; 5607 5607 int retval; ··· 5648 5648 * @len: length in bytes of the bitmask pointed to by user_mask_ptr 5649 5649 * @user_mask_ptr: user-space pointer to hold the current cpu mask 5650 5650 */ 5651 - asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, 5652 - unsigned long __user *user_mask_ptr) 5651 + SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len, 5652 + unsigned long __user *, user_mask_ptr) 5653 5653 { 5654 5654 int ret; 5655 5655 cpumask_var_t mask; ··· 5678 5678 * This function yields the current CPU to other tasks. If there are no 5679 5679 * other threads running on this CPU then this function will return. 5680 5680 */ 5681 - asmlinkage long sys_sched_yield(void) 5681 + SYSCALL_DEFINE0(sched_yield) 5682 5682 { 5683 5683 struct rq *rq = this_rq_lock(); 5684 5684 ··· 5819 5819 * this syscall returns the maximum rt_priority that can be used 5820 5820 * by a given scheduling class. 5821 5821 */ 5822 - asmlinkage long sys_sched_get_priority_max(int policy) 5822 + SYSCALL_DEFINE1(sched_get_priority_max, int, policy) 5823 5823 { 5824 5824 int ret = -EINVAL; 5825 5825 ··· 5844 5844 * this syscall returns the minimum rt_priority that can be used 5845 5845 * by a given scheduling class. 5846 5846 */ 5847 - asmlinkage long sys_sched_get_priority_min(int policy) 5847 + SYSCALL_DEFINE1(sched_get_priority_min, int, policy) 5848 5848 { 5849 5849 int ret = -EINVAL; 5850 5850 ··· 5869 5869 * this syscall writes the default timeslice value of a given process 5870 5870 * into the user-space timespec buffer. A value of '0' means infinity. 5871 5871 */ 5872 - asmlinkage 5873 - long sys_sched_rr_get_interval(pid_t pid, struct timespec __user *interval) 5872 + SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid, 5873 + struct timespec __user *, interval) 5874 5874 { 5875 5875 struct task_struct *p; 5876 5876 unsigned int time_slice;
+24 -35
kernel/signal.c
··· 1961 1961 * System call entry points. 1962 1962 */ 1963 1963 1964 - asmlinkage long sys_restart_syscall(void) 1964 + SYSCALL_DEFINE0(restart_syscall) 1965 1965 { 1966 1966 struct restart_block *restart = &current_thread_info()->restart_block; 1967 1967 return restart->fn(restart); ··· 2014 2014 return error; 2015 2015 } 2016 2016 2017 - asmlinkage long 2018 - sys_rt_sigprocmask(int how, sigset_t __user *set, sigset_t __user *oset, size_t sigsetsize) 2017 + SYSCALL_DEFINE4(rt_sigprocmask, int, how, sigset_t __user *, set, 2018 + sigset_t __user *, oset, size_t, sigsetsize) 2019 2019 { 2020 2020 int error = -EINVAL; 2021 2021 sigset_t old_set, new_set; ··· 2074 2074 return error; 2075 2075 } 2076 2076 2077 - asmlinkage long 2078 - sys_rt_sigpending(sigset_t __user *set, size_t sigsetsize) 2077 + SYSCALL_DEFINE2(rt_sigpending, sigset_t __user *, set, size_t, sigsetsize) 2079 2078 { 2080 2079 return do_sigpending(set, sigsetsize); 2081 2080 } ··· 2145 2146 2146 2147 #endif 2147 2148 2148 - asmlinkage long 2149 - sys_rt_sigtimedwait(const sigset_t __user *uthese, 2150 - siginfo_t __user *uinfo, 2151 - const struct timespec __user *uts, 2152 - size_t sigsetsize) 2149 + SYSCALL_DEFINE4(rt_sigtimedwait, const sigset_t __user *, uthese, 2150 + siginfo_t __user *, uinfo, const struct timespec __user *, uts, 2151 + size_t, sigsetsize) 2153 2152 { 2154 2153 int ret, sig; 2155 2154 sigset_t these; ··· 2220 2223 return ret; 2221 2224 } 2222 2225 2223 - asmlinkage long 2224 - sys_kill(pid_t pid, int sig) 2226 + SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) 2225 2227 { 2226 2228 struct siginfo info; 2227 2229 ··· 2279 2283 * exists but it's not belonging to the target process anymore. This 2280 2284 * method solves the problem of threads exiting and PIDs getting reused. 2281 2285 */ 2282 - asmlinkage long sys_tgkill(pid_t tgid, pid_t pid, int sig) 2286 + SYSCALL_DEFINE3(tgkill, pid_t, tgid, pid_t, pid, int, sig) 2283 2287 { 2284 2288 /* This is only valid for single tasks */ 2285 2289 if (pid <= 0 || tgid <= 0) ··· 2291 2295 /* 2292 2296 * Send a signal to only one task, even if it's a CLONE_THREAD task. 2293 2297 */ 2294 - asmlinkage long 2295 - sys_tkill(pid_t pid, int sig) 2298 + SYSCALL_DEFINE2(tkill, pid_t, pid, int, sig) 2296 2299 { 2297 2300 /* This is only valid for single tasks */ 2298 2301 if (pid <= 0) ··· 2300 2305 return do_tkill(0, pid, sig); 2301 2306 } 2302 2307 2303 - asmlinkage long 2304 - sys_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t __user *uinfo) 2308 + SYSCALL_DEFINE3(rt_sigqueueinfo, pid_t, pid, int, sig, 2309 + siginfo_t __user *, uinfo) 2305 2310 { 2306 2311 siginfo_t info; 2307 2312 ··· 2429 2434 2430 2435 #ifdef __ARCH_WANT_SYS_SIGPENDING 2431 2436 2432 - asmlinkage long 2433 - sys_sigpending(old_sigset_t __user *set) 2437 + SYSCALL_DEFINE1(sigpending, old_sigset_t __user *, set) 2434 2438 { 2435 2439 return do_sigpending(set, sizeof(*set)); 2436 2440 } ··· 2440 2446 /* Some platforms have their own version with special arguments others 2441 2447 support only sys_rt_sigprocmask. */ 2442 2448 2443 - asmlinkage long 2444 - sys_sigprocmask(int how, old_sigset_t __user *set, old_sigset_t __user *oset) 2449 + SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, set, 2450 + old_sigset_t __user *, oset) 2445 2451 { 2446 2452 int error; 2447 2453 old_sigset_t old_set, new_set; ··· 2491 2497 #endif /* __ARCH_WANT_SYS_SIGPROCMASK */ 2492 2498 2493 2499 #ifdef __ARCH_WANT_SYS_RT_SIGACTION 2494 - asmlinkage long 2495 - sys_rt_sigaction(int sig, 2496 - const struct sigaction __user *act, 2497 - struct sigaction __user *oact, 2498 - size_t sigsetsize) 2500 + SYSCALL_DEFINE4(rt_sigaction, int, sig, 2501 + const struct sigaction __user *, act, 2502 + struct sigaction __user *, oact, 2503 + size_t, sigsetsize) 2499 2504 { 2500 2505 struct k_sigaction new_sa, old_sa; 2501 2506 int ret = -EINVAL; ··· 2524 2531 /* 2525 2532 * For backwards compatibility. Functionality superseded by sigprocmask. 2526 2533 */ 2527 - asmlinkage long 2528 - sys_sgetmask(void) 2534 + SYSCALL_DEFINE0(sgetmask) 2529 2535 { 2530 2536 /* SMP safe */ 2531 2537 return current->blocked.sig[0]; 2532 2538 } 2533 2539 2534 - asmlinkage long 2535 - sys_ssetmask(int newmask) 2540 + SYSCALL_DEFINE1(ssetmask, int, newmask) 2536 2541 { 2537 2542 int old; 2538 2543 ··· 2550 2559 /* 2551 2560 * For backwards compatibility. Functionality superseded by sigaction. 2552 2561 */ 2553 - asmlinkage unsigned long 2554 - sys_signal(int sig, __sighandler_t handler) 2562 + SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler) 2555 2563 { 2556 2564 struct k_sigaction new_sa, old_sa; 2557 2565 int ret; ··· 2567 2577 2568 2578 #ifdef __ARCH_WANT_SYS_PAUSE 2569 2579 2570 - asmlinkage long 2571 - sys_pause(void) 2580 + SYSCALL_DEFINE0(pause) 2572 2581 { 2573 2582 current->state = TASK_INTERRUPTIBLE; 2574 2583 schedule(); ··· 2577 2588 #endif 2578 2589 2579 2590 #ifdef __ARCH_WANT_SYS_RT_SIGSUSPEND 2580 - asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize) 2591 + SYSCALL_DEFINE2(rt_sigsuspend, sigset_t __user *, unewset, size_t, sigsetsize) 2581 2592 { 2582 2593 sigset_t newset; 2583 2594
+36 -34
kernel/sys.c
··· 143 143 return error; 144 144 } 145 145 146 - asmlinkage long sys_setpriority(int which, int who, int niceval) 146 + SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval) 147 147 { 148 148 struct task_struct *g, *p; 149 149 struct user_struct *user; ··· 208 208 * has been offset by 20 (ie it returns 40..1 instead of -20..19) 209 209 * to stay compatible. 210 210 */ 211 - asmlinkage long sys_getpriority(int which, int who) 211 + SYSCALL_DEFINE2(getpriority, int, which, int, who) 212 212 { 213 213 struct task_struct *g, *p; 214 214 struct user_struct *user; ··· 355 355 * 356 356 * reboot doesn't sync: do that yourself before calling this. 357 357 */ 358 - asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user * arg) 358 + SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd, 359 + void __user *, arg) 359 360 { 360 361 char buffer[256]; 361 362 ··· 479 478 * SMP: There are not races, the GIDs are checked only by filesystem 480 479 * operations (as far as semantic preservation is concerned). 481 480 */ 482 - asmlinkage long sys_setregid(gid_t rgid, gid_t egid) 481 + SYSCALL_DEFINE2(setregid, gid_t, rgid, gid_t, egid) 483 482 { 484 483 const struct cred *old; 485 484 struct cred *new; ··· 530 529 * 531 530 * SMP: Same implicit races as above. 532 531 */ 533 - asmlinkage long sys_setgid(gid_t gid) 532 + SYSCALL_DEFINE1(setgid, gid_t, gid) 534 533 { 535 534 const struct cred *old; 536 535 struct cred *new; ··· 598 597 * 100% compatible with BSD. A program which uses just setuid() will be 599 598 * 100% compatible with POSIX with saved IDs. 600 599 */ 601 - asmlinkage long sys_setreuid(uid_t ruid, uid_t euid) 600 + SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid) 602 601 { 603 602 const struct cred *old; 604 603 struct cred *new; ··· 662 661 * will allow a root program to temporarily drop privileges and be able to 663 662 * regain them by swapping the real and effective uid. 664 663 */ 665 - asmlinkage long sys_setuid(uid_t uid) 664 + SYSCALL_DEFINE1(setuid, uid_t, uid) 666 665 { 667 666 const struct cred *old; 668 667 struct cred *new; ··· 706 705 * This function implements a generic ability to update ruid, euid, 707 706 * and suid. This allows you to implement the 4.4 compatible seteuid(). 708 707 */ 709 - asmlinkage long sys_setresuid(uid_t ruid, uid_t euid, uid_t suid) 708 + SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid) 710 709 { 711 710 const struct cred *old; 712 711 struct cred *new; ··· 757 756 return retval; 758 757 } 759 758 760 - asmlinkage long sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __user *suid) 759 + SYSCALL_DEFINE3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __user *, suid) 761 760 { 762 761 const struct cred *cred = current_cred(); 763 762 int retval; ··· 772 771 /* 773 772 * Same as above, but for rgid, egid, sgid. 774 773 */ 775 - asmlinkage long sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid) 774 + SYSCALL_DEFINE3(setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid) 776 775 { 777 776 const struct cred *old; 778 777 struct cred *new; ··· 815 814 return retval; 816 815 } 817 816 818 - asmlinkage long sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __user *sgid) 817 + SYSCALL_DEFINE3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid) 819 818 { 820 819 const struct cred *cred = current_cred(); 821 820 int retval; ··· 834 833 * whatever uid it wants to). It normally shadows "euid", except when 835 834 * explicitly set by setfsuid() or for access.. 836 835 */ 837 - asmlinkage long sys_setfsuid(uid_t uid) 836 + SYSCALL_DEFINE1(setfsuid, uid_t, uid) 838 837 { 839 838 const struct cred *old; 840 839 struct cred *new; ··· 871 870 /* 872 871 * Samma på svenska.. 873 872 */ 874 - asmlinkage long sys_setfsgid(gid_t gid) 873 + SYSCALL_DEFINE1(setfsgid, gid_t, gid) 875 874 { 876 875 const struct cred *old; 877 876 struct cred *new; ··· 920 919 tms->tms_cstime = cputime_to_clock_t(cstime); 921 920 } 922 921 923 - asmlinkage long sys_times(struct tms __user * tbuf) 922 + SYSCALL_DEFINE1(times, struct tms __user *, tbuf) 924 923 { 925 924 if (tbuf) { 926 925 struct tms tmp; ··· 945 944 * Auch. Had to add the 'did_exec' flag to conform completely to POSIX. 946 945 * LBT 04.03.94 947 946 */ 948 - asmlinkage long sys_setpgid(pid_t pid, pid_t pgid) 947 + SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid) 949 948 { 950 949 struct task_struct *p; 951 950 struct task_struct *group_leader = current->group_leader; ··· 1016 1015 return err; 1017 1016 } 1018 1017 1019 - asmlinkage long sys_getpgid(pid_t pid) 1018 + SYSCALL_DEFINE1(getpgid, pid_t, pid) 1020 1019 { 1021 1020 struct task_struct *p; 1022 1021 struct pid *grp; ··· 1046 1045 1047 1046 #ifdef __ARCH_WANT_SYS_GETPGRP 1048 1047 1049 - asmlinkage long sys_getpgrp(void) 1048 + SYSCALL_DEFINE0(getpgrp) 1050 1049 { 1051 1050 return sys_getpgid(0); 1052 1051 } 1053 1052 1054 1053 #endif 1055 1054 1056 - asmlinkage long sys_getsid(pid_t pid) 1055 + SYSCALL_DEFINE1(getsid, pid_t, pid) 1057 1056 { 1058 1057 struct task_struct *p; 1059 1058 struct pid *sid; ··· 1081 1080 return retval; 1082 1081 } 1083 1082 1084 - asmlinkage long sys_setsid(void) 1083 + SYSCALL_DEFINE0(setsid) 1085 1084 { 1086 1085 struct task_struct *group_leader = current->group_leader; 1087 1086 struct pid *sid = task_pid(group_leader); ··· 1312 1311 1313 1312 EXPORT_SYMBOL(set_current_groups); 1314 1313 1315 - asmlinkage long sys_getgroups(int gidsetsize, gid_t __user *grouplist) 1314 + SYSCALL_DEFINE2(getgroups, int, gidsetsize, gid_t __user *, grouplist) 1316 1315 { 1317 1316 const struct cred *cred = current_cred(); 1318 1317 int i; ··· 1341 1340 * without another task interfering. 1342 1341 */ 1343 1342 1344 - asmlinkage long sys_setgroups(int gidsetsize, gid_t __user *grouplist) 1343 + SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist) 1345 1344 { 1346 1345 struct group_info *group_info; 1347 1346 int retval; ··· 1395 1394 1396 1395 DECLARE_RWSEM(uts_sem); 1397 1396 1398 - asmlinkage long sys_newuname(struct new_utsname __user * name) 1397 + SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name) 1399 1398 { 1400 1399 int errno = 0; 1401 1400 ··· 1406 1405 return errno; 1407 1406 } 1408 1407 1409 - asmlinkage long sys_sethostname(char __user *name, int len) 1408 + SYSCALL_DEFINE2(sethostname, char __user *, name, int, len) 1410 1409 { 1411 1410 int errno; 1412 1411 char tmp[__NEW_UTS_LEN]; ··· 1430 1429 1431 1430 #ifdef __ARCH_WANT_SYS_GETHOSTNAME 1432 1431 1433 - asmlinkage long sys_gethostname(char __user *name, int len) 1432 + SYSCALL_DEFINE2(gethostname, char __user *, name, int, len) 1434 1433 { 1435 1434 int i, errno; 1436 1435 struct new_utsname *u; ··· 1455 1454 * Only setdomainname; getdomainname can be implemented by calling 1456 1455 * uname() 1457 1456 */ 1458 - asmlinkage long sys_setdomainname(char __user *name, int len) 1457 + SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len) 1459 1458 { 1460 1459 int errno; 1461 1460 char tmp[__NEW_UTS_LEN]; ··· 1478 1477 return errno; 1479 1478 } 1480 1479 1481 - asmlinkage long sys_getrlimit(unsigned int resource, struct rlimit __user *rlim) 1480 + SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim) 1482 1481 { 1483 1482 if (resource >= RLIM_NLIMITS) 1484 1483 return -EINVAL; ··· 1497 1496 * Back compatibility for getrlimit. Needed for some apps. 1498 1497 */ 1499 1498 1500 - asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *rlim) 1499 + SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource, 1500 + struct rlimit __user *, rlim) 1501 1501 { 1502 1502 struct rlimit x; 1503 1503 if (resource >= RLIM_NLIMITS) ··· 1516 1514 1517 1515 #endif 1518 1516 1519 - asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit __user *rlim) 1517 + SYSCALL_DEFINE2(setrlimit, unsigned int, resource, struct rlimit __user *, rlim) 1520 1518 { 1521 1519 struct rlimit new_rlim, *old_rlim; 1522 1520 int retval; ··· 1689 1687 return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0; 1690 1688 } 1691 1689 1692 - asmlinkage long sys_getrusage(int who, struct rusage __user *ru) 1690 + SYSCALL_DEFINE2(getrusage, int, who, struct rusage __user *, ru) 1693 1691 { 1694 1692 if (who != RUSAGE_SELF && who != RUSAGE_CHILDREN && 1695 1693 who != RUSAGE_THREAD) ··· 1697 1695 return getrusage(current, who, ru); 1698 1696 } 1699 1697 1700 - asmlinkage long sys_umask(int mask) 1698 + SYSCALL_DEFINE1(umask, int, mask) 1701 1699 { 1702 1700 mask = xchg(&current->fs->umask, mask & S_IRWXUGO); 1703 1701 return mask; 1704 1702 } 1705 1703 1706 - asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, 1707 - unsigned long arg4, unsigned long arg5) 1704 + SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, 1705 + unsigned long, arg4, unsigned long, arg5) 1708 1706 { 1709 1707 struct task_struct *me = current; 1710 1708 unsigned char comm[sizeof(me->comm)]; ··· 1817 1815 return error; 1818 1816 } 1819 1817 1820 - asmlinkage long sys_getcpu(unsigned __user *cpup, unsigned __user *nodep, 1821 - struct getcpu_cache __user *unused) 1818 + SYSCALL_DEFINE3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep, 1819 + struct getcpu_cache __user *, unused) 1822 1820 { 1823 1821 int err = 0; 1824 1822 int cpu = raw_smp_processor_id();
+1
kernel/sys_ni.c
··· 131 131 cond_syscall(sys_io_submit); 132 132 cond_syscall(sys_io_cancel); 133 133 cond_syscall(sys_io_getevents); 134 + cond_syscall(sys_syslog); 134 135 135 136 /* arch-specific weak syscall entries */ 136 137 cond_syscall(sys_pciconfig_read);
+2 -2
kernel/sysctl.c
··· 1688 1688 return error; 1689 1689 } 1690 1690 1691 - asmlinkage long sys_sysctl(struct __sysctl_args __user *args) 1691 + SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) 1692 1692 { 1693 1693 struct __sysctl_args tmp; 1694 1694 int error; ··· 2989 2989 #else /* CONFIG_SYSCTL_SYSCALL */ 2990 2990 2991 2991 2992 - asmlinkage long sys_sysctl(struct __sysctl_args __user *args) 2992 + SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) 2993 2993 { 2994 2994 struct __sysctl_args tmp; 2995 2995 int error;
+7 -7
kernel/time.c
··· 60 60 * why not move it into the appropriate arch directory (for those 61 61 * architectures that need it). 62 62 */ 63 - asmlinkage long sys_time(time_t __user * tloc) 63 + SYSCALL_DEFINE1(time, time_t __user *, tloc) 64 64 { 65 65 time_t i = get_seconds(); 66 66 ··· 79 79 * architectures that need it). 80 80 */ 81 81 82 - asmlinkage long sys_stime(time_t __user *tptr) 82 + SYSCALL_DEFINE1(stime, time_t __user *, tptr) 83 83 { 84 84 struct timespec tv; 85 85 int err; ··· 99 99 100 100 #endif /* __ARCH_WANT_SYS_TIME */ 101 101 102 - asmlinkage long sys_gettimeofday(struct timeval __user *tv, 103 - struct timezone __user *tz) 102 + SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv, 103 + struct timezone __user *, tz) 104 104 { 105 105 if (likely(tv != NULL)) { 106 106 struct timeval ktv; ··· 184 184 return 0; 185 185 } 186 186 187 - asmlinkage long sys_settimeofday(struct timeval __user *tv, 188 - struct timezone __user *tz) 187 + SYSCALL_DEFINE2(settimeofday, struct timeval __user *, tv, 188 + struct timezone __user *, tz) 189 189 { 190 190 struct timeval user_tv; 191 191 struct timespec new_ts; ··· 205 205 return do_sys_settimeofday(tv ? &new_ts : NULL, tz ? &new_tz : NULL); 206 206 } 207 207 208 - asmlinkage long sys_adjtimex(struct timex __user *txc_p) 208 + SYSCALL_DEFINE1(adjtimex, struct timex __user *, txc_p) 209 209 { 210 210 struct timex txc; /* Local copy of parameter */ 211 211 int ret;
+9 -9
kernel/timer.c
··· 1129 1129 * For backwards compatibility? This can be done in libc so Alpha 1130 1130 * and all newer ports shouldn't need it. 1131 1131 */ 1132 - asmlinkage unsigned long sys_alarm(unsigned int seconds) 1132 + SYSCALL_DEFINE1(alarm, unsigned int, seconds) 1133 1133 { 1134 1134 return alarm_setitimer(seconds); 1135 1135 } ··· 1152 1152 * 1153 1153 * This is SMP safe as current->tgid does not change. 1154 1154 */ 1155 - asmlinkage long sys_getpid(void) 1155 + SYSCALL_DEFINE0(getpid) 1156 1156 { 1157 1157 return task_tgid_vnr(current); 1158 1158 } ··· 1163 1163 * value of ->real_parent under rcu_read_lock(), see 1164 1164 * release_task()->call_rcu(delayed_put_task_struct). 1165 1165 */ 1166 - asmlinkage long sys_getppid(void) 1166 + SYSCALL_DEFINE0(getppid) 1167 1167 { 1168 1168 int pid; 1169 1169 ··· 1174 1174 return pid; 1175 1175 } 1176 1176 1177 - asmlinkage long sys_getuid(void) 1177 + SYSCALL_DEFINE0(getuid) 1178 1178 { 1179 1179 /* Only we change this so SMP safe */ 1180 1180 return current_uid(); 1181 1181 } 1182 1182 1183 - asmlinkage long sys_geteuid(void) 1183 + SYSCALL_DEFINE0(geteuid) 1184 1184 { 1185 1185 /* Only we change this so SMP safe */ 1186 1186 return current_euid(); 1187 1187 } 1188 1188 1189 - asmlinkage long sys_getgid(void) 1189 + SYSCALL_DEFINE0(getgid) 1190 1190 { 1191 1191 /* Only we change this so SMP safe */ 1192 1192 return current_gid(); 1193 1193 } 1194 1194 1195 - asmlinkage long sys_getegid(void) 1195 + SYSCALL_DEFINE0(getegid) 1196 1196 { 1197 1197 /* Only we change this so SMP safe */ 1198 1198 return current_egid(); ··· 1308 1308 EXPORT_SYMBOL(schedule_timeout_uninterruptible); 1309 1309 1310 1310 /* Thread ID - the internal kernel "pid" */ 1311 - asmlinkage long sys_gettid(void) 1311 + SYSCALL_DEFINE0(gettid) 1312 1312 { 1313 1313 return task_pid_vnr(current); 1314 1314 } ··· 1400 1400 return 0; 1401 1401 } 1402 1402 1403 - asmlinkage long sys_sysinfo(struct sysinfo __user *info) 1403 + SYSCALL_DEFINE1(sysinfo, struct sysinfo __user *, info) 1404 1404 { 1405 1405 struct sysinfo val; 1406 1406
+20 -19
kernel/uid16.c
··· 17 17 18 18 #include <asm/uaccess.h> 19 19 20 - asmlinkage long sys_chown16(const char __user * filename, old_uid_t user, old_gid_t group) 20 + SYSCALL_DEFINE3(chown16, const char __user *, filename, old_uid_t, user, old_gid_t, group) 21 21 { 22 22 long ret = sys_chown(filename, low2highuid(user), low2highgid(group)); 23 23 /* avoid REGPARM breakage on x86: */ ··· 25 25 return ret; 26 26 } 27 27 28 - asmlinkage long sys_lchown16(const char __user * filename, old_uid_t user, old_gid_t group) 28 + SYSCALL_DEFINE3(lchown16, const char __user *, filename, old_uid_t, user, old_gid_t, group) 29 29 { 30 30 long ret = sys_lchown(filename, low2highuid(user), low2highgid(group)); 31 31 /* avoid REGPARM breakage on x86: */ ··· 33 33 return ret; 34 34 } 35 35 36 - asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group) 36 + SYSCALL_DEFINE3(fchown16, unsigned int, fd, old_uid_t, user, old_gid_t, group) 37 37 { 38 38 long ret = sys_fchown(fd, low2highuid(user), low2highgid(group)); 39 39 /* avoid REGPARM breakage on x86: */ ··· 41 41 return ret; 42 42 } 43 43 44 - asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid) 44 + SYSCALL_DEFINE2(setregid16, old_gid_t, rgid, old_gid_t, egid) 45 45 { 46 46 long ret = sys_setregid(low2highgid(rgid), low2highgid(egid)); 47 47 /* avoid REGPARM breakage on x86: */ ··· 49 49 return ret; 50 50 } 51 51 52 - asmlinkage long sys_setgid16(old_gid_t gid) 52 + SYSCALL_DEFINE1(setgid16, old_gid_t, gid) 53 53 { 54 54 long ret = sys_setgid(low2highgid(gid)); 55 55 /* avoid REGPARM breakage on x86: */ ··· 57 57 return ret; 58 58 } 59 59 60 - asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid) 60 + SYSCALL_DEFINE2(setreuid16, old_uid_t, ruid, old_uid_t, euid) 61 61 { 62 62 long ret = sys_setreuid(low2highuid(ruid), low2highuid(euid)); 63 63 /* avoid REGPARM breakage on x86: */ ··· 65 65 return ret; 66 66 } 67 67 68 - asmlinkage long sys_setuid16(old_uid_t uid) 68 + SYSCALL_DEFINE1(setuid16, old_uid_t, uid) 69 69 { 70 70 long ret = sys_setuid(low2highuid(uid)); 71 71 /* avoid REGPARM breakage on x86: */ ··· 73 73 return ret; 74 74 } 75 75 76 - asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid) 76 + SYSCALL_DEFINE3(setresuid16, old_uid_t, ruid, old_uid_t, euid, old_uid_t, suid) 77 77 { 78 78 long ret = sys_setresuid(low2highuid(ruid), low2highuid(euid), 79 79 low2highuid(suid)); ··· 82 82 return ret; 83 83 } 84 84 85 - asmlinkage long sys_getresuid16(old_uid_t __user *ruid, old_uid_t __user *euid, old_uid_t __user *suid) 85 + SYSCALL_DEFINE3(getresuid16, old_uid_t __user *, ruid, old_uid_t __user *, euid, old_uid_t __user *, suid) 86 86 { 87 87 const struct cred *cred = current_cred(); 88 88 int retval; ··· 94 94 return retval; 95 95 } 96 96 97 - asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid) 97 + SYSCALL_DEFINE3(setresgid16, old_gid_t, rgid, old_gid_t, egid, old_gid_t, sgid) 98 98 { 99 99 long ret = sys_setresgid(low2highgid(rgid), low2highgid(egid), 100 100 low2highgid(sgid)); ··· 103 103 return ret; 104 104 } 105 105 106 - asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid, old_gid_t __user *sgid) 106 + 107 + SYSCALL_DEFINE3(getresgid16, old_gid_t __user *, rgid, old_gid_t __user *, egid, old_gid_t __user *, sgid) 107 108 { 108 109 const struct cred *cred = current_cred(); 109 110 int retval; ··· 116 115 return retval; 117 116 } 118 117 119 - asmlinkage long sys_setfsuid16(old_uid_t uid) 118 + SYSCALL_DEFINE1(setfsuid16, old_uid_t, uid) 120 119 { 121 120 long ret = sys_setfsuid(low2highuid(uid)); 122 121 /* avoid REGPARM breakage on x86: */ ··· 124 123 return ret; 125 124 } 126 125 127 - asmlinkage long sys_setfsgid16(old_gid_t gid) 126 + SYSCALL_DEFINE1(setfsgid16, old_gid_t, gid) 128 127 { 129 128 long ret = sys_setfsgid(low2highgid(gid)); 130 129 /* avoid REGPARM breakage on x86: */ ··· 162 161 return 0; 163 162 } 164 163 165 - asmlinkage long sys_getgroups16(int gidsetsize, old_gid_t __user *grouplist) 164 + SYSCALL_DEFINE2(getgroups16, int, gidsetsize, old_gid_t __user *, grouplist) 166 165 { 167 166 const struct cred *cred = current_cred(); 168 167 int i; ··· 185 184 return i; 186 185 } 187 186 188 - asmlinkage long sys_setgroups16(int gidsetsize, old_gid_t __user *grouplist) 187 + SYSCALL_DEFINE2(setgroups16, int, gidsetsize, old_gid_t __user *, grouplist) 189 188 { 190 189 struct group_info *group_info; 191 190 int retval; ··· 210 209 return retval; 211 210 } 212 211 213 - asmlinkage long sys_getuid16(void) 212 + SYSCALL_DEFINE0(getuid16) 214 213 { 215 214 return high2lowuid(current_uid()); 216 215 } 217 216 218 - asmlinkage long sys_geteuid16(void) 217 + SYSCALL_DEFINE0(geteuid16) 219 218 { 220 219 return high2lowuid(current_euid()); 221 220 } 222 221 223 - asmlinkage long sys_getgid16(void) 222 + SYSCALL_DEFINE0(getgid16) 224 223 { 225 224 return high2lowgid(current_gid()); 226 225 } 227 226 228 - asmlinkage long sys_getegid16(void) 227 + SYSCALL_DEFINE0(getegid16) 229 228 { 230 229 return high2lowgid(current_egid()); 231 230 }
+16 -2
mm/fadvise.c
··· 24 24 * POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could 25 25 * deactivate the pages and clear PG_Referenced. 26 26 */ 27 - asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice) 27 + SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) 28 28 { 29 29 struct file *file = fget(fd); 30 30 struct address_space *mapping; ··· 126 126 fput(file); 127 127 return ret; 128 128 } 129 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 130 + asmlinkage long SyS_fadvise64_64(long fd, loff_t offset, loff_t len, long advice) 131 + { 132 + return SYSC_fadvise64_64((int) fd, offset, len, (int) advice); 133 + } 134 + SYSCALL_ALIAS(sys_fadvise64_64, SyS_fadvise64_64); 135 + #endif 129 136 130 137 #ifdef __ARCH_WANT_SYS_FADVISE64 131 138 132 - asmlinkage long sys_fadvise64(int fd, loff_t offset, size_t len, int advice) 139 + SYSCALL_DEFINE(fadvise64)(int fd, loff_t offset, size_t len, int advice) 133 140 { 134 141 return sys_fadvise64_64(fd, offset, len, advice); 135 142 } 143 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 144 + asmlinkage long SyS_fadvise64(long fd, loff_t offset, long len, long advice) 145 + { 146 + return SYSC_fadvise64((int) fd, offset, (size_t)len, (int)advice); 147 + } 148 + SYSCALL_ALIAS(sys_fadvise64, SyS_fadvise64); 149 + #endif 136 150 137 151 #endif
+8 -1
mm/filemap.c
··· 1374 1374 return 0; 1375 1375 } 1376 1376 1377 - asmlinkage ssize_t sys_readahead(int fd, loff_t offset, size_t count) 1377 + SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count) 1378 1378 { 1379 1379 ssize_t ret; 1380 1380 struct file *file; ··· 1393 1393 } 1394 1394 return ret; 1395 1395 } 1396 + #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS 1397 + asmlinkage long SyS_readahead(long fd, loff_t offset, long count) 1398 + { 1399 + return SYSC_readahead((int) fd, offset, (size_t) count); 1400 + } 1401 + SYSCALL_ALIAS(sys_readahead, SyS_readahead); 1402 + #endif 1396 1403 1397 1404 #ifdef CONFIG_MMU 1398 1405 /**
+2 -2
mm/fremap.c
··· 120 120 * and the vma's default protection is used. Arbitrary protections 121 121 * might be implemented in the future. 122 122 */ 123 - asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, 124 - unsigned long prot, unsigned long pgoff, unsigned long flags) 123 + SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, 124 + unsigned long, prot, unsigned long, pgoff, unsigned long, flags) 125 125 { 126 126 struct mm_struct *mm = current->mm; 127 127 struct address_space *mapping;
+1 -1
mm/madvise.c
··· 281 281 * -EBADF - map exists, but area maps something that isn't a file. 282 282 * -EAGAIN - a kernel resource was temporarily unavailable. 283 283 */ 284 - asmlinkage long sys_madvise(unsigned long start, size_t len_in, int behavior) 284 + SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior) 285 285 { 286 286 unsigned long end, tmp; 287 287 struct vm_area_struct * vma, *prev;
+11 -13
mm/mempolicy.c
··· 1068 1068 return copy_to_user(mask, nodes_addr(*nodes), copy) ? -EFAULT : 0; 1069 1069 } 1070 1070 1071 - asmlinkage long sys_mbind(unsigned long start, unsigned long len, 1072 - unsigned long mode, 1073 - unsigned long __user *nmask, unsigned long maxnode, 1074 - unsigned flags) 1071 + SYSCALL_DEFINE6(mbind, unsigned long, start, unsigned long, len, 1072 + unsigned long, mode, unsigned long __user *, nmask, 1073 + unsigned long, maxnode, unsigned, flags) 1075 1074 { 1076 1075 nodemask_t nodes; 1077 1076 int err; ··· 1090 1091 } 1091 1092 1092 1093 /* Set the process memory policy */ 1093 - asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask, 1094 - unsigned long maxnode) 1094 + SYSCALL_DEFINE3(set_mempolicy, int, mode, unsigned long __user *, nmask, 1095 + unsigned long, maxnode) 1095 1096 { 1096 1097 int err; 1097 1098 nodemask_t nodes; ··· 1109 1110 return do_set_mempolicy(mode, flags, &nodes); 1110 1111 } 1111 1112 1112 - asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode, 1113 - const unsigned long __user *old_nodes, 1114 - const unsigned long __user *new_nodes) 1113 + SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, 1114 + const unsigned long __user *, old_nodes, 1115 + const unsigned long __user *, new_nodes) 1115 1116 { 1116 1117 const struct cred *cred = current_cred(), *tcred; 1117 1118 struct mm_struct *mm; ··· 1184 1185 1185 1186 1186 1187 /* Retrieve NUMA policy */ 1187 - asmlinkage long sys_get_mempolicy(int __user *policy, 1188 - unsigned long __user *nmask, 1189 - unsigned long maxnode, 1190 - unsigned long addr, unsigned long flags) 1188 + SYSCALL_DEFINE5(get_mempolicy, int __user *, policy, 1189 + unsigned long __user *, nmask, unsigned long, maxnode, 1190 + unsigned long, addr, unsigned long, flags) 1191 1191 { 1192 1192 int err; 1193 1193 int uninitialized_var(pval);
+4 -4
mm/migrate.c
··· 1055 1055 * Move a list of pages in the address space of the currently executing 1056 1056 * process. 1057 1057 */ 1058 - asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages, 1059 - const void __user * __user *pages, 1060 - const int __user *nodes, 1061 - int __user *status, int flags) 1058 + SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, 1059 + const void __user * __user *, pages, 1060 + const int __user *, nodes, 1061 + int __user *, status, int, flags) 1062 1062 { 1063 1063 const struct cred *cred = current_cred(), *tcred; 1064 1064 struct task_struct *task;
+2 -2
mm/mincore.c
··· 177 177 * mapped 178 178 * -EAGAIN - A kernel resource was temporarily unavailable. 179 179 */ 180 - asmlinkage long sys_mincore(unsigned long start, size_t len, 181 - unsigned char __user * vec) 180 + SYSCALL_DEFINE3(mincore, unsigned long, start, size_t, len, 181 + unsigned char __user *, vec) 182 182 { 183 183 long retval; 184 184 unsigned long pages;
+4 -4
mm/mlock.c
··· 530 530 return error; 531 531 } 532 532 533 - asmlinkage long sys_mlock(unsigned long start, size_t len) 533 + SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len) 534 534 { 535 535 unsigned long locked; 536 536 unsigned long lock_limit; ··· 558 558 return error; 559 559 } 560 560 561 - asmlinkage long sys_munlock(unsigned long start, size_t len) 561 + SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len) 562 562 { 563 563 int ret; 564 564 ··· 595 595 return 0; 596 596 } 597 597 598 - asmlinkage long sys_mlockall(int flags) 598 + SYSCALL_DEFINE1(mlockall, int, flags) 599 599 { 600 600 unsigned long lock_limit; 601 601 int ret = -EINVAL; ··· 623 623 return ret; 624 624 } 625 625 626 - asmlinkage long sys_munlockall(void) 626 + SYSCALL_DEFINE0(munlockall) 627 627 { 628 628 int ret; 629 629
+2 -2
mm/mmap.c
··· 245 245 return next; 246 246 } 247 247 248 - asmlinkage unsigned long sys_brk(unsigned long brk) 248 + SYSCALL_DEFINE1(brk, unsigned long, brk) 249 249 { 250 250 unsigned long rlim, retval; 251 251 unsigned long newbrk, oldbrk; ··· 1948 1948 1949 1949 EXPORT_SYMBOL(do_munmap); 1950 1950 1951 - asmlinkage long sys_munmap(unsigned long addr, size_t len) 1951 + SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) 1952 1952 { 1953 1953 int ret; 1954 1954 struct mm_struct *mm = current->mm;
+2 -2
mm/mprotect.c
··· 217 217 return error; 218 218 } 219 219 220 - asmlinkage long 221 - sys_mprotect(unsigned long start, size_t len, unsigned long prot) 220 + SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len, 221 + unsigned long, prot) 222 222 { 223 223 unsigned long vm_flags, nstart, end, tmp, reqprot; 224 224 struct vm_area_struct *vma, *prev;
+3 -3
mm/mremap.c
··· 420 420 return ret; 421 421 } 422 422 423 - asmlinkage unsigned long sys_mremap(unsigned long addr, 424 - unsigned long old_len, unsigned long new_len, 425 - unsigned long flags, unsigned long new_addr) 423 + SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, 424 + unsigned long, new_len, unsigned long, flags, 425 + unsigned long, new_addr) 426 426 { 427 427 unsigned long ret; 428 428
+1 -1
mm/msync.c
··· 28 28 * So by _not_ starting I/O in MS_ASYNC we provide complete flexibility to 29 29 * applications. 30 30 */ 31 - asmlinkage long sys_msync(unsigned long start, size_t len, int flags) 31 + SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags) 32 32 { 33 33 unsigned long end; 34 34 struct mm_struct *mm = current->mm;
+5 -6
mm/nommu.c
··· 416 416 * to a regular file. in this case, the unmapping will need 417 417 * to invoke file system routines that need the global lock. 418 418 */ 419 - asmlinkage unsigned long sys_brk(unsigned long brk) 419 + SYSCALL_DEFINE1(brk, unsigned long, brk) 420 420 { 421 421 struct mm_struct *mm = current->mm; 422 422 ··· 1573 1573 } 1574 1574 EXPORT_SYMBOL(do_munmap); 1575 1575 1576 - asmlinkage long sys_munmap(unsigned long addr, size_t len) 1576 + SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) 1577 1577 { 1578 1578 int ret; 1579 1579 struct mm_struct *mm = current->mm; ··· 1657 1657 } 1658 1658 EXPORT_SYMBOL(do_mremap); 1659 1659 1660 - asmlinkage 1661 - unsigned long sys_mremap(unsigned long addr, 1662 - unsigned long old_len, unsigned long new_len, 1663 - unsigned long flags, unsigned long new_addr) 1660 + SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, 1661 + unsigned long, new_len, unsigned long, flags, 1662 + unsigned long, new_addr) 1664 1663 { 1665 1664 unsigned long ret; 1666 1665
+2 -2
mm/swapfile.c
··· 1377 1377 return ret; 1378 1378 } 1379 1379 1380 - asmlinkage long sys_swapoff(const char __user * specialfile) 1380 + SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) 1381 1381 { 1382 1382 struct swap_info_struct * p = NULL; 1383 1383 unsigned short *swap_map; ··· 1633 1633 * 1634 1634 * The swapon system call 1635 1635 */ 1636 - asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) 1636 + SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) 1637 1637 { 1638 1638 struct swap_info_struct * p; 1639 1639 char *name = NULL;
+32 -31
net/socket.c
··· 1214 1214 return __sock_create(&init_net, family, type, protocol, res, 1); 1215 1215 } 1216 1216 1217 - asmlinkage long sys_socket(int family, int type, int protocol) 1217 + SYSCALL_DEFINE3(socket, int, family, int, type, int, protocol) 1218 1218 { 1219 1219 int retval; 1220 1220 struct socket *sock; ··· 1255 1255 * Create a pair of connected sockets. 1256 1256 */ 1257 1257 1258 - asmlinkage long sys_socketpair(int family, int type, int protocol, 1259 - int __user *usockvec) 1258 + SYSCALL_DEFINE4(socketpair, int, family, int, type, int, protocol, 1259 + int __user *, usockvec) 1260 1260 { 1261 1261 struct socket *sock1, *sock2; 1262 1262 int fd1, fd2, err; ··· 1356 1356 * the protocol layer (having also checked the address is ok). 1357 1357 */ 1358 1358 1359 - asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen) 1359 + SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen) 1360 1360 { 1361 1361 struct socket *sock; 1362 1362 struct sockaddr_storage address; ··· 1385 1385 * ready for listening. 1386 1386 */ 1387 1387 1388 - asmlinkage long sys_listen(int fd, int backlog) 1388 + SYSCALL_DEFINE2(listen, int, fd, int, backlog) 1389 1389 { 1390 1390 struct socket *sock; 1391 1391 int err, fput_needed; ··· 1418 1418 * clean when we restucture accept also. 1419 1419 */ 1420 1420 1421 - asmlinkage long sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr, 1422 - int __user *upeer_addrlen, int flags) 1421 + SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr, 1422 + int __user *, upeer_addrlen, int, flags) 1423 1423 { 1424 1424 struct socket *sock, *newsock; 1425 1425 struct file *newfile; ··· 1502 1502 goto out_put; 1503 1503 } 1504 1504 1505 - asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, 1506 - int __user *upeer_addrlen) 1505 + SYSCALL_DEFINE3(accept, int, fd, struct sockaddr __user *, upeer_sockaddr, 1506 + int __user *, upeer_addrlen) 1507 1507 { 1508 1508 return sys_accept4(fd, upeer_sockaddr, upeer_addrlen, 0); 1509 1509 } ··· 1520 1520 * include the -EINPROGRESS status for such sockets. 1521 1521 */ 1522 1522 1523 - asmlinkage long sys_connect(int fd, struct sockaddr __user *uservaddr, 1524 - int addrlen) 1523 + SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr, 1524 + int, addrlen) 1525 1525 { 1526 1526 struct socket *sock; 1527 1527 struct sockaddr_storage address; ··· 1552 1552 * name to user space. 1553 1553 */ 1554 1554 1555 - asmlinkage long sys_getsockname(int fd, struct sockaddr __user *usockaddr, 1556 - int __user *usockaddr_len) 1555 + SYSCALL_DEFINE3(getsockname, int, fd, struct sockaddr __user *, usockaddr, 1556 + int __user *, usockaddr_len) 1557 1557 { 1558 1558 struct socket *sock; 1559 1559 struct sockaddr_storage address; ··· 1583 1583 * name to user space. 1584 1584 */ 1585 1585 1586 - asmlinkage long sys_getpeername(int fd, struct sockaddr __user *usockaddr, 1587 - int __user *usockaddr_len) 1586 + SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr, 1587 + int __user *, usockaddr_len) 1588 1588 { 1589 1589 struct socket *sock; 1590 1590 struct sockaddr_storage address; ··· 1615 1615 * the protocol. 1616 1616 */ 1617 1617 1618 - asmlinkage long sys_sendto(int fd, void __user *buff, size_t len, 1619 - unsigned flags, struct sockaddr __user *addr, 1620 - int addr_len) 1618 + SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len, 1619 + unsigned, flags, struct sockaddr __user *, addr, 1620 + int, addr_len) 1621 1621 { 1622 1622 struct socket *sock; 1623 1623 struct sockaddr_storage address; ··· 1660 1660 * Send a datagram down a socket. 1661 1661 */ 1662 1662 1663 - asmlinkage long sys_send(int fd, void __user *buff, size_t len, unsigned flags) 1663 + SYSCALL_DEFINE4(send, int, fd, void __user *, buff, size_t, len, 1664 + unsigned, flags) 1664 1665 { 1665 1666 return sys_sendto(fd, buff, len, flags, NULL, 0); 1666 1667 } ··· 1672 1671 * sender address from kernel to user space. 1673 1672 */ 1674 1673 1675 - asmlinkage long sys_recvfrom(int fd, void __user *ubuf, size_t size, 1676 - unsigned flags, struct sockaddr __user *addr, 1677 - int __user *addr_len) 1674 + SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size, 1675 + unsigned, flags, struct sockaddr __user *, addr, 1676 + int __user *, addr_len) 1678 1677 { 1679 1678 struct socket *sock; 1680 1679 struct iovec iov; ··· 1726 1725 * to pass the user mode parameter for the protocols to sort out. 1727 1726 */ 1728 1727 1729 - asmlinkage long sys_setsockopt(int fd, int level, int optname, 1730 - char __user *optval, int optlen) 1728 + SYSCALL_DEFINE5(setsockopt, int, fd, int, level, int, optname, 1729 + char __user *, optval, int, optlen) 1731 1730 { 1732 1731 int err, fput_needed; 1733 1732 struct socket *sock; ··· 1760 1759 * to pass a user mode parameter for the protocols to sort out. 1761 1760 */ 1762 1761 1763 - asmlinkage long sys_getsockopt(int fd, int level, int optname, 1764 - char __user *optval, int __user *optlen) 1762 + SYSCALL_DEFINE5(getsockopt, int, fd, int, level, int, optname, 1763 + char __user *, optval, int __user *, optlen) 1765 1764 { 1766 1765 int err, fput_needed; 1767 1766 struct socket *sock; ··· 1790 1789 * Shutdown a socket. 1791 1790 */ 1792 1791 1793 - asmlinkage long sys_shutdown(int fd, int how) 1792 + SYSCALL_DEFINE2(shutdown, int, fd, int, how) 1794 1793 { 1795 1794 int err, fput_needed; 1796 1795 struct socket *sock; ··· 1816 1815 * BSD sendmsg interface 1817 1816 */ 1818 1817 1819 - asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags) 1818 + SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned, flags) 1820 1819 { 1821 1820 struct compat_msghdr __user *msg_compat = 1822 1821 (struct compat_msghdr __user *)msg; ··· 1922 1921 * BSD recvmsg interface 1923 1922 */ 1924 1923 1925 - asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, 1926 - unsigned int flags) 1924 + SYSCALL_DEFINE3(recvmsg, int, fd, struct msghdr __user *, msg, 1925 + unsigned int, flags) 1927 1926 { 1928 1927 struct compat_msghdr __user *msg_compat = 1929 1928 (struct compat_msghdr __user *)msg; ··· 2046 2045 * it is set by the callees. 2047 2046 */ 2048 2047 2049 - asmlinkage long sys_socketcall(int call, unsigned long __user *args) 2048 + SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args) 2050 2049 { 2051 2050 unsigned long a[6]; 2052 2051 unsigned long a0, a1;
+11 -11
security/keys/keyctl.c
··· 54 54 * - returns the new key's serial number 55 55 * - implements add_key() 56 56 */ 57 - asmlinkage long sys_add_key(const char __user *_type, 58 - const char __user *_description, 59 - const void __user *_payload, 60 - size_t plen, 61 - key_serial_t ringid) 57 + SYSCALL_DEFINE5(add_key, const char __user *, _type, 58 + const char __user *, _description, 59 + const void __user *, _payload, 60 + size_t, plen, 61 + key_serial_t, ringid) 62 62 { 63 63 key_ref_t keyring_ref, key_ref; 64 64 char type[32], *description; ··· 146 146 * - if the _callout_info string is empty, it will be rendered as "-" 147 147 * - implements request_key() 148 148 */ 149 - asmlinkage long sys_request_key(const char __user *_type, 150 - const char __user *_description, 151 - const char __user *_callout_info, 152 - key_serial_t destringid) 149 + SYSCALL_DEFINE4(request_key, const char __user *, _type, 150 + const char __user *, _description, 151 + const char __user *, _callout_info, 152 + key_serial_t, destringid) 153 153 { 154 154 struct key_type *ktype; 155 155 struct key *key; ··· 1216 1216 /* 1217 1217 * the key control system call 1218 1218 */ 1219 - asmlinkage long sys_keyctl(int option, unsigned long arg2, unsigned long arg3, 1220 - unsigned long arg4, unsigned long arg5) 1219 + SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3, 1220 + unsigned long, arg4, unsigned long, arg5) 1221 1221 { 1222 1222 switch (option) { 1223 1223 case KEYCTL_GET_KEYRING_ID: