From: Arnd Bergmann <arnd@kernel.org>
To: linux-arch@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
Masahiro Yamada <masahiroy@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nicolas@fjasle.eu>,
Vineet Gupta <vgupta@kernel.org>,
Russell King <linux@armlinux.org.uk>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, Guo Ren <guoren@kernel.org>,
Brian Cain <bcain@quicinc.com>,
Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>,
Dinh Nguyen <dinguyen@kernel.org>,
Jonas Bonn <jonas@southpole.se>,
Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
Stafford Horne <shorne@gmail.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>, Rich Felker <dalias@libc.org>,
John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
"David S. Miller" <davem@davemloft.net>,
Andreas Larsson <andreas@gaisler.com>,
Christian Brauner <brauner@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-snps-arc@lists.infradead.org,
linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org,
linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev,
linux-openrisc@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: [PATCH 12/17] csky: convert to generic syscall table
Date: Thu, 4 Jul 2024 16:36:06 +0200 [thread overview]
Message-ID: <20240704143611.2979589-13-arnd@kernel.org> (raw)
In-Reply-To: <20240704143611.2979589-1-arnd@kernel.org>
From: Arnd Bergmann <arnd@arndb.de>
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.
csky has two architecture specific system calls, which I add to
the generic table. 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/csky 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>
---
arch/csky/include/asm/Kbuild | 2 ++
arch/csky/include/asm/unistd.h | 3 +++
arch/csky/include/uapi/asm/Kbuild | 2 ++
arch/csky/include/uapi/asm/unistd.h | 14 ++------------
arch/csky/kernel/Makefile.syscalls | 4 ++++
arch/csky/kernel/syscall_table.c | 4 +++-
scripts/syscall.tbl | 4 ++++
7 files changed, 20 insertions(+), 13 deletions(-)
create mode 100644 arch/csky/kernel/Makefile.syscalls
diff --git a/arch/csky/include/asm/Kbuild b/arch/csky/include/asm/Kbuild
index 13ebc5e34360..9a9bc65b57a9 100644
--- a/arch/csky/include/asm/Kbuild
+++ b/arch/csky/include/asm/Kbuild
@@ -1,4 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
+syscall-y := syscall_table_32.h
+
generic-y += asm-offsets.h
generic-y += extable.h
generic-y += kvm_para.h
diff --git a/arch/csky/include/asm/unistd.h b/arch/csky/include/asm/unistd.h
index 9cf97de9a26d..2c2c24de95d8 100644
--- a/arch/csky/include/asm/unistd.h
+++ b/arch/csky/include/asm/unistd.h
@@ -2,4 +2,7 @@
#include <uapi/asm/unistd.h>
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_CLONE
+
#define NR_syscalls (__NR_syscalls)
diff --git a/arch/csky/include/uapi/asm/Kbuild b/arch/csky/include/uapi/asm/Kbuild
index e78470141932..2501e82a1a0a 100644
--- a/arch/csky/include/uapi/asm/Kbuild
+++ b/arch/csky/include/uapi/asm/Kbuild
@@ -1,2 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
+syscall-y += unistd_32.h
+
generic-y += ucontext.h
diff --git a/arch/csky/include/uapi/asm/unistd.h b/arch/csky/include/uapi/asm/unistd.h
index d529d0432876..794adbc04e48 100644
--- a/arch/csky/include/uapi/asm/unistd.h
+++ b/arch/csky/include/uapi/asm/unistd.h
@@ -1,14 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#define __ARCH_WANT_STAT64
-#define __ARCH_WANT_NEW_STAT
-#define __ARCH_WANT_SYS_CLONE
-#define __ARCH_WANT_SET_GET_RLIMIT
-#define __ARCH_WANT_TIME32_SYSCALLS
-#define __ARCH_WANT_SYNC_FILE_RANGE2
-#include <asm-generic/unistd.h>
-
-#define __NR_set_thread_area (__NR_arch_specific_syscall + 0)
-__SYSCALL(__NR_set_thread_area, sys_set_thread_area)
-#define __NR_cacheflush (__NR_arch_specific_syscall + 1)
-__SYSCALL(__NR_cacheflush, sys_cacheflush)
+#include <asm/unistd_32.h>
+#define __NR_sync_file_range2 __NR_sync_file_range
diff --git a/arch/csky/kernel/Makefile.syscalls b/arch/csky/kernel/Makefile.syscalls
new file mode 100644
index 000000000000..3df3b5822fce
--- /dev/null
+++ b/arch/csky/kernel/Makefile.syscalls
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+
+syscall_abis_32 += csky time32 stat64 rlimit
+
diff --git a/arch/csky/kernel/syscall_table.c b/arch/csky/kernel/syscall_table.c
index a0c238c5377a..a6eb91a0e2f6 100644
--- a/arch/csky/kernel/syscall_table.c
+++ b/arch/csky/kernel/syscall_table.c
@@ -6,9 +6,11 @@
#undef __SYSCALL
#define __SYSCALL(nr, call)[nr] = (call),
+#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
#define sys_fadvise64_64 sys_csky_fadvise64_64
+#define sys_sync_file_range sys_sync_file_range2
void * const sys_call_table[__NR_syscalls] __page_aligned_data = {
[0 ... __NR_syscalls - 1] = sys_ni_syscall,
-#include <asm/unistd.h>
+#include <asm/syscall_table_32.h>
};
diff --git a/scripts/syscall.tbl b/scripts/syscall.tbl
index 13f4c79ba5c2..ed0ecba8fea4 100644
--- a/scripts/syscall.tbl
+++ b/scripts/syscall.tbl
@@ -293,6 +293,10 @@
246 arc arc_gettls sys_arc_gettls
247 arc sysfs sys_sysfs
248 arc arc_usr_cmpxchg sys_arc_usr_cmpxchg
+
+244 csky set_thread_area sys_set_thread_area
+245 csky cacheflush sys_cacheflush
+
260 time32 wait4 sys_wait4 compat_sys_wait4
260 64 wait4 sys_wait4
261 common prlimit64 sys_prlimit64
--
2.39.2
next prev parent reply other threads:[~2024-07-04 14:38 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-04 14:35 [PATCH 00/17] arch: convert everything to syscall.tbl Arnd Bergmann
2024-07-04 14:35 ` [PATCH 01/17] syscalls: add generic scripts/syscall.tbl Arnd Bergmann
2024-07-12 8:43 ` Masahiro Yamada
2024-07-12 9:07 ` Arnd Bergmann
2024-07-04 14:35 ` [PATCH 02/17] csky: drop asm/gpio.h wrapper Arnd Bergmann
2024-07-08 9:17 ` Guo Ren
2024-07-11 15:48 ` Masahiro Yamada
2024-07-16 1:09 ` Guo Ren
2024-07-04 14:35 ` [PATCH 03/17] um: don't generate asm/bpf_perf_event.h Arnd Bergmann
2024-07-05 12:26 ` Stephen Rothwell
2024-07-12 8:37 ` Masahiro Yamada
2024-07-12 9:13 ` Arnd Bergmann
2024-07-04 14:35 ` [PATCH 04/17] loongarch: avoid generating extra header files Arnd Bergmann
2024-07-04 14:35 ` [PATCH 05/17] kbuild: verify asm-generic header list Arnd Bergmann
2024-07-04 14:36 ` [PATCH 06/17] kbuild: add syscall table generation to scripts/Makefile.asm-headers Arnd Bergmann
2024-07-04 14:36 ` [PATCH 07/17] clone3: drop __ARCH_WANT_SYS_CLONE3 macro Arnd Bergmann
2024-07-05 8:12 ` Geert Uytterhoeven
2024-07-04 14:36 ` [PATCH 08/17] arc: convert to generic syscall table Arnd Bergmann
2024-07-04 14:36 ` [PATCH 09/17] arm64: convert unistd_32.h to syscall.tbl format Arnd Bergmann
2024-07-05 12:10 ` Catalin Marinas
2024-07-04 14:36 ` [PATCH 10/17] arm64: generate 64-bit syscall.tbl Arnd Bergmann
2024-07-05 12:10 ` Catalin Marinas
2024-07-09 17:23 ` Mark Brown
2024-07-10 8:57 ` Arnd Bergmann
2024-07-10 13:08 ` Mark Brown
2024-07-04 14:36 ` [PATCH 11/17] arm64: rework compat syscall macros Arnd Bergmann
2024-07-05 12:11 ` Catalin Marinas
2024-07-04 14:36 ` Arnd Bergmann [this message]
2024-07-10 10:27 ` [PATCH 12/17] csky: convert to generic syscall table Arnd Bergmann
2024-07-14 17:22 ` Guo Ren
2024-07-04 14:36 ` [PATCH 13/17] hexagon: use new system call table Arnd Bergmann
2024-07-04 14:36 ` [PATCH 14/17] loongarch: convert to generic syscall table Arnd Bergmann
2024-07-04 14:36 ` [PATCH 15/17] nios2: " Arnd Bergmann
2024-07-04 14:36 ` [PATCH 16/17] openrisc: " Arnd Bergmann
2024-07-04 14:36 ` [PATCH 17/17] riscv: " Arnd Bergmann
2024-07-05 10:18 ` [PATCH 00/17] arch: convert everything to syscall.tbl Maciej W. Rozycki
2024-07-05 10:29 ` Arnd Bergmann
2024-07-23 12:58 ` patchwork-bot+linux-riscv
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240704143611.2979589-13-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=andreas@gaisler.com \
--cc=aou@eecs.berkeley.edu \
--cc=arnd@arndb.de \
--cc=bcain@quicinc.com \
--cc=brauner@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@kernel.org \
--cc=dalias@libc.org \
--cc=davem@davemloft.net \
--cc=dinguyen@kernel.org \
--cc=glaubitz@physik.fu-berlin.de \
--cc=guoren@kernel.org \
--cc=jonas@southpole.se \
--cc=kernel@xen0n.name \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-csky@vger.kernel.org \
--cc=linux-hexagon@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-openrisc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=loongarch@lists.linux.dev \
--cc=mark.rutland@arm.com \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=nicolas@fjasle.eu \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=shorne@gmail.com \
--cc=stefan.kristiansson@saunalahti.fi \
--cc=vgupta@kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).