6 extern u32 xen_cpuid_base;
10 void xen_init_hypercalls(void);
11 void xen_copy_biostables(void);
13 static inline int usingXen(void) {
16 return (xen_cpuid_base != 0);
19 unsigned long xen_hypercall_page;
21 #define _hypercall0(type, name) \
23 unsigned long __hentry = xen_hypercall_page+__HYPERVISOR_##name*32; \
33 #define _hypercall1(type, name, a1) \
35 unsigned long __hentry = xen_hypercall_page+__HYPERVISOR_##name*32; \
39 : "=a" (__res), "=b" (__ign1) \
40 : "0" (__hentry), "1" ((long)(a1)) \
45 #define _hypercall2(type, name, a1, a2) \
47 unsigned long __hentry = xen_hypercall_page+__HYPERVISOR_##name*32; \
48 long __res, __ign1, __ign2; \
51 : "=a" (__res), "=b" (__ign1), "=c" (__ign2) \
52 : "0" (__hentry), "1" ((long)(a1)), "2" ((long)(a2)) \
57 #define _hypercall3(type, name, a1, a2, a3) \
59 unsigned long __hentry = xen_hypercall_page+__HYPERVISOR_##name*32; \
60 long __res, __ign1, __ign2, __ign3; \
63 : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
65 : "0" (__hentry), "1" ((long)(a1)), "2" ((long)(a2)), \
71 #define _hypercall4(type, name, a1, a2, a3, a4) \
73 unsigned long __hentry = xen_hypercall_page+__HYPERVISOR_##name*32; \
74 long __res, __ign1, __ign2, __ign3, __ign4; \
77 : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
78 "=d" (__ign3), "=S" (__ign4) \
79 : "0" (__hentry), "1" ((long)(a1)), "2" ((long)(a2)), \
80 "3" ((long)(a3)), "4" ((long)(a4)) \
85 #define _hypercall5(type, name, a1, a2, a3, a4, a5) \
87 unsigned long __hentry = xen_hypercall_page+__HYPERVISOR_##name*32; \
88 long __res, __ign1, __ign2, __ign3, __ign4, __ign5; \
91 : "=a" (__res), "=b" (__ign1), "=c" (__ign2), \
92 "=d" (__ign3), "=S" (__ign4), "=D" (__ign5) \
93 : "0" (__hentry), "1" ((long)(a1)), "2" ((long)(a2)), \
94 "3" ((long)(a3)), "4" ((long)(a4)), \
100 /******************************************************************************
102 * The following interface definitions are taken from Xen and have the
105 * Permission is hereby granted, free of charge, to any person obtaining a copy
106 * of this software and associated documentation files (the "Software"), to
107 * deal in the Software without restriction, including without limitation the
108 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
109 * sell copies of the Software, and to permit persons to whom the Software is
110 * furnished to do so, subject to the following conditions:
112 * The above copyright notice and this permission notice shall be included in
113 * all copies or substantial portions of the Software.
115 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
116 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
117 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
118 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
119 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
120 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
121 * DEALINGS IN THE SOFTWARE.
126 #define __HYPERVISOR_xen_version 17
130 /* arg == xen_extraversion_t. */
131 #define XENVER_extraversion 1
132 typedef char xen_extraversion_t[16];
133 #define XEN_EXTRAVERSION_LEN (sizeof(xen_extraversion_t))