* [PATCH] testsuite/init_module: Handle __NR_riscv_hwprobe in syscall wrapper
@ 2025-06-30 14:21 Andreas Schwab
0 siblings, 0 replies; only message in thread
From: Andreas Schwab @ 2025-06-30 14:21 UTC (permalink / raw)
To: linux-modules
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."
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-06-30 14:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-30 14:21 [PATCH] testsuite/init_module: Handle __NR_riscv_hwprobe in syscall wrapper Andreas Schwab
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).