1 /* 2 This file is part of Valgrind, a dynamic binary instrumentation 3 framework. 4 5 Copyright (C) 2012-2015 Citrix 6 7 This program is free software; you can redistribute it and/or 8 modify it under the terms of the GNU General Public License as 9 published by the Free Software Foundation; either version 2 of the 10 License, or (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, but 13 WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program; if not, write to the Free Software 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 20 02111-1307, USA. 21 22 The GNU General Public License is contained in the file COPYING. 23 */ 24 25 /* Contributed by Andrew Cooper <andrew.cooper3 (at) citrix.com> 26 and Ian Campbell <ian.campbell (at) citrix.com> */ 27 28 #ifndef __VKI_XEN_H 29 #define __VKI_XEN_H 30 31 #define ENABLE_XEN 1 32 33 #define __VKI_XEN_set_trap_table 0 34 #define __VKI_XEN_mmu_update 1 35 #define __VKI_XEN_set_gdt 2 36 #define __VKI_XEN_stack_switch 3 37 #define __VKI_XEN_set_callbacks 4 38 #define __VKI_XEN_fpu_taskswitch 5 39 #define __VKI_XEN_sched_op_compat 6 /* compat since 0x00030101 */ 40 #define __VKI_XEN_platform_op 7 41 #define __VKI_XEN_set_debugreg 8 42 #define __VKI_XEN_get_debugreg 9 43 #define __VKI_XEN_update_descriptor 10 44 #define __VKI_XEN_memory_op 12 45 #define __VKI_XEN_multicall 13 46 #define __VKI_XEN_update_va_mapping 14 47 #define __VKI_XEN_set_timer_op 15 48 #define __VKI_XEN_event_channel_op_compat 16 /* compat since 0x00030202 */ 49 #define __VKI_XEN_xen_version 17 50 #define __VKI_XEN_console_io 18 51 #define __VKI_XEN_physdev_op_compat 19 /* compat since 0x00030202 */ 52 #define __VKI_XEN_grant_table_op 20 53 #define __VKI_XEN_vm_assist 21 54 #define __VKI_XEN_update_va_mapping_otherdomain 22 55 #define __VKI_XEN_iret 23 /* x86 only */ 56 #define __VKI_XEN_vcpu_op 24 57 #define __VKI_XEN_set_segment_base 25 /* x86/64 only */ 58 #define __VKI_XEN_mmuext_op 26 59 #define __VKI_XEN_xsm_op 27 60 #define __VKI_XEN_nmi_op 28 61 #define __VKI_XEN_sched_op 29 62 #define __VKI_XEN_callback_op 30 63 #define __VKI_XEN_xenoprof_op 31 64 #define __VKI_XEN_event_channel_op 32 65 #define __VKI_XEN_physdev_op 33 66 #define __VKI_XEN_hvm_op 34 67 #define __VKI_XEN_sysctl 35 68 #define __VKI_XEN_domctl 36 69 #define __VKI_XEN_kexec_op 37 70 #define __VKI_XEN_tmem_op 38 71 #define __VKI_XEN_xc_reserved_op 39 /* reserved for XenClient */ 72 73 #define __DEFINE_VKI_XEN_GUEST_HANDLE(name, type) \ 74 ___DEFINE_VKI_XEN_GUEST_HANDLE(name, type); \ 75 ___DEFINE_VKI_XEN_GUEST_HANDLE(const_##name, const type) 76 #define DEFINE_VKI_XEN_GUEST_HANDLE(name) __DEFINE_VKI_XEN_GUEST_HANDLE(name, name) 77 78 typedef vki_uint8_t vki_xen_domain_handle_t[16]; 79 typedef vki_uint16_t vki_xen_domid_t; 80 81 #if defined(__i386__) || defined(__x86_64__) 82 #include <vki/vki-xen-x86.h> 83 #else 84 #error "Need to define per-ARCH Xen types for this platform" 85 #endif 86 87 DEFINE_VKI_XEN_GUEST_HANDLE(void); 88 DEFINE_VKI_XEN_GUEST_HANDLE(char); 89 DEFINE_VKI_XEN_GUEST_HANDLE(vki_xen_pfn_t); 90 91 __DEFINE_VKI_XEN_GUEST_HANDLE(vki_ulong, unsigned long); 92 93 __DEFINE_VKI_XEN_GUEST_HANDLE(vki_int16, vki_int16_t); 94 __DEFINE_VKI_XEN_GUEST_HANDLE(vki_int32, vki_int32_t); 95 __DEFINE_VKI_XEN_GUEST_HANDLE(vki_int64, vki_int64_t); 96 97 __DEFINE_VKI_XEN_GUEST_HANDLE(vki_uint8, vki_uint8_t); 98 __DEFINE_VKI_XEN_GUEST_HANDLE(vki_uint16, vki_uint16_t); 99 __DEFINE_VKI_XEN_GUEST_HANDLE(vki_uint32, vki_uint32_t); 100 __DEFINE_VKI_XEN_GUEST_HANDLE(vki_uint64, vki_uint64_t); 101 102 struct vki_xenctl_bitmap { 103 VKI_XEN_GUEST_HANDLE_64(vki_uint8) bitmap; 104 vki_uint32_t nr_bits; 105 }; 106 107 #include <vki/vki-xen-domctl.h> 108 #include <vki/vki-xen-sysctl.h> 109 #include <vki/vki-xen-mmuext.h> 110 #include <vki/vki-xen-schedop.h> 111 #include <vki/vki-xen-memory.h> 112 #include <vki/vki-xen-evtchn.h> 113 #include <vki/vki-xen-gnttab.h> 114 #include <vki/vki-xen-version.h> 115 #include <vki/vki-xen-hvm.h> 116 #include <vki/vki-xen-tmem.h> 117 #include <vki/vki-xen-xsm.h> 118 #include <vki/vki-xen-physdev.h> 119 120 #endif // __VKI_XEN_H 121 122 /*--------------------------------------------------------------------*/ 123 /*--- end ---*/ 124 /*--------------------------------------------------------------------*/ 125