summaryrefslogtreecommitdiffstats
path: root/arch/riscv/include/asm/syscall.h
diff options
context:
space:
mode:
authorEvan Green <evan@rivosinc.com>2023-04-08 01:10:59 +0200
committerPalmer Dabbelt <palmer@rivosinc.com>2023-04-19 00:48:14 +0200
commitea3de9ce8aa280c5175c835bd3e94a3a9b814b74 (patch)
tree835575d48af67ab432d8e3497d9156538f8e6668 /arch/riscv/include/asm/syscall.h
parentRISC-V: Move struct riscv_cpuinfo to new header (diff)
downloadlinux-ea3de9ce8aa280c5175c835bd3e94a3a9b814b74.tar.xz
linux-ea3de9ce8aa280c5175c835bd3e94a3a9b814b74.zip
RISC-V: Add a syscall for HW probing
We don't have enough space for these all in ELF_HWCAP{,2} and there's no system call that quite does this, so let's just provide an arch-specific one to probe for hardware capabilities. This currently just provides m{arch,imp,vendor}id, but with the key-value pairs we can pass more in the future. Co-developed-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Evan Green <evan@rivosinc.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Heiko Stuebner <heiko.stuebner@vrull.eu> Tested-by: Heiko Stuebner <heiko.stuebner@vrull.eu> Reviewed-by: Paul Walmsley <paul.walmsley@sifive.com> Link: https://lore.kernel.org/r/20230407231103.2622178-3-evan@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/include/asm/syscall.h')
-rw-r--r--arch/riscv/include/asm/syscall.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/syscall.h b/arch/riscv/include/asm/syscall.h
index 384a63b86420..3b5a667928bf 100644
--- a/arch/riscv/include/asm/syscall.h
+++ b/arch/riscv/include/asm/syscall.h
@@ -10,6 +10,7 @@
#ifndef _ASM_RISCV_SYSCALL_H
#define _ASM_RISCV_SYSCALL_H
+#include <asm/hwprobe.h>
#include <uapi/linux/audit.h>
#include <linux/sched.h>
#include <linux/err.h>
@@ -75,4 +76,7 @@ static inline int syscall_get_arch(struct task_struct *task)
}
asmlinkage long sys_riscv_flush_icache(uintptr_t, uintptr_t, uintptr_t);
+
+asmlinkage long sys_riscv_hwprobe(struct riscv_hwprobe *, size_t, size_t,
+ unsigned long *, unsigned int);
#endif /* _ASM_RISCV_SYSCALL_H */