vki-xen.h 4.6 KB

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