xref: /kvm-unit-tests/lib/riscv/asm/sbi.h (revision 9ccb00e4e5514d4dd5b279c8ec6a396875782a0b)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef _ASMRISCV_SBI_H_
3 #define _ASMRISCV_SBI_H_
4 
5 enum sbi_ext_id {
6 	SBI_EXT_BASE = 0x10,
7 	SBI_EXT_SRST = 0x53525354,
8 };
9 
10 enum sbi_ext_base_fid {
11 	SBI_EXT_BASE_GET_SPEC_VERSION = 0,
12 	SBI_EXT_BASE_GET_IMP_ID,
13 	SBI_EXT_BASE_GET_IMP_VERSION,
14 	SBI_EXT_BASE_PROBE_EXT,
15 	SBI_EXT_BASE_GET_MVENDORID,
16 	SBI_EXT_BASE_GET_MARCHID,
17 	SBI_EXT_BASE_GET_MIMPID,
18 };
19 
20 struct sbiret {
21 	long error;
22 	long value;
23 };
24 
25 struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0,
26 			unsigned long arg1, unsigned long arg2,
27 			unsigned long arg3, unsigned long arg4,
28 			unsigned long arg5);
29 
30 void sbi_shutdown(void);
31 
32 #endif /* _ASMRISCV_SBI_H_ */
33