This source file includes following definitions.
- kvm_hypercall0
- kvm_hypercall1
- kvm_hypercall2
- kvm_hypercall3
- kvm_check_and_clear_guest_paused
- kvm_arch_para_features
- kvm_arch_para_hints
- kvm_para_available
- kvm_para_available
1
2 #ifndef _ASM_MIPS_KVM_PARA_H
3 #define _ASM_MIPS_KVM_PARA_H
4
5 #include <uapi/asm/kvm_para.h>
6
7 #define KVM_HYPERCALL ".word 0x42000028"
8
9
10
11
12
13
14
15
16 static inline unsigned long kvm_hypercall0(unsigned long num)
17 {
18 register unsigned long n asm("v0");
19 register unsigned long r asm("v0");
20
21 n = num;
22 __asm__ __volatile__(
23 KVM_HYPERCALL
24 : "=r" (r) : "r" (n) : "memory"
25 );
26
27 return r;
28 }
29
30 static inline unsigned long kvm_hypercall1(unsigned long num,
31 unsigned long arg0)
32 {
33 register unsigned long n asm("v0");
34 register unsigned long r asm("v0");
35 register unsigned long a0 asm("a0");
36
37 n = num;
38 a0 = arg0;
39 __asm__ __volatile__(
40 KVM_HYPERCALL
41 : "=r" (r) : "r" (n), "r" (a0) : "memory"
42 );
43
44 return r;
45 }
46
47 static inline unsigned long kvm_hypercall2(unsigned long num,
48 unsigned long arg0, unsigned long arg1)
49 {
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");
54
55 n = num;
56 a0 = arg0;
57 a1 = arg1;
58 __asm__ __volatile__(
59 KVM_HYPERCALL
60 : "=r" (r) : "r" (n), "r" (a0), "r" (a1) : "memory"
61 );
62
63 return r;
64 }
65
66 static inline unsigned long kvm_hypercall3(unsigned long num,
67 unsigned long arg0, unsigned long arg1, unsigned long arg2)
68 {
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");
74
75 n = num;
76 a0 = arg0;
77 a1 = arg1;
78 a2 = arg2;
79 __asm__ __volatile__(
80 KVM_HYPERCALL
81 : "=r" (r) : "r" (n), "r" (a0), "r" (a1), "r" (a2) : "memory"
82 );
83
84 return r;
85 }
86
87 static inline bool kvm_check_and_clear_guest_paused(void)
88 {
89 return false;
90 }
91
92 static inline unsigned int kvm_arch_para_features(void)
93 {
94 return 0;
95 }
96
97 static inline unsigned int kvm_arch_para_hints(void)
98 {
99 return 0;
100 }
101
102 #ifdef CONFIG_MIPS_PARAVIRT
103 static inline bool kvm_para_available(void)
104 {
105 return true;
106 }
107 #else
108 static inline bool kvm_para_available(void)
109 {
110 return false;
111 }
112 #endif
113
114
115 #endif