linux/tools/testing/selftests/riscv/hwprobe/sys_hwprobe.S
Evan Green 287dcc2b0c
selftests: Test the new RISC-V hwprobe interface
This adds a test for the recently added RISC-V interface for probing
hardware capabilities.  It happens to be the first selftest we have for
RISC-V, so I've added some infrastructure for those as well.

Co-developed-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Evan Green <evan@rivosinc.com>
Link: https://lore.kernel.org/r/20230407231103.2622178-6-evan@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-04-18 15:48:17 -07:00

12 lines
322 B
ArmAsm

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2023 Rivos, Inc */
.text
.global riscv_hwprobe
riscv_hwprobe:
# Put __NR_riscv_hwprobe in the syscall number register, then just shim
# back the kernel's return. This doesn't do any sort of errno
# handling, the caller can deal with it.
li a7, 258
ecall
ret