1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_MIPS_KVM_PARA_H
3 #define _ASM_MIPS_KVM_PARA_H
5 #include <uapi/asm/kvm_para.h>
7 #define KVM_HYPERCALL ".word 0x42000028"
12 * Hypercall number is passed in v0.
13 * Return value will be placed in v0.
14 * Up to 3 arguments are passed in a0, a1, and a2.
16 static inline unsigned long kvm_hypercall0(unsigned long num
)
18 register unsigned long n
asm("v0");
19 register unsigned long r
asm("v0");
24 : "=r" (r
) : "r" (n
) : "memory"
30 static inline unsigned long kvm_hypercall1(unsigned long num
,
33 register unsigned long n
asm("v0");
34 register unsigned long r
asm("v0");
35 register unsigned long a0
asm("a0");
41 : "=r" (r
) : "r" (n
), "r" (a0
) : "memory"
47 static inline unsigned long kvm_hypercall2(unsigned long num
,
48 unsigned long arg0
, unsigned long arg1
)
50 register unsigned long n
asm("v0");
51 register unsigned long r
asm("v0");
52 register unsigned long a0
asm("a0");
53 register unsigned long a1
asm("a1");
60 : "=r" (r
) : "r" (n
), "r" (a0
), "r" (a1
) : "memory"
66 static inline unsigned long kvm_hypercall3(unsigned long num
,
67 unsigned long arg0
, unsigned long arg1
, unsigned long arg2
)
69 register unsigned long n
asm("v0");
70 register unsigned long r
asm("v0");
71 register unsigned long a0
asm("a0");
72 register unsigned long a1
asm("a1");
73 register unsigned long a2
asm("a2");
81 : "=r" (r
) : "r" (n
), "r" (a0
), "r" (a1
), "r" (a2
) : "memory"
87 static inline bool kvm_check_and_clear_guest_paused(void)
92 static inline unsigned int kvm_arch_para_features(void)
97 static inline unsigned int kvm_arch_para_hints(void)
102 #ifdef CONFIG_MIPS_PARAVIRT
103 static inline bool kvm_para_available(void)
108 static inline bool kvm_para_available(void)
115 #endif /* _ASM_MIPS_KVM_PARA_H */