vki-xen-tmem.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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_TMEM_H
  22. #define __VKI_XEN_TMEM_H
  23. typedef VKI_XEN_GUEST_HANDLE(char) vki_xen_tmem_cli_va_t;
  24. /* version of ABI */
  25. #define VKI_XEN_TMEM_spec_version 1
  26. /* Commands to HYPERVISOR_tmem_op() */
  27. #define VKI_XEN_TMEM_control 0
  28. #define VKI_XEN_TMEM_new_pool 1
  29. #define VKI_XEN_TMEM_destroy_pool 2
  30. #define VKI_XEN_TMEM_new_page 3
  31. #define VKI_XEN_TMEM_put_page 4
  32. #define VKI_XEN_TMEM_get_page 5
  33. #define VKI_XEN_TMEM_flush_page 6
  34. #define VKI_XEN_TMEM_flush_object 7
  35. #define VKI_XEN_TMEM_read 8
  36. #define VKI_XEN_TMEM_write 9
  37. #define VKI_XEN_TMEM_xchg 10
  38. /* Privileged commands to HYPERVISOR_tmem_op() */
  39. #define VKI_XEN_tmem_auth 101
  40. #define VKI_XEN_tmem_restore_new 102
  41. /* for cmd = TMEM_CONTROL */
  42. struct vki_xen_tmem_ctrl {
  43. vki_uint32_t subop;
  44. /* Subops for HYPERVISOR_tmem_op(TMEM_CONTROL) */
  45. #define VKI_XEN_TMEMC_thaw 0
  46. #define VKI_XEN_TMEMC_freeze 1
  47. #define VKI_XEN_TMEMC_flush 2
  48. #define VKI_XEN_TMEMC_destroy 3
  49. #define VKI_XEN_TMEMC_list 4
  50. #define VKI_XEN_TMEMC_set_weight 5
  51. #define VKI_XEN_TMEMC_set_cap 6
  52. #define VKI_XEN_TMEMC_set_compress 7
  53. #define VKI_XEN_TMEMC_query_freeable_mb 8
  54. #define VKI_XEN_TMEMC_save_begin 10
  55. #define VKI_XEN_TMEMC_save_get_version 11
  56. #define VKI_XEN_TMEMC_save_get_maxpools 12
  57. #define VKI_XEN_TMEMC_save_get_client_weight 13
  58. #define VKI_XEN_TMEMC_save_get_client_cap 14
  59. #define VKI_XEN_TMEMC_save_get_client_flags 15
  60. #define VKI_XEN_TMEMC_save_get_pool_flags 16
  61. #define VKI_XEN_TMEMC_save_get_pool_npages 17
  62. #define VKI_XEN_TMEMC_save_get_pool_uuid 18
  63. #define VKI_XEN_TMEMC_save_get_next_page 19
  64. #define VKI_XEN_TMEMC_save_get_next_inv 20
  65. #define VKI_XEN_TMEMC_save_end 21
  66. #define VKI_XEN_TMEMC_restore_begin 30
  67. #define VKI_XEN_TMEMC_restore_put_page 32
  68. #define VKI_XEN_TMEMC_restore_flush_page 33
  69. vki_uint32_t cli_id;
  70. vki_uint32_t arg1;
  71. vki_uint32_t arg2;
  72. vki_uint64_t oid[3];
  73. vki_xen_tmem_cli_va_t buf;
  74. };
  75. struct vki_xen_tmem_op {
  76. vki_uint32_t cmd;
  77. vki_int32_t pool_id;
  78. union {
  79. struct vki_xen_tmem_ctrl ctrl;
  80. } u;
  81. };
  82. #endif // __VKI_XEN_TMEM_H
  83. /*--------------------------------------------------------------------*/
  84. /*--- end ---*/
  85. /*--------------------------------------------------------------------*/