xref: /openbmc/linux/arch/riscv/include/uapi/asm/hwprobe.h (revision 00e76e2c)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  * Copyright 2023 Rivos, Inc
4  */
5 
6 #ifndef _UAPI_ASM_HWPROBE_H
7 #define _UAPI_ASM_HWPROBE_H
8 
9 #include <linux/types.h>
10 
11 /*
12  * Interface for probing hardware capabilities from userspace, see
13  * Documentation/riscv/hwprobe.rst for more information.
14  */
15 struct riscv_hwprobe {
16 	__s64 key;
17 	__u64 value;
18 };
19 
20 #define RISCV_HWPROBE_KEY_MVENDORID	0
21 #define RISCV_HWPROBE_KEY_MARCHID	1
22 #define RISCV_HWPROBE_KEY_MIMPID	2
23 #define RISCV_HWPROBE_KEY_BASE_BEHAVIOR	3
24 #define		RISCV_HWPROBE_BASE_BEHAVIOR_IMA	(1 << 0)
25 #define RISCV_HWPROBE_KEY_IMA_EXT_0	4
26 #define		RISCV_HWPROBE_IMA_FD		(1 << 0)
27 #define		RISCV_HWPROBE_IMA_C		(1 << 1)
28 /* Increase RISCV_HWPROBE_MAX_KEY when adding items. */
29 
30 #endif
31