0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _ASM_X86_XEN_INTERFACE_32_H
0011 #define _ASM_X86_XEN_INTERFACE_32_H
0012
0013
0014
0015
0016
0017
0018
0019 #define FLAT_RING1_CS 0xe019
0020 #define FLAT_RING1_DS 0xe021
0021 #define FLAT_RING1_SS 0xe021
0022 #define FLAT_RING3_CS 0xe02b
0023 #define FLAT_RING3_DS 0xe033
0024 #define FLAT_RING3_SS 0xe033
0025
0026 #define FLAT_KERNEL_CS FLAT_RING1_CS
0027 #define FLAT_KERNEL_DS FLAT_RING1_DS
0028 #define FLAT_KERNEL_SS FLAT_RING1_SS
0029 #define FLAT_USER_CS FLAT_RING3_CS
0030 #define FLAT_USER_DS FLAT_RING3_DS
0031 #define FLAT_USER_SS FLAT_RING3_SS
0032
0033
0034 #define TRAP_INSTR "int $0x82"
0035
0036 #define __MACH2PHYS_VIRT_START 0xF5800000
0037 #define __MACH2PHYS_VIRT_END 0xF6800000
0038
0039 #define __MACH2PHYS_SHIFT 2
0040
0041
0042
0043
0044
0045 #define __HYPERVISOR_VIRT_START 0xF5800000
0046
0047 #ifndef __ASSEMBLY__
0048
0049 struct cpu_user_regs {
0050 uint32_t ebx;
0051 uint32_t ecx;
0052 uint32_t edx;
0053 uint32_t esi;
0054 uint32_t edi;
0055 uint32_t ebp;
0056 uint32_t eax;
0057 uint16_t error_code;
0058 uint16_t entry_vector;
0059 uint32_t eip;
0060 uint16_t cs;
0061 uint8_t saved_upcall_mask;
0062 uint8_t _pad0;
0063 uint32_t eflags;
0064 uint32_t esp;
0065 uint16_t ss, _pad1;
0066 uint16_t es, _pad2;
0067 uint16_t ds, _pad3;
0068 uint16_t fs, _pad4;
0069 uint16_t gs, _pad5;
0070 };
0071 DEFINE_GUEST_HANDLE_STRUCT(cpu_user_regs);
0072
0073 typedef uint64_t tsc_timestamp_t;
0074
0075 struct arch_vcpu_info {
0076 unsigned long cr2;
0077 unsigned long pad[5];
0078 };
0079
0080 struct xen_callback {
0081 unsigned long cs;
0082 unsigned long eip;
0083 };
0084 typedef struct xen_callback xen_callback_t;
0085
0086 #define XEN_CALLBACK(__cs, __eip) \
0087 ((struct xen_callback){ .cs = (__cs), .eip = (unsigned long)(__eip) })
0088 #endif
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100 #define xen_pfn_to_cr3(pfn) (((unsigned)(pfn) << 12) | ((unsigned)(pfn) >> 20))
0101 #define xen_cr3_to_pfn(cr3) (((unsigned)(cr3) >> 12) | ((unsigned)(cr3) << 20))
0102
0103 #endif