11#ifndef __XEN_PUBLIC_XEN_H__
12#define __XEN_PUBLIC_XEN_H__
17#define __XEN_INTERFACE_VERSION__ 0x00040400
19#include "xen-compat.h"
21#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
22 #include "arch-x86/xen.h"
23#elif defined (__arm__) || defined (__aarch64__)
24 #include "arch-arm/xen.h"
26 #error "Unsupported architecture"
31DEFINE_XEN_GUEST_HANDLE (CHAR8);
32__DEFINE_XEN_GUEST_HANDLE (uchar, UINT8);
33DEFINE_XEN_GUEST_HANDLE (INT32);
34__DEFINE_XEN_GUEST_HANDLE (uint, UINT32);
35 #if __XEN_INTERFACE_VERSION__ < 0x00040300
36DEFINE_XEN_GUEST_HANDLE (
INTN);
37__DEFINE_XEN_GUEST_HANDLE (ulong,
UINTN);
39DEFINE_XEN_GUEST_HANDLE (VOID);
41DEFINE_XEN_GUEST_HANDLE (UINT64);
42DEFINE_XEN_GUEST_HANDLE (xen_pfn_t);
43DEFINE_XEN_GUEST_HANDLE (xen_ulong_t);
54#define __HYPERVISOR_set_trap_table 0
55#define __HYPERVISOR_mmu_update 1
56#define __HYPERVISOR_set_gdt 2
57#define __HYPERVISOR_stack_switch 3
58#define __HYPERVISOR_set_callbacks 4
59#define __HYPERVISOR_fpu_taskswitch 5
60#define __HYPERVISOR_sched_op_compat 6
61#define __HYPERVISOR_platform_op 7
62#define __HYPERVISOR_set_debugreg 8
63#define __HYPERVISOR_get_debugreg 9
64#define __HYPERVISOR_update_descriptor 10
65#define __HYPERVISOR_memory_op 12
66#define __HYPERVISOR_multicall 13
67#define __HYPERVISOR_update_va_mapping 14
68#define __HYPERVISOR_set_timer_op 15
69#define __HYPERVISOR_event_channel_op_compat 16
70#define __HYPERVISOR_xen_version 17
71#define __HYPERVISOR_console_io 18
72#define __HYPERVISOR_physdev_op_compat 19
73#define __HYPERVISOR_grant_table_op 20
74#define __HYPERVISOR_vm_assist 21
75#define __HYPERVISOR_update_va_mapping_otherdomain 22
76#define __HYPERVISOR_iret 23
77#define __HYPERVISOR_vcpu_op 24
78#define __HYPERVISOR_set_segment_base 25
79#define __HYPERVISOR_mmuext_op 26
80#define __HYPERVISOR_xsm_op 27
81#define __HYPERVISOR_nmi_op 28
82#define __HYPERVISOR_sched_op 29
83#define __HYPERVISOR_callback_op 30
84#define __HYPERVISOR_xenoprof_op 31
85#define __HYPERVISOR_event_channel_op 32
86#define __HYPERVISOR_physdev_op 33
87#define __HYPERVISOR_hvm_op 34
88#define __HYPERVISOR_sysctl 35
89#define __HYPERVISOR_domctl 36
90#define __HYPERVISOR_kexec_op 37
91#define __HYPERVISOR_tmem_op 38
92#define __HYPERVISOR_xc_reserved_op 39
95#define __HYPERVISOR_arch_0 48
96#define __HYPERVISOR_arch_1 49
97#define __HYPERVISOR_arch_2 50
98#define __HYPERVISOR_arch_3 51
99#define __HYPERVISOR_arch_4 52
100#define __HYPERVISOR_arch_5 53
101#define __HYPERVISOR_arch_6 54
102#define __HYPERVISOR_arch_7 55
111#if __XEN_INTERFACE_VERSION__ < 0x00030101
112 #undef __HYPERVISOR_sched_op
113#define __HYPERVISOR_sched_op __HYPERVISOR_sched_op_compat
117#if __XEN_INTERFACE_VERSION__ < 0x00030202
118 #undef __HYPERVISOR_event_channel_op
119#define __HYPERVISOR_event_channel_op __HYPERVISOR_event_channel_op_compat
120 #undef __HYPERVISOR_physdev_op
121#define __HYPERVISOR_physdev_op __HYPERVISOR_physdev_op_compat
125#if __XEN_INTERFACE_VERSION__ < 0x00030204
126#define __HYPERVISOR_dom0_op __HYPERVISOR_platform_op
131typedef UINT16 domid_t;
134#define DOMID_FIRST_RESERVED (0x7FF0U)
137#define DOMID_SELF (0x7FF0U)
148#define DOMID_IO (0x7FF1U)
156#define DOMID_XEN (0x7FF2U)
160#define DOMID_COW (0x7FF3U)
163#define DOMID_INVALID (0x7FF4U)
166#define DOMID_IDLE (0x7FFFU)
168 #if __XEN_INTERFACE_VERSION__ < 0x00040400
174#define NR_EVENT_CHANNELS EVTCHN_2L_NR_CHANNELS
199 UINT32 TscToSystemMultiplier;
232 UINT8 evtchn_upcall_pending;
233 #ifdef XEN_HAVE_PV_UPCALL_MASK
234 UINT8 evtchn_upcall_mask;
238 xen_ulong_t evtchn_pending_sel;
257 struct vcpu_info VcpuInfo[XEN_LEGACY_MAX_VCPUS];
290 xen_ulong_t evtchn_pending[
sizeof (xen_ulong_t) * 8];
291 xen_ulong_t evtchn_mask[
sizeof (xen_ulong_t) * 8];
310#define __mk_unsigned_long(x) x ## UL
311#define mk_unsigned_long(x) __mk_unsigned_long(x)
313__DEFINE_XEN_GUEST_HANDLE (uint8, UINT8);
314__DEFINE_XEN_GUEST_HANDLE (uint16, UINT16);
315__DEFINE_XEN_GUEST_HANDLE (uint32, UINT32);
316__DEFINE_XEN_GUEST_HANDLE (uint64, UINT64);
321#define mk_unsigned_long(x) x