[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20260117-nolibc-mysyscall-riscv-v1-1-0ae1ae3513e9@weissschuh.net>
Date: Sat, 17 Jan 2026 12:27:46 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Shuah Khan <shuah@...nel.org>, Paul Walmsley <pjw@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
Alexandre Ghiti <alex@...ti.fr>
Cc: linux-kselftest@...r.kernel.org, linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH] selftests: riscv: vstate_exec_nolibc: Use the regular
prctl() function
The my_syscall*() macros are internal implementation details of nolibc.
Now that nolibc has a normal prctl() function, use that.
Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
---
Compile-tested only.
For the riscv tree.
I want to rename those macros at some point.
---
tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c b/tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c
index 7b7d6f21acb4..12f1b1b1c7aa 100644
--- a/tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c
+++ b/tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c
@@ -16,10 +16,10 @@ int main(int argc, char **argv)
if (argc > 2 && strcmp(argv[2], "x"))
xtheadvector = 1;
- ctrl = my_syscall1(__NR_prctl, PR_RISCV_V_GET_CONTROL);
- if (ctrl < 0) {
+ ctrl = prctl(PR_RISCV_V_GET_CONTROL, 0, 0, 0, 0);
+ if (ctrl == -1) {
puts("PR_RISCV_V_GET_CONTROL is not supported\n");
- return ctrl;
+ exit(-1);
}
if (test_inherit) {
@@ -51,7 +51,7 @@ int main(int argc, char **argv)
}
if (!pid) {
- rc = my_syscall1(__NR_prctl, PR_RISCV_V_GET_CONTROL);
+ rc = prctl(PR_RISCV_V_GET_CONTROL, 0, 0, 0, 0);
if (rc != ctrl) {
puts("child's vstate_ctrl not equal to parent's\n");
exit(-1);
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20260117-nolibc-mysyscall-riscv-893859590fbb
Best regards,
--
Thomas Weißschuh <linux@...ssschuh.net>
Powered by blists - more mailing lists