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

alpha: use syscall wrappers

Convert OSF syscalls and add alpha specific SYSCALL_ALIAS() macro.

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Ivan Kokshaysky and committed by
Linus Torvalds
e5d9a90c 299b4eaa

+92 -99
+1
arch/alpha/Kconfig
··· 8 8 select HAVE_AOUT 9 9 select HAVE_IDE 10 10 select HAVE_OPROFILE 11 + select HAVE_SYSCALL_WRAPPERS 11 12 help 12 13 The Alpha is a 64-bit general-purpose processor designed and 13 14 marketed by the Digital Equipment Corporation of blessed memory,
+1 -1
arch/alpha/kernel/entry.S
··· 933 933 osf_sigprocmask: 934 934 .prologue 0 935 935 mov $sp, $18 936 - jmp $31, do_osf_sigprocmask 936 + jmp $31, sys_osf_sigprocmask 937 937 .end osf_sigprocmask 938 938 939 939 .align 4
+50 -63
arch/alpha/kernel/osf_sys.c
··· 54 54 * identical to OSF as we don't return 0 on success, but doing otherwise 55 55 * would require changes to libc. Hopefully this is good enough. 56 56 */ 57 - asmlinkage unsigned long 58 - osf_brk(unsigned long brk) 57 + SYSCALL_DEFINE1(osf_brk, unsigned long, brk) 59 58 { 60 59 unsigned long retval = sys_brk(brk); 61 60 if (brk && brk != retval) ··· 65 66 /* 66 67 * This is pure guess-work.. 67 68 */ 68 - asmlinkage int 69 - osf_set_program_attributes(unsigned long text_start, unsigned long text_len, 70 - unsigned long bss_start, unsigned long bss_len) 69 + SYSCALL_DEFINE4(osf_set_program_attributes, unsigned long, text_start, 70 + unsigned long, text_len, unsigned long, bss_start, 71 + unsigned long, bss_len) 71 72 { 72 73 struct mm_struct *mm; 73 74 ··· 145 146 return -EFAULT; 146 147 } 147 148 148 - asmlinkage int 149 - osf_getdirentries(unsigned int fd, struct osf_dirent __user *dirent, 150 - unsigned int count, long __user *basep) 149 + SYSCALL_DEFINE4(osf_getdirentries, unsigned int, fd, 150 + struct osf_dirent __user *, dirent, unsigned int, count, 151 + long __user *, basep) 151 152 { 152 153 int error; 153 154 struct file *file; ··· 176 177 177 178 #undef NAME_OFFSET 178 179 179 - asmlinkage unsigned long 180 - osf_mmap(unsigned long addr, unsigned long len, unsigned long prot, 181 - unsigned long flags, unsigned long fd, unsigned long off) 180 + SYSCALL_DEFINE6(osf_mmap, unsigned long, addr, unsigned long, len, 181 + unsigned long, prot, unsigned long, flags, unsigned long, fd, 182 + unsigned long, off) 182 183 { 183 184 struct file *file = NULL; 184 185 unsigned long ret = -EBADF; ··· 253 254 return error; 254 255 } 255 256 256 - asmlinkage int 257 - osf_statfs(char __user *pathname, struct osf_statfs __user *buffer, unsigned long bufsiz) 257 + SYSCALL_DEFINE3(osf_statfs, char __user *, pathname, 258 + struct osf_statfs __user *, buffer, unsigned long, bufsiz) 258 259 { 259 260 struct path path; 260 261 int retval; ··· 267 268 return retval; 268 269 } 269 270 270 - asmlinkage int 271 - osf_fstatfs(unsigned long fd, struct osf_statfs __user *buffer, unsigned long bufsiz) 271 + SYSCALL_DEFINE3(osf_fstatfs, unsigned long, fd, 272 + struct osf_statfs __user *, buffer, unsigned long, bufsiz) 272 273 { 273 274 struct file *file; 274 275 int retval; ··· 367 368 return do_mount("", dirname, "proc", flags, NULL); 368 369 } 369 370 370 - asmlinkage int 371 - osf_mount(unsigned long typenr, char __user *path, int flag, void __user *data) 371 + SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path, 372 + int, flag, void __user *, data) 372 373 { 373 374 int retval = -EINVAL; 374 375 char *name; ··· 398 399 return retval; 399 400 } 400 401 401 - asmlinkage int 402 - osf_utsname(char __user *name) 402 + SYSCALL_DEFINE1(osf_utsname, char __user *, name) 403 403 { 404 404 int error; 405 405 ··· 421 423 return error; 422 424 } 423 425 424 - asmlinkage unsigned long 425 - sys_getpagesize(void) 426 + SYSCALL_DEFINE0(getpagesize) 426 427 { 427 428 return PAGE_SIZE; 428 429 } 429 430 430 - asmlinkage unsigned long 431 - sys_getdtablesize(void) 431 + SYSCALL_DEFINE0(getdtablesize) 432 432 { 433 433 return sysctl_nr_open; 434 434 } ··· 434 438 /* 435 439 * For compatibility with OSF/1 only. Use utsname(2) instead. 436 440 */ 437 - asmlinkage int 438 - osf_getdomainname(char __user *name, int namelen) 441 + SYSCALL_DEFINE2(osf_getdomainname, char __user *, name, int, namelen) 439 442 { 440 443 unsigned len; 441 444 int i; ··· 522 527 PL_DEL = 5, PL_FDEL = 6 523 528 }; 524 529 525 - asmlinkage long 526 - osf_proplist_syscall(enum pl_code code, union pl_args __user *args) 530 + SYSCALL_DEFINE2(osf_proplist_syscall, enum pl_code, code, 531 + union pl_args __user *, args) 527 532 { 528 533 long error; 529 534 int __user *min_buf_size_ptr; ··· 562 567 return error; 563 568 } 564 569 565 - asmlinkage int 566 - osf_sigstack(struct sigstack __user *uss, struct sigstack __user *uoss) 570 + SYSCALL_DEFINE2(osf_sigstack, struct sigstack __user *, uss, 571 + struct sigstack __user *, uoss) 567 572 { 568 573 unsigned long usp = rdusp(); 569 574 unsigned long oss_sp = current->sas_ss_sp + current->sas_ss_size; ··· 603 608 return error; 604 609 } 605 610 606 - asmlinkage long 607 - osf_sysinfo(int command, char __user *buf, long count) 611 + SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count) 608 612 { 609 613 char *sysinfo_table[] = { 610 614 utsname()->sysname, ··· 641 647 return err; 642 648 } 643 649 644 - asmlinkage unsigned long 645 - osf_getsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes, 646 - int __user *start, void __user *arg) 650 + SYSCALL_DEFINE5(osf_getsysinfo, unsigned long, op, void __user *, buffer, 651 + unsigned long, nbytes, int __user *, start, void __user *, arg) 647 652 { 648 653 unsigned long w; 649 654 struct percpu_struct *cpu; ··· 698 705 return -EOPNOTSUPP; 699 706 } 700 707 701 - asmlinkage unsigned long 702 - osf_setsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes, 703 - int __user *start, void __user *arg) 708 + SYSCALL_DEFINE5(osf_setsysinfo, unsigned long, op, void __user *, buffer, 709 + unsigned long, nbytes, int __user *, start, void __user *, arg) 704 710 { 705 711 switch (op) { 706 712 case SSI_IEEE_FP_CONTROL: { ··· 872 880 value->tv_sec = jiffies / HZ; 873 881 } 874 882 875 - asmlinkage int 876 - osf_gettimeofday(struct timeval32 __user *tv, struct timezone __user *tz) 883 + SYSCALL_DEFINE2(osf_gettimeofday, struct timeval32 __user *, tv, 884 + struct timezone __user *, tz) 877 885 { 878 886 if (tv) { 879 887 struct timeval ktv; ··· 888 896 return 0; 889 897 } 890 898 891 - asmlinkage int 892 - osf_settimeofday(struct timeval32 __user *tv, struct timezone __user *tz) 899 + SYSCALL_DEFINE2(osf_settimeofday, struct timeval32 __user *, tv, 900 + struct timezone __user *, tz) 893 901 { 894 902 struct timespec kts; 895 903 struct timezone ktz; ··· 908 916 return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL); 909 917 } 910 918 911 - asmlinkage int 912 - osf_getitimer(int which, struct itimerval32 __user *it) 919 + SYSCALL_DEFINE2(osf_getitimer, int, which, struct itimerval32 __user *, it) 913 920 { 914 921 struct itimerval kit; 915 922 int error; ··· 920 929 return error; 921 930 } 922 931 923 - asmlinkage int 924 - osf_setitimer(int which, struct itimerval32 __user *in, struct itimerval32 __user *out) 932 + SYSCALL_DEFINE3(osf_setitimer, int, which, struct itimerval32 __user *, in, 933 + struct itimerval32 __user *, out) 925 934 { 926 935 struct itimerval kin, kout; 927 936 int error; ··· 943 952 944 953 } 945 954 946 - asmlinkage int 947 - osf_utimes(char __user *filename, struct timeval32 __user *tvs) 955 + SYSCALL_DEFINE2(osf_utimes, char __user *, filename, 956 + struct timeval32 __user *, tvs) 948 957 { 949 958 struct timespec tv[2]; 950 959 ··· 970 979 #define MAX_SELECT_SECONDS \ 971 980 ((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1) 972 981 973 - asmlinkage int 974 - osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, 975 - struct timeval32 __user *tvp) 982 + SYSCALL_DEFINE5(osf_select, int, n, fd_set __user *, inp, fd_set __user *, outp, 983 + fd_set __user *, exp, struct timeval32 __user *, tvp) 976 984 { 977 985 struct timespec end_time, *to = NULL; 978 986 if (tvp) { ··· 1016 1026 long ru_nivcsw; /* involuntary " */ 1017 1027 }; 1018 1028 1019 - asmlinkage int 1020 - osf_getrusage(int who, struct rusage32 __user *ru) 1029 + SYSCALL_DEFINE2(osf_getrusage, int, who, struct rusage32 __user *, ru) 1021 1030 { 1022 1031 struct rusage32 r; 1023 1032 ··· 1042 1053 return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0; 1043 1054 } 1044 1055 1045 - asmlinkage long 1046 - osf_wait4(pid_t pid, int __user *ustatus, int options, 1047 - struct rusage32 __user *ur) 1056 + SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options, 1057 + struct rusage32 __user *, ur) 1048 1058 { 1049 1059 struct rusage r; 1050 1060 long ret, err; ··· 1089 1101 * seems to be a timeval pointer, and I suspect the second 1090 1102 * one is the time remaining.. Ho humm.. No documentation. 1091 1103 */ 1092 - asmlinkage int 1093 - osf_usleep_thread(struct timeval32 __user *sleep, struct timeval32 __user *remain) 1104 + SYSCALL_DEFINE2(osf_usleep_thread, struct timeval32 __user *, sleep, 1105 + struct timeval32 __user *, remain) 1094 1106 { 1095 1107 struct timeval tmp; 1096 1108 unsigned long ticks; ··· 1143 1155 int :32; int :32; int :32; int :32; 1144 1156 }; 1145 1157 1146 - asmlinkage int 1147 - sys_old_adjtimex(struct timex32 __user *txc_p) 1158 + SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p) 1148 1159 { 1149 1160 struct timex txc; 1150 1161 int ret; ··· 1254 1267 return 0; 1255 1268 } 1256 1269 1257 - asmlinkage ssize_t 1258 - osf_readv(unsigned long fd, const struct iovec __user * vector, unsigned long count) 1270 + SYSCALL_DEFINE3(osf_readv, unsigned long, fd, 1271 + const struct iovec __user *, vector, unsigned long, count) 1259 1272 { 1260 1273 if (unlikely(personality(current->personality) == PER_OSF4)) 1261 1274 if (osf_fix_iov_len(vector, count)) ··· 1263 1276 return sys_readv(fd, vector, count); 1264 1277 } 1265 1278 1266 - asmlinkage ssize_t 1267 - osf_writev(unsigned long fd, const struct iovec __user * vector, unsigned long count) 1279 + SYSCALL_DEFINE3(osf_writev, unsigned long, fd, 1280 + const struct iovec __user *, vector, unsigned long, count) 1268 1281 { 1269 1282 if (unlikely(personality(current->personality) == PER_OSF4)) 1270 1283 if (osf_fix_iov_len(vector, count))
+9 -9
arch/alpha/kernel/signal.c
··· 19 19 #include <linux/tty.h> 20 20 #include <linux/binfmts.h> 21 21 #include <linux/bitops.h> 22 + #include <linux/syscalls.h> 22 23 23 24 #include <asm/uaccess.h> 24 25 #include <asm/sigcontext.h> ··· 52 51 * Note that we don't need to acquire the kernel lock for SMP 53 52 * operation, as all of this is local to this thread. 54 53 */ 55 - asmlinkage unsigned long 56 - do_osf_sigprocmask(int how, unsigned long newmask, struct pt_regs *regs) 54 + SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask, 55 + struct pt_regs *, regs) 57 56 { 58 57 unsigned long oldmask = -EINVAL; 59 58 ··· 82 81 return oldmask; 83 82 } 84 83 85 - asmlinkage int 86 - osf_sigaction(int sig, const struct osf_sigaction __user *act, 87 - struct osf_sigaction __user *oact) 84 + SYSCALL_DEFINE3(osf_sigaction, int, sig, 85 + const struct osf_sigaction __user *, act, 86 + struct osf_sigaction __user *, oact) 88 87 { 89 88 struct k_sigaction new_ka, old_ka; 90 89 int ret; ··· 113 112 return ret; 114 113 } 115 114 116 - asmlinkage long 117 - sys_rt_sigaction(int sig, const struct sigaction __user *act, 118 - struct sigaction __user *oact, 119 - size_t sigsetsize, void __user *restorer) 115 + SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act, 116 + struct sigaction __user *, oact, 117 + size_t, sigsetsize, void __user *, restorer) 120 118 { 121 119 struct k_sigaction new_ka, old_ka; 122 120 int ret;
+26 -26
arch/alpha/kernel/systbls.S
··· 17 17 .quad sys_write 18 18 .quad alpha_ni_syscall /* 5 */ 19 19 .quad sys_close 20 - .quad osf_wait4 20 + .quad sys_osf_wait4 21 21 .quad alpha_ni_syscall 22 22 .quad sys_link 23 23 .quad sys_unlink /* 10 */ ··· 27 27 .quad sys_mknod 28 28 .quad sys_chmod /* 15 */ 29 29 .quad sys_chown 30 - .quad osf_brk 30 + .quad sys_osf_brk 31 31 .quad alpha_ni_syscall 32 32 .quad sys_lseek 33 33 .quad sys_getxpid /* 20 */ 34 - .quad osf_mount 34 + .quad sys_osf_mount 35 35 .quad sys_umount 36 36 .quad sys_setuid 37 37 .quad sys_getxuid ··· 53 53 .quad alpha_ni_syscall /* 40 */ 54 54 .quad sys_dup 55 55 .quad sys_alpha_pipe 56 - .quad osf_set_program_attributes 56 + .quad sys_osf_set_program_attributes 57 57 .quad alpha_ni_syscall 58 58 .quad sys_open /* 45 */ 59 59 .quad alpha_ni_syscall ··· 81 81 .quad sys_newlstat 82 82 .quad alpha_ni_syscall 83 83 .quad alpha_ni_syscall /* 70 */ 84 - .quad osf_mmap 84 + .quad sys_osf_mmap 85 85 .quad alpha_ni_syscall 86 86 .quad sys_munmap 87 87 .quad sys_mprotect ··· 94 94 .quad sys_setgroups /* 80 */ 95 95 .quad alpha_ni_syscall 96 96 .quad sys_setpgid 97 - .quad osf_setitimer 97 + .quad sys_osf_setitimer 98 98 .quad alpha_ni_syscall 99 99 .quad alpha_ni_syscall /* 85 */ 100 - .quad osf_getitimer 100 + .quad sys_osf_getitimer 101 101 .quad sys_gethostname 102 102 .quad sys_sethostname 103 103 .quad sys_getdtablesize 104 104 .quad sys_dup2 /* 90 */ 105 105 .quad sys_newfstat 106 106 .quad sys_fcntl 107 - .quad osf_select 107 + .quad sys_osf_select 108 108 .quad sys_poll 109 109 .quad sys_fsync /* 95 */ 110 110 .quad sys_setpriority ··· 123 123 .quad alpha_ni_syscall 124 124 .quad alpha_ni_syscall /* 110 */ 125 125 .quad sys_sigsuspend 126 - .quad osf_sigstack 126 + .quad sys_osf_sigstack 127 127 .quad sys_recvmsg 128 128 .quad sys_sendmsg 129 129 .quad alpha_ni_syscall /* 115 */ 130 - .quad osf_gettimeofday 131 - .quad osf_getrusage 130 + .quad sys_osf_gettimeofday 131 + .quad sys_osf_getrusage 132 132 .quad sys_getsockopt 133 133 .quad alpha_ni_syscall 134 134 #ifdef CONFIG_OSF4_COMPAT 135 - .quad osf_readv /* 120 */ 136 - .quad osf_writev 135 + .quad sys_osf_readv /* 120 */ 136 + .quad sys_osf_writev 137 137 #else 138 138 .quad sys_readv /* 120 */ 139 139 .quad sys_writev 140 140 #endif 141 - .quad osf_settimeofday 141 + .quad sys_osf_settimeofday 142 142 .quad sys_fchown 143 143 .quad sys_fchmod 144 144 .quad sys_recvfrom /* 125 */ ··· 154 154 .quad sys_socketpair /* 135 */ 155 155 .quad sys_mkdir 156 156 .quad sys_rmdir 157 - .quad osf_utimes 157 + .quad sys_osf_utimes 158 158 .quad alpha_ni_syscall 159 159 .quad alpha_ni_syscall /* 140 */ 160 160 .quad sys_getpeername ··· 172 172 .quad alpha_ni_syscall 173 173 .quad alpha_ni_syscall 174 174 .quad alpha_ni_syscall /* 155 */ 175 - .quad osf_sigaction 175 + .quad sys_osf_sigaction 176 176 .quad alpha_ni_syscall 177 177 .quad alpha_ni_syscall 178 - .quad osf_getdirentries 179 - .quad osf_statfs /* 160 */ 180 - .quad osf_fstatfs 178 + .quad sys_osf_getdirentries 179 + .quad sys_osf_statfs /* 160 */ 180 + .quad sys_osf_fstatfs 181 181 .quad alpha_ni_syscall 182 182 .quad alpha_ni_syscall 183 183 .quad alpha_ni_syscall 184 - .quad osf_getdomainname /* 165 */ 184 + .quad sys_osf_getdomainname /* 165 */ 185 185 .quad sys_setdomainname 186 186 .quad alpha_ni_syscall 187 187 .quad alpha_ni_syscall ··· 224 224 .quad sys_semctl 225 225 .quad sys_semget /* 205 */ 226 226 .quad sys_semop 227 - .quad osf_utsname 227 + .quad sys_osf_utsname 228 228 .quad sys_lchown 229 229 .quad sys_shmat 230 230 .quad sys_shmctl /* 210 */ ··· 258 258 .quad alpha_ni_syscall 259 259 .quad alpha_ni_syscall 260 260 .quad alpha_ni_syscall /* 240 */ 261 - .quad osf_sysinfo 261 + .quad sys_osf_sysinfo 262 262 .quad alpha_ni_syscall 263 263 .quad alpha_ni_syscall 264 - .quad osf_proplist_syscall 264 + .quad sys_osf_proplist_syscall 265 265 .quad alpha_ni_syscall /* 245 */ 266 266 .quad alpha_ni_syscall 267 267 .quad alpha_ni_syscall 268 268 .quad alpha_ni_syscall 269 269 .quad alpha_ni_syscall 270 270 .quad alpha_ni_syscall /* 250 */ 271 - .quad osf_usleep_thread 271 + .quad sys_osf_usleep_thread 272 272 .quad alpha_ni_syscall 273 273 .quad alpha_ni_syscall 274 274 .quad sys_sysfs 275 275 .quad alpha_ni_syscall /* 255 */ 276 - .quad osf_getsysinfo 277 - .quad osf_setsysinfo 276 + .quad sys_osf_getsysinfo 277 + .quad sys_osf_setsysinfo 278 278 .quad alpha_ni_syscall 279 279 .quad alpha_ni_syscall 280 280 .quad alpha_ni_syscall /* 260 */
+5
include/linux/syscalls.h
··· 108 108 asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \ 109 109 "\t.globl ." #alias "\n\t.set ." #alias ", ." #name) 110 110 #else 111 + #ifdef CONFIG_ALPHA 112 + #define SYSCALL_ALIAS(alias, name) \ 113 + asm ( #alias " = " #name "\n\t.globl " #alias) 114 + #else 111 115 #define SYSCALL_ALIAS(alias, name) \ 112 116 asm ("\t.globl " #alias "\n\t.set " #alias ", " #name) 117 + #endif 113 118 #endif 114 119 115 120 #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS