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

openrisc: convert to generic syscall table

The uapi/asm/unistd_32.h and asm/syscall_table_32.h headers can now be
generated from scripts/syscall.tbl, which makes this consistent with
the other architectures that have their own syscall.tbl.

openrisc has one extra system call that gets added to scripts/syscall.tbl.

The time32, stat64, rlimit and renameat entries in the syscall_abis_32
line are for system calls that were part of the generic ABI when
arch/nios2 got added but are no longer enabled by default for new
architectures.

Both the user visible side of asm/unistd.h and the internal syscall
table in the kernel should have the same effective contents after this.

When asm/syscalls.h is included in kernel/fork.c for the purpose of
type checking, the redirection macros cause problems. Move these so
only the references get redirected.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+25 -19
+2
arch/openrisc/include/asm/Kbuild
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 + syscall-y += syscall_table_32.h 3 + 2 4 generic-y += extable.h 3 5 generic-y += kvm_para.h 4 6 generic-y += parport.h
-4
arch/openrisc/include/asm/syscalls.h
··· 25 25 asmlinkage long __sys_clone3(struct clone_args __user *uargs, size_t size); 26 26 asmlinkage long __sys_fork(void); 27 27 28 - #define sys_clone __sys_clone 29 - #define sys_clone3 __sys_clone3 30 - #define sys_fork __sys_fork 31 - 32 28 #endif /* __ASM_OPENRISC_SYSCALLS_H */
+8
arch/openrisc/include/asm/unistd.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ 2 + 3 + #define __ARCH_WANT_STAT64 4 + #define __ARCH_WANT_SYS_FORK 5 + #define __ARCH_WANT_SYS_CLONE 6 + #define __ARCH_WANT_TIME32_SYSCALLS 7 + 8 + #include <uapi/asm/unistd.h>
+2
arch/openrisc/include/uapi/asm/Kbuild
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 + syscall-y += unistd_32.h 3 + 2 4 generic-y += ucontext.h
+1 -13
arch/openrisc/include/uapi/asm/unistd.h
··· 17 17 * (at your option) any later version. 18 18 */ 19 19 20 - #define sys_mmap2 sys_mmap_pgoff 21 - 22 - #define __ARCH_WANT_RENAMEAT 23 - #define __ARCH_WANT_STAT64 24 - #define __ARCH_WANT_SET_GET_RLIMIT 25 - #define __ARCH_WANT_SYS_FORK 26 - #define __ARCH_WANT_SYS_CLONE 27 - #define __ARCH_WANT_TIME32_SYSCALLS 28 - 29 - #include <asm-generic/unistd.h> 30 - 31 - #define __NR_or1k_atomic __NR_arch_specific_syscall 32 - __SYSCALL(__NR_or1k_atomic, sys_or1k_atomic) 20 + #include <asm/unistd_32.h>
+3
arch/openrisc/kernel/Makefile.syscalls
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + 3 + syscall_abis_32 += or1k time32 stat64 rlimit renameat
+7 -2
arch/openrisc/kernel/sys_call_table.c
··· 16 16 17 17 #include <asm/syscalls.h> 18 18 19 - #undef __SYSCALL 20 19 #define __SYSCALL(nr, call) [nr] = (call), 20 + #define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native) 21 + 22 + #define sys_mmap2 sys_mmap_pgoff 23 + #define sys_clone __sys_clone 24 + #define sys_clone3 __sys_clone3 25 + #define sys_fork __sys_fork 21 26 22 27 void *sys_call_table[__NR_syscalls] = { 23 - #include <asm/unistd.h> 28 + #include <asm/syscall_table_32.h> 24 29 };
+2
scripts/syscall.tbl
··· 299 299 300 300 244 nios2 cacheflush sys_cacheflush 301 301 302 + 244 or1k or1k_atomic sys_or1k_atomic 303 + 302 304 260 time32 wait4 sys_wait4 compat_sys_wait4 303 305 260 64 wait4 sys_wait4 304 306 261 common prlimit64 sys_prlimit64