From: Andreas Schwab <schwab@suse.de>
To: linux-modules@vger.kernel.org
Subject: [PATCH] testsuite/init_module: Handle __NR_riscv_hwprobe in syscall wrapper
Date: Mon, 30 Jun 2025 16:21:11 +0200 [thread overview]
Message-ID: <mvmms9p2tuw.fsf@suse.de> (raw)
The libcrypto library constructor calls the riscv_hwprobe syscall through
the syscall wrapper. Forward it to the __riscv_hwprobe function.
Signed-off-by: Andreas Schwab <schwab@suse.de>
---
testsuite/init_module.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/testsuite/init_module.c b/testsuite/init_module.c
index 8ff2699..3516c1d 100644
--- a/testsuite/init_module.c
+++ b/testsuite/init_module.c
@@ -26,6 +26,9 @@
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/utsname.h>
+#ifdef __riscv
+#include <sys/hwprobe.h>
+#endif
#include <shared/util.h>
@@ -370,6 +373,24 @@ TS_EXPORT long int syscall(long int __sysno, ...)
return nextlib_syscall(__NR_gettid);
}
+#ifdef __NR_riscv_hwprobe
+ if (__sysno == __NR_riscv_hwprobe) {
+ struct riscv_hwprobe *pairs;
+ size_t pair_count, cpusetsize;
+ unsigned long int *cpus;
+ unsigned int flags;
+
+ va_start (ap, __sysno);
+ pairs = va_arg (ap, struct riscv_hwprobe *);
+ pair_count = va_arg (ap, size_t);
+ cpusetsize = va_arg (ap, size_t);
+ cpus = va_arg (ap, unsigned long int *);
+ flags = va_arg (ap, unsigned int);
+
+ return __riscv_hwprobe (pairs, pair_count, cpusetsize, cpus, flags);
+ }
+#endif
+
/*
* FIXME: no way to call the libc function due since this is a
* variadic argument function and we don't have a vsyscall() variant
--
2.50.0
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
reply other threads:[~2025-06-30 14:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=mvmms9p2tuw.fsf@suse.de \
--to=schwab@suse.de \
--cc=linux-modules@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.