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

Commit ef608c5

Browse files
committed
nios2: 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. nios2 has one extra system call that gets added to scripts/syscall.tbl. The time32, stat64, and rlimit 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. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 26a3b85 commit ef608c5

File tree

7 files changed

+26
-17
lines changed

7 files changed

+26
-17
lines changed

arch/nios2/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 += cmpxchg.h
35
generic-y += extable.h
46
generic-y += kvm_para.h

arch/nios2/include/asm/unistd.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+
#ifndef __ASM_UNISTD_H
3+
#define __ASM_UNISTD_H
4+
5+
#include <uapi/asm/unistd.h>
6+
7+
#define __ARCH_WANT_STAT64
8+
#define __ARCH_WANT_SET_GET_RLIMIT
9+
10+
#define __ARCH_BROKEN_SYS_CLONE3
11+
12+
#endif

arch/nios2/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/nios2/include/uapi/asm/unistd.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,4 @@
1616
*
1717
*/
1818

19-
#define sys_mmap2 sys_mmap_pgoff
20-
21-
#define __ARCH_WANT_RENAMEAT
22-
#define __ARCH_WANT_STAT64
23-
#define __ARCH_WANT_SET_GET_RLIMIT
24-
#define __ARCH_WANT_TIME32_SYSCALLS
25-
26-
#define __ARCH_BROKEN_SYS_CLONE3
27-
28-
/* Use the standard ABI for syscalls */
29-
#include <asm-generic/unistd.h>
30-
31-
/* Additional Nios II specific syscalls. */
32-
#define __NR_cacheflush (__NR_arch_specific_syscall)
33-
__SYSCALL(__NR_cacheflush, sys_cacheflush)
19+
#include <asm/unistd_32.h>

arch/nios2/kernel/Makefile.syscalls

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 += nios2 time32 stat64 renameat rlimit

arch/nios2/kernel/syscall_table.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99

1010
#include <asm/syscalls.h>
1111

12-
#undef __SYSCALL
1312
#define __SYSCALL(nr, call) [nr] = (call),
13+
#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
14+
15+
#define sys_mmap2 sys_mmap_pgoff
1416

1517
void *sys_call_table[__NR_syscalls] = {
1618
[0 ... __NR_syscalls-1] = sys_ni_syscall,
17-
#include <asm/unistd.h>
19+
#include <asm/syscall_table_32.h>
1820
};

scripts/syscall.tbl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@
297297
244 csky set_thread_area sys_set_thread_area
298298
245 csky cacheflush sys_cacheflush
299299

300+
244 nios2 cacheflush sys_cacheflush
301+
300302
260 time32 wait4 sys_wait4 compat_sys_wait4
301303
260 64 wait4 sys_wait4
302304
261 common prlimit64 sys_prlimit64

0 commit comments

Comments
 (0)