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

Commit 26a3b85

Browse files
committed
loongarch: convert to generic syscall table
The uapi/asm/unistd_64.h and asm/syscall_table_64.h headers can now be generated from scripts/syscall.tbl, which makes this consistent with the other architectures that have their own syscall.tbl. Unlike the other architectures using the asm-generic header, loongarch uses none of the deprecated system calls at the moment. 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 36d69c2 commit 26a3b85

File tree

6 files changed

+12
-3
lines changed

6 files changed

+12
-3
lines changed

arch/loongarch/include/asm/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0
2+
syscall-y += syscall_table_64.h
23
generated-y += orc_hash.h
34

45
generic-y += mcs_spinlock.h

arch/loongarch/include/asm/unistd.h

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

99
#include <uapi/asm/unistd.h>
1010

11+
#define __ARCH_WANT_SYS_CLONE
12+
1113
#define NR_syscalls (__NR_syscalls)
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_64.h
3+
24
generic-y += kvm_para.h
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2-
#define __ARCH_WANT_SYS_CLONE
32

4-
#include <asm-generic/unistd.h>
3+
#include <asm/unistd_64.h>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
# No special ABIs on loongarch so far
4+
syscall_abis_64 +=

arch/loongarch/kernel/syscall.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#undef __SYSCALL
2222
#define __SYSCALL(nr, call) [nr] = (call),
23+
#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
2324

2425
SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, unsigned long,
2526
prot, unsigned long, flags, unsigned long, fd, unsigned long, offset)
@@ -32,7 +33,7 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, unsigned long,
3233

3334
void *sys_call_table[__NR_syscalls] = {
3435
[0 ... __NR_syscalls - 1] = sys_ni_syscall,
35-
#include <asm/unistd.h>
36+
#include <asm/syscall_table_64.h>
3637
};
3738

3839
typedef long (*sys_call_fn)(unsigned long, unsigned long,

0 commit comments

Comments
 (0)