hypercalls.h revision 1.1.2.1 1 1.1.2.1 bouyer /* $NetBSD: hypercalls.h,v 1.1.2.1 2020/04/16 08:46:34 bouyer Exp $ */
2 1.1.2.1 bouyer /******************************************************************************
3 1.1.2.1 bouyer * hypercall.h
4 1.1.2.1 bouyer *
5 1.1.2.1 bouyer * Linux-specific hypervisor handling.
6 1.1.2.1 bouyer *
7 1.1.2.1 bouyer * Copyright (c) 2002-2004, K A Fraser
8 1.1.2.1 bouyer *
9 1.1.2.1 bouyer * 64-bit updates:
10 1.1.2.1 bouyer * Benjamin Liu <benjamin.liu (at) intel.com>
11 1.1.2.1 bouyer * Jun Nakajima <jun.nakajima (at) intel.com>
12 1.1.2.1 bouyer *
13 1.1.2.1 bouyer * This program is free software; you can redistribute it and/or
14 1.1.2.1 bouyer * modify it under the terms of the GNU General Public License version 2
15 1.1.2.1 bouyer * as published by the Free Software Foundation; or, when distributed
16 1.1.2.1 bouyer * separately from the Linux kernel or incorporated into other
17 1.1.2.1 bouyer * software packages, subject to the following license:
18 1.1.2.1 bouyer *
19 1.1.2.1 bouyer * Permission is hereby granted, free of charge, to any person obtaining a copy
20 1.1.2.1 bouyer * of this source file (the "Software"), to deal in the Software without
21 1.1.2.1 bouyer * restriction, including without limitation the rights to use, copy, modify,
22 1.1.2.1 bouyer * merge, publish, distribute, sublicense, and/or sell copies of the Software,
23 1.1.2.1 bouyer * and to permit persons to whom the Software is furnished to do so, subject to
24 1.1.2.1 bouyer * the following conditions:
25 1.1.2.1 bouyer *
26 1.1.2.1 bouyer * The above copyright notice and this permission notice shall be included in
27 1.1.2.1 bouyer * all copies or substantial portions of the Software.
28 1.1.2.1 bouyer *
29 1.1.2.1 bouyer * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 1.1.2.1 bouyer * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 1.1.2.1 bouyer * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 1.1.2.1 bouyer * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33 1.1.2.1 bouyer * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
34 1.1.2.1 bouyer * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
35 1.1.2.1 bouyer * IN THE SOFTWARE.
36 1.1.2.1 bouyer */
37 1.1.2.1 bouyer
38 1.1.2.1 bouyer #ifndef __HYPERCALL_H__
39 1.1.2.1 bouyer #define __HYPERCALL_H__
40 1.1.2.1 bouyer
41 1.1.2.1 bouyer #define __STR(x) #x
42 1.1.2.1 bouyer #define STR(x) __STR(x)
43 1.1.2.1 bouyer
44 1.1.2.1 bouyer #define HYPERCALL_STR(name) \
45 1.1.2.1 bouyer "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"
46 1.1.2.1 bouyer
47 1.1.2.1 bouyer #define _hypercall0(type, name) \
48 1.1.2.1 bouyer ({ \
49 1.1.2.1 bouyer long __res; \
50 1.1.2.1 bouyer asm volatile ( \
51 1.1.2.1 bouyer HYPERCALL_STR(name) \
52 1.1.2.1 bouyer : "=a" (__res) \
53 1.1.2.1 bouyer : \
54 1.1.2.1 bouyer : "memory" ); \
55 1.1.2.1 bouyer (type)__res; \
56 1.1.2.1 bouyer })
57 1.1.2.1 bouyer
58 1.1.2.1 bouyer #define _hypercall1(type, name, a1) \
59 1.1.2.1 bouyer ({ \
60 1.1.2.1 bouyer long __res, __ign1; \
61 1.1.2.1 bouyer asm volatile ( \
62 1.1.2.1 bouyer HYPERCALL_STR(name) \
63 1.1.2.1 bouyer : "=a" (__res), "=D" (__ign1) \
64 1.1.2.1 bouyer : "1" ((long)(a1)) \
65 1.1.2.1 bouyer : "memory" ); \
66 1.1.2.1 bouyer (type)__res; \
67 1.1.2.1 bouyer })
68 1.1.2.1 bouyer
69 1.1.2.1 bouyer #define _hypercall2(type, name, a1, a2) \
70 1.1.2.1 bouyer ({ \
71 1.1.2.1 bouyer long __res, __ign1, __ign2; \
72 1.1.2.1 bouyer asm volatile ( \
73 1.1.2.1 bouyer HYPERCALL_STR(name) \
74 1.1.2.1 bouyer : "=a" (__res), "=D" (__ign1), "=S" (__ign2) \
75 1.1.2.1 bouyer : "1" ((long)(a1)), "2" ((long)(a2)) \
76 1.1.2.1 bouyer : "memory" ); \
77 1.1.2.1 bouyer (type)__res; \
78 1.1.2.1 bouyer })
79 1.1.2.1 bouyer
80 1.1.2.1 bouyer #define _hypercall3(type, name, a1, a2, a3) \
81 1.1.2.1 bouyer ({ \
82 1.1.2.1 bouyer long __res, __ign1, __ign2, __ign3; \
83 1.1.2.1 bouyer asm volatile ( \
84 1.1.2.1 bouyer HYPERCALL_STR(name) \
85 1.1.2.1 bouyer : "=a" (__res), "=D" (__ign1), "=S" (__ign2), \
86 1.1.2.1 bouyer "=d" (__ign3) \
87 1.1.2.1 bouyer : "1" ((long)(a1)), "2" ((long)(a2)), \
88 1.1.2.1 bouyer "3" ((long)(a3)) \
89 1.1.2.1 bouyer : "memory" ); \
90 1.1.2.1 bouyer (type)__res; \
91 1.1.2.1 bouyer })
92 1.1.2.1 bouyer
93 1.1.2.1 bouyer #define _hypercall4(type, name, a1, a2, a3, a4) \
94 1.1.2.1 bouyer ({ \
95 1.1.2.1 bouyer long __res, __ign1, __ign2, __ign3; \
96 1.1.2.1 bouyer asm volatile ( \
97 1.1.2.1 bouyer "movq %7,%%r10; " \
98 1.1.2.1 bouyer HYPERCALL_STR(name) \
99 1.1.2.1 bouyer : "=a" (__res), "=D" (__ign1), "=S" (__ign2), \
100 1.1.2.1 bouyer "=d" (__ign3) \
101 1.1.2.1 bouyer : "1" ((long)(a1)), "2" ((long)(a2)), \
102 1.1.2.1 bouyer "3" ((long)(a3)), "g" ((long)(a4)) \
103 1.1.2.1 bouyer : "memory", "r10" ); \
104 1.1.2.1 bouyer (type)__res; \
105 1.1.2.1 bouyer })
106 1.1.2.1 bouyer
107 1.1.2.1 bouyer #define _hypercall5(type, name, a1, a2, a3, a4, a5) \
108 1.1.2.1 bouyer ({ \
109 1.1.2.1 bouyer long __res, __ign1, __ign2, __ign3; \
110 1.1.2.1 bouyer asm volatile ( \
111 1.1.2.1 bouyer "movq %7,%%r10; movq %8,%%r8; " \
112 1.1.2.1 bouyer HYPERCALL_STR(name) \
113 1.1.2.1 bouyer : "=a" (__res), "=D" (__ign1), "=S" (__ign2), \
114 1.1.2.1 bouyer "=d" (__ign3) \
115 1.1.2.1 bouyer : "1" ((long)(a1)), "2" ((long)(a2)), \
116 1.1.2.1 bouyer "3" ((long)(a3)), "g" ((long)(a4)), \
117 1.1.2.1 bouyer "g" ((long)(a5)) \
118 1.1.2.1 bouyer : "memory", "r10", "r8" ); \
119 1.1.2.1 bouyer (type)__res; \
120 1.1.2.1 bouyer })
121 1.1.2.1 bouyer
122 1.1.2.1 bouyer static inline int
123 1.1.2.1 bouyer HYPERVISOR_set_trap_table(
124 1.1.2.1 bouyer trap_info_t *table)
125 1.1.2.1 bouyer {
126 1.1.2.1 bouyer return _hypercall1(int, set_trap_table, table);
127 1.1.2.1 bouyer }
128 1.1.2.1 bouyer
129 1.1.2.1 bouyer static inline int
130 1.1.2.1 bouyer HYPERVISOR_mmu_update(
131 1.1.2.1 bouyer mmu_update_t *req, int count, int *success_count, domid_t domid)
132 1.1.2.1 bouyer {
133 1.1.2.1 bouyer return _hypercall4(int, mmu_update, req, count, success_count, domid);
134 1.1.2.1 bouyer }
135 1.1.2.1 bouyer
136 1.1.2.1 bouyer static inline int
137 1.1.2.1 bouyer HYPERVISOR_mmuext_op(
138 1.1.2.1 bouyer struct mmuext_op *op, int count, int *success_count, domid_t domid)
139 1.1.2.1 bouyer {
140 1.1.2.1 bouyer return _hypercall4(int, mmuext_op, op, count, success_count, domid);
141 1.1.2.1 bouyer }
142 1.1.2.1 bouyer
143 1.1.2.1 bouyer static inline int
144 1.1.2.1 bouyer HYPERVISOR_set_gdt(
145 1.1.2.1 bouyer unsigned long *frame_list, int entries)
146 1.1.2.1 bouyer {
147 1.1.2.1 bouyer return _hypercall2(int, set_gdt, frame_list, entries);
148 1.1.2.1 bouyer }
149 1.1.2.1 bouyer
150 1.1.2.1 bouyer static inline int
151 1.1.2.1 bouyer HYPERVISOR_stack_switch(
152 1.1.2.1 bouyer unsigned long ss, unsigned long esp)
153 1.1.2.1 bouyer {
154 1.1.2.1 bouyer return _hypercall2(int, stack_switch, ss, esp);
155 1.1.2.1 bouyer }
156 1.1.2.1 bouyer
157 1.1.2.1 bouyer static inline int
158 1.1.2.1 bouyer HYPERVISOR_set_callbacks(
159 1.1.2.1 bouyer unsigned long event_address, unsigned long failsafe_address,
160 1.1.2.1 bouyer unsigned long syscall_address)
161 1.1.2.1 bouyer {
162 1.1.2.1 bouyer return _hypercall3(int, set_callbacks,
163 1.1.2.1 bouyer event_address, failsafe_address, syscall_address);
164 1.1.2.1 bouyer }
165 1.1.2.1 bouyer
166 1.1.2.1 bouyer static inline int
167 1.1.2.1 bouyer HYPERVISOR_fpu_taskswitch(
168 1.1.2.1 bouyer int set)
169 1.1.2.1 bouyer {
170 1.1.2.1 bouyer return _hypercall1(int, fpu_taskswitch, set);
171 1.1.2.1 bouyer }
172 1.1.2.1 bouyer
173 1.1.2.1 bouyer static inline int
174 1.1.2.1 bouyer HYPERVISOR_sched_op_compat(
175 1.1.2.1 bouyer int cmd, unsigned long arg)
176 1.1.2.1 bouyer {
177 1.1.2.1 bouyer return _hypercall2(int, sched_op_compat, cmd, arg);
178 1.1.2.1 bouyer }
179 1.1.2.1 bouyer
180 1.1.2.1 bouyer static inline int
181 1.1.2.1 bouyer HYPERVISOR_sched_op(
182 1.1.2.1 bouyer int cmd, void *arg)
183 1.1.2.1 bouyer {
184 1.1.2.1 bouyer return _hypercall2(int, sched_op, cmd, arg);
185 1.1.2.1 bouyer }
186 1.1.2.1 bouyer
187 1.1.2.1 bouyer static inline long
188 1.1.2.1 bouyer HYPERVISOR_set_timer_op(
189 1.1.2.1 bouyer u64 timeout)
190 1.1.2.1 bouyer {
191 1.1.2.1 bouyer return _hypercall1(long, set_timer_op, timeout);
192 1.1.2.1 bouyer }
193 1.1.2.1 bouyer
194 1.1.2.1 bouyer static inline int
195 1.1.2.1 bouyer HYPERVISOR_platform_op(
196 1.1.2.1 bouyer struct xen_platform_op *platform_op)
197 1.1.2.1 bouyer {
198 1.1.2.1 bouyer platform_op->interface_version = XENPF_INTERFACE_VERSION;
199 1.1.2.1 bouyer return _hypercall1(int, platform_op, platform_op);
200 1.1.2.1 bouyer }
201 1.1.2.1 bouyer
202 1.1.2.1 bouyer static inline int
203 1.1.2.1 bouyer HYPERVISOR_set_debugreg(
204 1.1.2.1 bouyer int reg, unsigned long value)
205 1.1.2.1 bouyer {
206 1.1.2.1 bouyer return _hypercall2(int, set_debugreg, reg, value);
207 1.1.2.1 bouyer }
208 1.1.2.1 bouyer
209 1.1.2.1 bouyer static inline unsigned long
210 1.1.2.1 bouyer HYPERVISOR_get_debugreg(
211 1.1.2.1 bouyer int reg)
212 1.1.2.1 bouyer {
213 1.1.2.1 bouyer return _hypercall1(unsigned long, get_debugreg, reg);
214 1.1.2.1 bouyer }
215 1.1.2.1 bouyer
216 1.1.2.1 bouyer static inline int
217 1.1.2.1 bouyer HYPERVISOR_update_descriptor(
218 1.1.2.1 bouyer unsigned long ma, unsigned long word)
219 1.1.2.1 bouyer {
220 1.1.2.1 bouyer return _hypercall2(int, update_descriptor, ma, word);
221 1.1.2.1 bouyer }
222 1.1.2.1 bouyer
223 1.1.2.1 bouyer static inline int
224 1.1.2.1 bouyer HYPERVISOR_memory_op(
225 1.1.2.1 bouyer unsigned int cmd, void *arg)
226 1.1.2.1 bouyer {
227 1.1.2.1 bouyer return _hypercall2(int, memory_op, cmd, arg);
228 1.1.2.1 bouyer }
229 1.1.2.1 bouyer
230 1.1.2.1 bouyer static inline int
231 1.1.2.1 bouyer HYPERVISOR_multicall(
232 1.1.2.1 bouyer multicall_entry_t *call_list, int nr_calls)
233 1.1.2.1 bouyer {
234 1.1.2.1 bouyer return _hypercall2(int, multicall, call_list, nr_calls);
235 1.1.2.1 bouyer }
236 1.1.2.1 bouyer
237 1.1.2.1 bouyer static inline int
238 1.1.2.1 bouyer HYPERVISOR_update_va_mapping(
239 1.1.2.1 bouyer unsigned long va, unsigned long new_val, unsigned long flags)
240 1.1.2.1 bouyer {
241 1.1.2.1 bouyer return _hypercall3(int, update_va_mapping, va, new_val, flags);
242 1.1.2.1 bouyer }
243 1.1.2.1 bouyer
244 1.1.2.1 bouyer static inline int
245 1.1.2.1 bouyer HYPERVISOR_event_channel_op(evtchn_op_t *op)
246 1.1.2.1 bouyer {
247 1.1.2.1 bouyer KASSERT(op != NULL);
248 1.1.2.1 bouyer #if __XEN_INTERFACE_VERSION__ < 0x00030202
249 1.1.2.1 bouyer return _hypercall1(int, event_channel_op, op);
250 1.1.2.1 bouyer #else
251 1.1.2.1 bouyer return _hypercall2(int, event_channel_op, op->cmd, &op->u);
252 1.1.2.1 bouyer #endif
253 1.1.2.1 bouyer }
254 1.1.2.1 bouyer
255 1.1.2.1 bouyer static inline int
256 1.1.2.1 bouyer HYPERVISOR_acm_op(
257 1.1.2.1 bouyer int cmd, void *arg)
258 1.1.2.1 bouyer {
259 1.1.2.1 bouyer return _hypercall2(int, acm_op, cmd, arg);
260 1.1.2.1 bouyer }
261 1.1.2.1 bouyer
262 1.1.2.1 bouyer static inline int
263 1.1.2.1 bouyer HYPERVISOR_xen_version(
264 1.1.2.1 bouyer int cmd, void *arg)
265 1.1.2.1 bouyer {
266 1.1.2.1 bouyer return _hypercall2(int, xen_version, cmd, arg);
267 1.1.2.1 bouyer }
268 1.1.2.1 bouyer
269 1.1.2.1 bouyer static inline int
270 1.1.2.1 bouyer HYPERVISOR_console_io(
271 1.1.2.1 bouyer int cmd, int count, char *str)
272 1.1.2.1 bouyer {
273 1.1.2.1 bouyer return _hypercall3(int, console_io, cmd, count, str);
274 1.1.2.1 bouyer }
275 1.1.2.1 bouyer
276 1.1.2.1 bouyer static inline int
277 1.1.2.1 bouyer HYPERVISOR_physdev_op(void *op)
278 1.1.2.1 bouyer {
279 1.1.2.1 bouyer return _hypercall1(int, physdev_op_compat, op);
280 1.1.2.1 bouyer }
281 1.1.2.1 bouyer
282 1.1.2.1 bouyer static inline int
283 1.1.2.1 bouyer HYPERVISOR_grant_table_op(
284 1.1.2.1 bouyer unsigned int cmd, void *uop, unsigned int count)
285 1.1.2.1 bouyer {
286 1.1.2.1 bouyer return _hypercall3(int, grant_table_op, cmd, uop, count);
287 1.1.2.1 bouyer }
288 1.1.2.1 bouyer
289 1.1.2.1 bouyer static inline int
290 1.1.2.1 bouyer HYPERVISOR_update_va_mapping_otherdomain(
291 1.1.2.1 bouyer unsigned long va, unsigned long new_val, unsigned long flags,
292 1.1.2.1 bouyer domid_t domid)
293 1.1.2.1 bouyer {
294 1.1.2.1 bouyer return _hypercall4(int, update_va_mapping_otherdomain, va,
295 1.1.2.1 bouyer new_val, flags, domid);
296 1.1.2.1 bouyer }
297 1.1.2.1 bouyer
298 1.1.2.1 bouyer static inline int
299 1.1.2.1 bouyer HYPERVISOR_vm_assist(
300 1.1.2.1 bouyer unsigned int cmd, unsigned int type)
301 1.1.2.1 bouyer {
302 1.1.2.1 bouyer return _hypercall2(int, vm_assist, cmd, type);
303 1.1.2.1 bouyer }
304 1.1.2.1 bouyer
305 1.1.2.1 bouyer static inline int
306 1.1.2.1 bouyer HYPERVISOR_vcpu_op(
307 1.1.2.1 bouyer int cmd, int vcpuid, void *extra_args)
308 1.1.2.1 bouyer {
309 1.1.2.1 bouyer return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
310 1.1.2.1 bouyer }
311 1.1.2.1 bouyer
312 1.1.2.1 bouyer static inline int
313 1.1.2.1 bouyer HYPERVISOR_set_segment_base(
314 1.1.2.1 bouyer int reg, unsigned long value)
315 1.1.2.1 bouyer {
316 1.1.2.1 bouyer return _hypercall2(int, set_segment_base, reg, value);
317 1.1.2.1 bouyer }
318 1.1.2.1 bouyer
319 1.1.2.1 bouyer static inline int
320 1.1.2.1 bouyer HYPERVISOR_suspend(
321 1.1.2.1 bouyer unsigned long srec)
322 1.1.2.1 bouyer {
323 1.1.2.1 bouyer #if __XEN_INTERFACE_VERSION__ >= 0x00030201
324 1.1.2.1 bouyer
325 1.1.2.1 bouyer struct sched_shutdown shutdown_reason = {
326 1.1.2.1 bouyer .reason = SHUTDOWN_suspend,
327 1.1.2.1 bouyer };
328 1.1.2.1 bouyer
329 1.1.2.1 bouyer return _hypercall3(int, sched_op, SCHEDOP_shutdown,
330 1.1.2.1 bouyer &shutdown_reason, srec);
331 1.1.2.1 bouyer #else
332 1.1.2.1 bouyer return _hypercall3(int, sched_op, SCHEDOP_shutdown,
333 1.1.2.1 bouyer SHUTDOWN_suspend, srec);
334 1.1.2.1 bouyer #endif
335 1.1.2.1 bouyer }
336 1.1.2.1 bouyer
337 1.1.2.1 bouyer static inline long
338 1.1.2.1 bouyer HYPERVISOR_yield(
339 1.1.2.1 bouyer void)
340 1.1.2.1 bouyer {
341 1.1.2.1 bouyer return _hypercall2(int, sched_op, SCHEDOP_yield, 0);
342 1.1.2.1 bouyer }
343 1.1.2.1 bouyer
344 1.1.2.1 bouyer static inline long
345 1.1.2.1 bouyer HYPERVISOR_block(
346 1.1.2.1 bouyer void)
347 1.1.2.1 bouyer {
348 1.1.2.1 bouyer return _hypercall2(int, sched_op, SCHEDOP_block, 0);
349 1.1.2.1 bouyer }
350 1.1.2.1 bouyer
351 1.1.2.1 bouyer static inline long
352 1.1.2.1 bouyer HYPERVISOR_shutdown(
353 1.1.2.1 bouyer void)
354 1.1.2.1 bouyer {
355 1.1.2.1 bouyer #if __XEN_INTERFACE_VERSION__ >= 0x00030201
356 1.1.2.1 bouyer
357 1.1.2.1 bouyer struct sched_shutdown shutdown_reason = {
358 1.1.2.1 bouyer .reason = SHUTDOWN_poweroff,
359 1.1.2.1 bouyer };
360 1.1.2.1 bouyer
361 1.1.2.1 bouyer return _hypercall2(int, sched_op, SCHEDOP_shutdown,
362 1.1.2.1 bouyer &shutdown_reason);
363 1.1.2.1 bouyer #else
364 1.1.2.1 bouyer - return _hypercall2(int, sched_op, SCHEDOP_shutdown, SHUTDOWN_poweroff);
365 1.1.2.1 bouyer #endif
366 1.1.2.1 bouyer }
367 1.1.2.1 bouyer
368 1.1.2.1 bouyer static inline long
369 1.1.2.1 bouyer HYPERVISOR_crash(
370 1.1.2.1 bouyer void)
371 1.1.2.1 bouyer {
372 1.1.2.1 bouyer #if __XEN_INTERFACE_VERSION__ >= 0x00030201
373 1.1.2.1 bouyer
374 1.1.2.1 bouyer struct sched_shutdown shutdown_reason = {
375 1.1.2.1 bouyer .reason = SHUTDOWN_crash,
376 1.1.2.1 bouyer };
377 1.1.2.1 bouyer
378 1.1.2.1 bouyer return _hypercall2(int, sched_op, SCHEDOP_shutdown,
379 1.1.2.1 bouyer &shutdown_reason);
380 1.1.2.1 bouyer #else
381 1.1.2.1 bouyer return _hypercall2(int, sched_op, SCHEDOP_shutdown, SHUTDOWN_crash);
382 1.1.2.1 bouyer #endif
383 1.1.2.1 bouyer }
384 1.1.2.1 bouyer
385 1.1.2.1 bouyer static inline long
386 1.1.2.1 bouyer HYPERVISOR_reboot(
387 1.1.2.1 bouyer void)
388 1.1.2.1 bouyer {
389 1.1.2.1 bouyer #if __XEN_INTERFACE_VERSION__ >= 0x00030201
390 1.1.2.1 bouyer
391 1.1.2.1 bouyer struct sched_shutdown shutdown_reason = {
392 1.1.2.1 bouyer .reason = SHUTDOWN_reboot,
393 1.1.2.1 bouyer };
394 1.1.2.1 bouyer
395 1.1.2.1 bouyer return _hypercall2(int, sched_op, SCHEDOP_shutdown,
396 1.1.2.1 bouyer &shutdown_reason);
397 1.1.2.1 bouyer #else
398 1.1.2.1 bouyer return _hypercall2(int, sched_op, SCHEDOP_shutdown, SHUTDOWN_reboot);
399 1.1.2.1 bouyer #endif
400 1.1.2.1 bouyer }
401 1.1.2.1 bouyer
402 1.1.2.1 bouyer static inline int
403 1.1.2.1 bouyer HYPERVISOR_nmi_op(
404 1.1.2.1 bouyer unsigned long op, void *arg)
405 1.1.2.1 bouyer {
406 1.1.2.1 bouyer return _hypercall2(int, nmi_op, op, arg);
407 1.1.2.1 bouyer }
408 1.1.2.1 bouyer
409 1.1.2.1 bouyer static inline long
410 1.1.2.1 bouyer HYPERVISOR_hvm_op(
411 1.1.2.1 bouyer int op, void *arg)
412 1.1.2.1 bouyer {
413 1.1.2.1 bouyer return _hypercall2(long, hvm_op, op, arg);
414 1.1.2.1 bouyer }
415 1.1.2.1 bouyer
416 1.1.2.1 bouyer static inline int
417 1.1.2.1 bouyer HYPERVISOR_callback_op(
418 1.1.2.1 bouyer int cmd, void *arg)
419 1.1.2.1 bouyer {
420 1.1.2.1 bouyer return _hypercall2(int, callback_op, cmd, arg);
421 1.1.2.1 bouyer }
422 1.1.2.1 bouyer
423 1.1.2.1 bouyer static inline int
424 1.1.2.1 bouyer HYPERVISOR_xenoprof_op(
425 1.1.2.1 bouyer int op, void *arg)
426 1.1.2.1 bouyer {
427 1.1.2.1 bouyer return _hypercall2(int, xenoprof_op, op, arg);
428 1.1.2.1 bouyer }
429 1.1.2.1 bouyer
430 1.1.2.1 bouyer static inline int
431 1.1.2.1 bouyer HYPERVISOR_kexec_op(
432 1.1.2.1 bouyer unsigned long op, void *args)
433 1.1.2.1 bouyer {
434 1.1.2.1 bouyer return _hypercall2(int, kexec_op, op, args);
435 1.1.2.1 bouyer }
436 1.1.2.1 bouyer
437 1.1.2.1 bouyer #if __XEN_INTERFACE_VERSION__ < 0x00030204
438 1.1.2.1 bouyer static inline int
439 1.1.2.1 bouyer HYPERVISOR_dom0_op(
440 1.1.2.1 bouyer dom0_op_t *dom0_op)
441 1.1.2.1 bouyer {
442 1.1.2.1 bouyer dom0_op->interface_version = DOM0_INTERFACE_VERSION;
443 1.1.2.1 bouyer return _hypercall1(int, dom0_op, dom0_op);
444 1.1.2.1 bouyer }
445 1.1.2.1 bouyer #endif /* __XEN_INTERFACE_VERSION__ */
446 1.1.2.1 bouyer
447 1.1.2.1 bouyer #include <xen/include/public/arch-x86/xen-mca.h>
448 1.1.2.1 bouyer
449 1.1.2.1 bouyer static inline int
450 1.1.2.1 bouyer HYPERVISOR_machine_check(struct xen_mc *mc)
451 1.1.2.1 bouyer {
452 1.1.2.1 bouyer mc->interface_version = XEN_MCA_INTERFACE_VERSION;
453 1.1.2.1 bouyer return _hypercall1(int, mca, mc);
454 1.1.2.1 bouyer }
455 1.1.2.1 bouyer
456 1.1.2.1 bouyer static inline int
457 1.1.2.1 bouyer HYPERVISOR_sysctl(void *sysctl)
458 1.1.2.1 bouyer {
459 1.1.2.1 bouyer return _hypercall1(int, sysctl, sysctl);
460 1.1.2.1 bouyer }
461 1.1.2.1 bouyer
462 1.1.2.1 bouyer #endif /* __HYPERCALL_H__ */
463