xref: /linux/tools/testing/selftests/kvm/include/riscv/ucall.h (revision f4b0c4b508364fde023e4f7b9f23f7e38c663dfe)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef SELFTEST_KVM_UCALL_H
3 #define SELFTEST_KVM_UCALL_H
4 
5 #include "processor.h"
6 #include "sbi.h"
7 
8 #define UCALL_EXIT_REASON       KVM_EXIT_RISCV_SBI
9 
ucall_arch_init(struct kvm_vm * vm,vm_paddr_t mmio_gpa)10 static inline void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
11 {
12 }
13 
ucall_arch_do_ucall(vm_vaddr_t uc)14 static inline void ucall_arch_do_ucall(vm_vaddr_t uc)
15 {
16 	sbi_ecall(KVM_RISCV_SELFTESTS_SBI_EXT,
17 		  KVM_RISCV_SELFTESTS_SBI_UCALL,
18 		  uc, 0, 0, 0, 0, 0);
19 }
20 
21 #endif
22