From 1de9228fda28826c337ac09201586de1f2f248b9 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 22 Apr 2025 21:29:06 +0200 Subject: riscv: user: Force LINUX_HEADERS on hwprobe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- arch/riscv/user/hwprobe/probe.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'arch/riscv/user/hwprobe/probe.c') diff --git a/arch/riscv/user/hwprobe/probe.c b/arch/riscv/user/hwprobe/probe.c index de2c209..70206f2 100644 --- a/arch/riscv/user/hwprobe/probe.c +++ b/arch/riscv/user/hwprobe/probe.c @@ -1,19 +1,21 @@ #define _GNU_SOURCE -#include -#include #include #include #include #include #include -#define NR_RISCV_HWPROBE 258 +#include +#include +#include +#ifndef RISCV_HWPROBE_EXT_ZICNTR // Merged in Linux v6.15. // See 4458b8f68dc7 ("riscv: hwprobe: export Zicntr and Zihpm extensions"). #define RISCV_HWPROBE_EXT_ZICNTR (1ULL << 50) #define RISCV_HWPROBE_EXT_ZIHPM (1ULL << 51) +#endif #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr)[0]) @@ -253,7 +255,7 @@ int main() pairs = (struct riscv_hwprobe){ .key = RISCV_HWPROBE_KEY_BASE_BEHAVIOR, }; - rc = syscall(NR_RISCV_HWPROBE, &pairs, 1, 0, NULL, 0); + rc = syscall(__NR_riscv_hwprobe, &pairs, 1, 0, NULL, 0); if (rc) { perror("could not fetch the base behavior for the system"); exit(EXIT_FAILURE); @@ -265,7 +267,7 @@ int main() pairs = (struct riscv_hwprobe){ .key = RISCV_HWPROBE_KEY_IMA_EXT_0, }; - rc = syscall(NR_RISCV_HWPROBE, &pairs, 1, 0, NULL, 0); + rc = syscall(__NR_riscv_hwprobe, &pairs, 1, 0, NULL, 0); if (rc) { perror("could not fetch extensions as given by hwprobe"); exit(EXIT_FAILURE); -- cgit v1.2.3