1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef __S390_KVM_PARA_H
14#define __S390_KVM_PARA_H
15
16#ifdef __KERNEL__
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33static inline long kvm_hypercall0(unsigned long nr)
34{
35 register unsigned long __nr asm("1") = nr;
36 register long __rc asm("2");
37
38 asm volatile ("diag 2,4,0x500\n"
39 : "=d" (__rc) : "d" (__nr): "memory", "cc");
40 return __rc;
41}
42
43static inline long kvm_hypercall1(unsigned long nr, unsigned long p1)
44{
45 register unsigned long __nr asm("1") = nr;
46 register unsigned long __p1 asm("2") = p1;
47 register long __rc asm("2");
48
49 asm volatile ("diag 2,4,0x500\n"
50 : "=d" (__rc) : "d" (__nr), "0" (__p1) : "memory", "cc");
51 return __rc;
52}
53
54static inline long kvm_hypercall2(unsigned long nr, unsigned long p1,
55 unsigned long p2)
56{
57 register unsigned long __nr asm("1") = nr;
58 register unsigned long __p1 asm("2") = p1;
59 register unsigned long __p2 asm("3") = p2;
60 register long __rc asm("2");
61
62 asm volatile ("diag 2,4,0x500\n"
63 : "=d" (__rc) : "d" (__nr), "0" (__p1), "d" (__p2)
64 : "memory", "cc");
65 return __rc;
66}
67
68static inline long kvm_hypercall3(unsigned long nr, unsigned long p1,
69 unsigned long p2, unsigned long p3)
70{
71 register unsigned long __nr asm("1") = nr;
72 register unsigned long __p1 asm("2") = p1;
73 register unsigned long __p2 asm("3") = p2;
74 register unsigned long __p3 asm("4") = p3;
75 register long __rc asm("2");
76
77 asm volatile ("diag 2,4,0x500\n"
78 : "=d" (__rc) : "d" (__nr), "0" (__p1), "d" (__p2),
79 "d" (__p3) : "memory", "cc");
80 return __rc;
81}
82
83
84static inline long kvm_hypercall4(unsigned long nr, unsigned long p1,
85 unsigned long p2, unsigned long p3,
86 unsigned long p4)
87{
88 register unsigned long __nr asm("1") = nr;
89 register unsigned long __p1 asm("2") = p1;
90 register unsigned long __p2 asm("3") = p2;
91 register unsigned long __p3 asm("4") = p3;
92 register unsigned long __p4 asm("5") = p4;
93 register long __rc asm("2");
94
95 asm volatile ("diag 2,4,0x500\n"
96 : "=d" (__rc) : "d" (__nr), "0" (__p1), "d" (__p2),
97 "d" (__p3), "d" (__p4) : "memory", "cc");
98 return __rc;
99}
100
101static inline long kvm_hypercall5(unsigned long nr, unsigned long p1,
102 unsigned long p2, unsigned long p3,
103 unsigned long p4, unsigned long p5)
104{
105 register unsigned long __nr asm("1") = nr;
106 register unsigned long __p1 asm("2") = p1;
107 register unsigned long __p2 asm("3") = p2;
108 register unsigned long __p3 asm("4") = p3;
109 register unsigned long __p4 asm("5") = p4;
110 register unsigned long __p5 asm("6") = p5;
111 register long __rc asm("2");
112
113 asm volatile ("diag 2,4,0x500\n"
114 : "=d" (__rc) : "d" (__nr), "0" (__p1), "d" (__p2),
115 "d" (__p3), "d" (__p4), "d" (__p5) : "memory", "cc");
116 return __rc;
117}
118
119static inline long kvm_hypercall6(unsigned long nr, unsigned long p1,
120 unsigned long p2, unsigned long p3,
121 unsigned long p4, unsigned long p5,
122 unsigned long p6)
123{
124 register unsigned long __nr asm("1") = nr;
125 register unsigned long __p1 asm("2") = p1;
126 register unsigned long __p2 asm("3") = p2;
127 register unsigned long __p3 asm("4") = p3;
128 register unsigned long __p4 asm("5") = p4;
129 register unsigned long __p5 asm("6") = p5;
130 register unsigned long __p6 asm("7") = p6;
131 register long __rc asm("2");
132
133 asm volatile ("diag 2,4,0x500\n"
134 : "=d" (__rc) : "d" (__nr), "0" (__p1), "d" (__p2),
135 "d" (__p3), "d" (__p4), "d" (__p5), "d" (__p6)
136 : "memory", "cc");
137 return __rc;
138}
139
140
141static inline int kvm_para_available(void)
142{
143 return 1;
144}
145
146
147static inline unsigned int kvm_arch_para_features(void)
148{
149 return 0;
150}
151
152#endif
153
154#endif
155