]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
loongarch: convert to generic syscall table
authorArnd Bergmann <arnd@arndb.de>
Tue, 23 Apr 2024 15:41:56 +0000 (17:41 +0200)
committerArnd Bergmann <arnd@arndb.de>
Wed, 10 Jul 2024 12:23:38 +0000 (14:23 +0200)
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>
arch/loongarch/include/asm/Kbuild
arch/loongarch/include/asm/unistd.h
arch/loongarch/include/uapi/asm/Kbuild
arch/loongarch/include/uapi/asm/unistd.h
arch/loongarch/kernel/Makefile.syscalls [new file with mode: 0644]
arch/loongarch/kernel/syscall.c

index 0db5ad14f014ad2b04e4d89c06d7b1745b347602..2bb3676429c05259f7cc61e0250f8dec04e66478 100644 (file)
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
+syscall-y += syscall_table_64.h
 generated-y += orc_hash.h
 
 generic-y += mcs_spinlock.h
index cfddb0116a8cee504339fba6e537e48608e66ce6..fc0a481a7416bb241a64e1a7ee2912c8d72610cb 100644 (file)
@@ -8,4 +8,6 @@
 
 #include <uapi/asm/unistd.h>
 
+#define __ARCH_WANT_SYS_CLONE
+
 #define NR_syscalls (__NR_syscalls)
index 4aa680ca2e5fdf6407f8692264599da101d46ab3..c6d141d7b7d734c09d339e19834ab5ee3cd158e2 100644 (file)
@@ -1,2 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
+syscall-y += unistd_64.h
+
 generic-y += kvm_para.h
index 191614b9b207360750cea3b9eef982d08e27c336..1f01980f9c94826957c9729c09c550cd090e4850 100644 (file)
@@ -1,4 +1,3 @@
 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#define __ARCH_WANT_SYS_CLONE
 
-#include <asm-generic/unistd.h>
+#include <asm/unistd_64.h>
diff --git a/arch/loongarch/kernel/Makefile.syscalls b/arch/loongarch/kernel/Makefile.syscalls
new file mode 100644 (file)
index 0000000..ab7d9ba
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+
+# No special ABIs on loongarch so far
+syscall_abis_64 +=
index 8801611143ab3468da11d201be604a1c5ce73f7b..ec17cd5163b7c40a92caa6788a072f064c9bc760 100644 (file)
@@ -20,6 +20,7 @@
 
 #undef __SYSCALL
 #define __SYSCALL(nr, call)    [nr] = (call),
+#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
 
 SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, unsigned long,
                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,
 
 void *sys_call_table[__NR_syscalls] = {
        [0 ... __NR_syscalls - 1] = sys_ni_syscall,
-#include <asm/unistd.h>
+#include <asm/syscall_table_64.h>
 };
 
 typedef long (*sys_call_fn)(unsigned long, unsigned long,