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/README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 arch/riscv/user/hwprobe/README.md (limited to 'arch/riscv/user/hwprobe/README.md') diff --git a/arch/riscv/user/hwprobe/README.md b/arch/riscv/user/hwprobe/README.md new file mode 100644 index 0000000..58f09c1 --- /dev/null +++ b/arch/riscv/user/hwprobe/README.md @@ -0,0 +1,36 @@ +The RISC-V support for the Linux kernel has a new system call which is specific +to it, called `hwprobe`. With this system call you can check which features, +extensions, etc. are available on the current machine. + +In order to build this example you need Linux headers for the RISC-V +architecture. You can achieve this in two ways: + +1. Simply install the Linux headers from your distribution if you are already + using a RISC-V machine. +2. Build the Linux kernel and use the `LINUX_HEADERS` environment variable to + point to the headers directory (i.e. the directory produced by `make + headers_install`) + +After that, build it and run it. On a QEMU machine I got the following: + +``` +Supports base extensions I, M, A? yes + +We got back this bit map: 0000001110001101001010000001000100100000000000000000000011111011; which means: + +F, D: OK +C: OK +ZBA: OK +ZBB: OK +ZBS: OK +ZICBOZ: OK +ZBC: OK +ZIHINTNTL: OK +ZFA: OK +ZIHINTPAUSE: OK +ZCA: OK +ZCD: OK +ZAWRS: OK +ZICNTR: OK +ZIHPM: OK +``` -- cgit v1.2.3