Go to the documentation of this file.
9 #ifndef _ASM_X86_XEN_INTERFACE_H
10 #define _ASM_X86_XEN_INTERFACE_H
13 #define __DEFINE_GUEST_HANDLE(name, type) \
14 typedef struct { type *p; } __guest_handle_ ## name
16 #define __DEFINE_GUEST_HANDLE(name, type) \
17 typedef type * __guest_handle_ ## name
20 #define DEFINE_GUEST_HANDLE_STRUCT(name) \
21 __DEFINE_GUEST_HANDLE(name, struct name)
22 #define DEFINE_GUEST_HANDLE(name) __DEFINE_GUEST_HANDLE(name, name)
23 #define GUEST_HANDLE(name) __guest_handle_ ## name
27 #define set_xen_guest_handle(hnd, val) \
29 if (sizeof(hnd) == 8) \
30 *(uint64_t *)&(hnd) = 0; \
33 #elif defined(__x86_64__)
34 #define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0)
38 #define set_xen_guest_handle(hnd, val) \
40 if (sizeof(hnd) == 8) \
41 *(uint64_t *)&(hnd) = 0; \
44 #elif defined(__x86_64__)
45 #define set_xen_guest_handle(hnd, val) do { (hnd) = val; } while (0)
54 #define PRI_xen_pfn "lx"
56 #define PRI_xen_ulong "lx"
68 #ifndef HYPERVISOR_VIRT_START
69 #define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START)
72 #define MACH2PHYS_VIRT_START mk_unsigned_long(__MACH2PHYS_VIRT_START)
73 #define MACH2PHYS_VIRT_END mk_unsigned_long(__MACH2PHYS_VIRT_END)
74 #define MACH2PHYS_NR_ENTRIES ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>__MACH2PHYS_SHIFT)
77 #define MAX_VIRT_CPUS 32
88 #define FIRST_RESERVED_GDT_PAGE 14
89 #define FIRST_RESERVED_GDT_BYTE (FIRST_RESERVED_GDT_PAGE * 4096)
90 #define FIRST_RESERVED_GDT_ENTRY (FIRST_RESERVED_GDT_BYTE / 8)
102 #define TI_GET_DPL(_ti) ((_ti)->flags & 3)
103 #define TI_GET_IF(_ti) ((_ti)->flags & 4)
104 #define TI_SET_DPL(_ti, _dpl) ((_ti)->flags |= (_dpl))
105 #define TI_SET_IF(_ti, _if) ((_ti)->flags |= ((!!(_if))<<2))
130 #include <asm/pvclock-abi.h>
140 #define VGCF_I387_VALID (1<<0)
141 #define VGCF_HVM_GUEST (1<<1)
142 #define VGCF_IN_KERNEL (1<<2)
153 unsigned long event_callback_cs;
155 unsigned long failsafe_callback_cs;
178 #define XEN_EMULATE_PREFIX .byte 0x0f,0x0b,0x78,0x65,0x6e ;
179 #define XEN_CPUID XEN_EMULATE_PREFIX cpuid
181 #define XEN_EMULATE_PREFIX ".byte 0x0f,0x0b,0x78,0x65,0x6e ; "
182 #define XEN_CPUID XEN_EMULATE_PREFIX "cpuid"