Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 77122bf

Browse files
committed
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>
1 parent ef608c5 commit 77122bf

File tree

8 files changed

+25
-19
lines changed

8 files changed

+25
-19
lines changed

arch/openrisc/include/asm/Kbuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
2+
syscall-y += syscall_table_32.h
3+
24
generic-y += extable.h
35
generic-y += kvm_para.h
46
generic-y += parport.h

arch/openrisc/include/asm/syscalls.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,4 @@ asmlinkage long __sys_clone(unsigned long clone_flags, unsigned long newsp,
2525
asmlinkage long __sys_clone3(struct clone_args __user *uargs, size_t size);
2626
asmlinkage long __sys_fork(void);
2727

28-
#define sys_clone __sys_clone
29-
#define sys_clone3 __sys_clone3
30-
#define sys_fork __sys_fork
31-
3228
#endif /* __ASM_OPENRISC_SYSCALLS_H */

arch/openrisc/include/asm/unistd.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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>

arch/openrisc/include/uapi/asm/Kbuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0
2+
syscall-y += unistd_32.h
3+
24
generic-y += ucontext.h

arch/openrisc/include/uapi/asm/unistd.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,4 @@
1717
* (at your option) any later version.
1818
*/
1919

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>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
syscall_abis_32 += or1k time32 stat64 rlimit renameat

arch/openrisc/kernel/sys_call_table.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@
1616

1717
#include <asm/syscalls.h>
1818

19-
#undef __SYSCALL
2019
#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
2126

2227
void *sys_call_table[__NR_syscalls] = {
23-
#include <asm/unistd.h>
28+
#include <asm/syscall_table_32.h>
2429
};

scripts/syscall.tbl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@
299299

300300
244 nios2 cacheflush sys_cacheflush
301301

302+
244 or1k or1k_atomic sys_or1k_atomic
303+
302304
260 time32 wait4 sys_wait4 compat_sys_wait4
303305
260 64 wait4 sys_wait4
304306
261 common prlimit64 sys_prlimit64

0 commit comments

Comments
 (0)