From a00a700bdea86442c0d63a6bc7cc9d03a47e1d09 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 19 Mar 2018 21:08:33 -0400 Subject: [PATCH] sparc: get rid of remaining SIGN... wrappers just convert compat_sys_{readahead,fadvise64,fadvise64_64} to COMPAT_SYSCALL_DEFINE Signed-off-by: Al Viro --- arch/sparc/kernel/sys32.S | 28 ---------------------------- arch/sparc/kernel/sys_sparc32.c | 26 ++++++++++---------------- arch/sparc/kernel/systbls.h | 12 ++++++------ arch/sparc/kernel/systbls_64.S | 4 ++-- 4 files changed, 18 insertions(+), 52 deletions(-) diff --git a/arch/sparc/kernel/sys32.S b/arch/sparc/kernel/sys32.S index fba545787f81..489ffab918a8 100644 --- a/arch/sparc/kernel/sys32.S +++ b/arch/sparc/kernel/sys32.S @@ -13,34 +13,6 @@ .text -#define SIGN1(STUB,SYSCALL,REG1) \ - .align 32; \ - .globl STUB; \ -STUB: sethi %hi(SYSCALL), %g1; \ - jmpl %g1 + %lo(SYSCALL), %g0; \ - sra REG1, 0, REG1 - -#define SIGN2(STUB,SYSCALL,REG1,REG2) \ - .align 32; \ - .globl STUB; \ -STUB: sethi %hi(SYSCALL), %g1; \ - sra REG1, 0, REG1; \ - jmpl %g1 + %lo(SYSCALL), %g0; \ - sra REG2, 0, REG2 - -#define SIGN3(STUB,SYSCALL,REG1,REG2,REG3) \ - .align 32; \ - .globl STUB; \ -STUB: sra REG1, 0, REG1; \ - sethi %hi(SYSCALL), %g1; \ - sra REG2, 0, REG2; \ - jmpl %g1 + %lo(SYSCALL), %g0; \ - sra REG3, 0, REG3 - -SIGN1(sys32_readahead, compat_sys_readahead, %o0) -SIGN2(sys32_fadvise64, compat_sys_fadvise64, %o0, %o4) -SIGN2(sys32_fadvise64_64, compat_sys_fadvise64_64, %o0, %o5) - .globl sys32_mmap2 sys32_mmap2: sethi %hi(sys_mmap), %g1 diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c index 6d964bdefbaa..9b0c569267bf 100644 --- a/arch/sparc/kernel/sys_sparc32.c +++ b/arch/sparc/kernel/sys_sparc32.c @@ -212,30 +212,24 @@ asmlinkage compat_ssize_t sys32_pwrite64(unsigned int fd, return sys_pwrite64(fd, ubuf, count, (poshi << 32) | poslo); } -asmlinkage long compat_sys_readahead(int fd, - unsigned long offhi, - unsigned long offlo, - compat_size_t count) +COMPAT_SYSCALL_DEFINE4(readahead, int, fd, u32, offhi, u32, offlo, + compat_size_t, count) { - return sys_readahead(fd, (offhi << 32) | offlo, count); + return sys_readahead(fd, ((u64)offhi << 32) | offlo, count); } -long compat_sys_fadvise64(int fd, - unsigned long offhi, - unsigned long offlo, - compat_size_t len, int advice) +COMPAT_SYSCALL_DEFINE5(fadvise64, int, fd, u32, offhi, u32, offlo, + compat_size_t, len, int, advice) { - return sys_fadvise64_64(fd, (offhi << 32) | offlo, len, advice); + return sys_fadvise64_64(fd, ((u64)offhi << 32) | offlo, len, advice); } -long compat_sys_fadvise64_64(int fd, - unsigned long offhi, unsigned long offlo, - unsigned long lenhi, unsigned long lenlo, - int advice) +COMPAT_SYSCALL_DEFINE6(fadvise64_64, int, fd, u32, offhi, u32, offlo, + u32, lenhi, u32, lenlo, int, advice) { return sys_fadvise64_64(fd, - (offhi << 32) | offlo, - (lenhi << 32) | lenlo, + ((u64)offhi << 32) | offlo, + ((u64)lenhi << 32) | lenlo, advice); } diff --git a/arch/sparc/kernel/systbls.h b/arch/sparc/kernel/systbls.h index 0c9434d980d7..4aca08e3ddef 100644 --- a/arch/sparc/kernel/systbls.h +++ b/arch/sparc/kernel/systbls.h @@ -77,16 +77,16 @@ asmlinkage compat_ssize_t sys32_pwrite64(unsigned int fd, unsigned long poshi, unsigned long poslo); asmlinkage long compat_sys_readahead(int fd, - unsigned long offhi, - unsigned long offlo, + unsigned offhi, + unsigned offlo, compat_size_t count); long compat_sys_fadvise64(int fd, - unsigned long offhi, - unsigned long offlo, + unsigned offhi, + unsigned offlo, compat_size_t len, int advice); long compat_sys_fadvise64_64(int fd, - unsigned long offhi, unsigned long offlo, - unsigned long lenhi, unsigned long lenlo, + unsigned offhi, unsigned offlo, + unsigned lenhi, unsigned lenlo, int advice); long sys32_sync_file_range(unsigned int fd, unsigned long off_high, unsigned long off_low, diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index a5c7d23cddf0..96b6b64ce579 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S @@ -60,8 +60,8 @@ sys_call_table32: /*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl .word sys_epoll_wait, sys_ioprio_set, sys_getppid, compat_sys_sparc_sigaction, sys_sgetmask /*200*/ .word sys_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir - .word sys32_readahead, sys32_socketcall, sys_syslog, compat_sys_lookup_dcookie, sys32_fadvise64 -/*210*/ .word sys32_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, compat_sys_sysinfo + .word compat_sys_readahead, sys32_socketcall, sys_syslog, compat_sys_lookup_dcookie, compat_sys_fadvise64 +/*210*/ .word compat_sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, compat_sys_sysinfo .word compat_sys_ipc, sys32_sigreturn, sys_clone, sys_ioprio_get, compat_sys_adjtimex /*220*/ .word compat_sys_sigprocmask, sys_ni_syscall, sys_delete_module, sys_ni_syscall, sys_getpgid .word sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid16, sys_setfsgid16