xen-mapcache.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (C) 2011 Citrix Ltd.
  3. *
  4. * This work is licensed under the terms of the GNU GPL, version 2. See
  5. * the COPYING file in the top-level directory.
  6. *
  7. */
  8. #ifndef XEN_MAPCACHE_H
  9. #define XEN_MAPCACHE_H
  10. #include "exec/cpu-common.h"
  11. #include "system/xen.h"
  12. typedef hwaddr (*phys_offset_to_gaddr_t)(hwaddr phys_offset,
  13. ram_addr_t size);
  14. #ifdef CONFIG_XEN_IS_POSSIBLE
  15. void xen_map_cache_init(phys_offset_to_gaddr_t f,
  16. void *opaque);
  17. uint8_t *xen_map_cache(MemoryRegion *mr, hwaddr phys_addr, hwaddr size,
  18. ram_addr_t ram_addr_offset,
  19. uint8_t lock, bool dma,
  20. bool is_write);
  21. ram_addr_t xen_ram_addr_from_mapcache(void *ptr);
  22. void xen_invalidate_map_cache_entry(uint8_t *buffer);
  23. void xen_invalidate_map_cache(void);
  24. uint8_t *xen_replace_cache_entry(hwaddr old_phys_addr,
  25. hwaddr new_phys_addr,
  26. hwaddr size);
  27. #else
  28. static inline void xen_map_cache_init(phys_offset_to_gaddr_t f,
  29. void *opaque)
  30. {
  31. }
  32. static inline uint8_t *xen_map_cache(MemoryRegion *mr,
  33. hwaddr phys_addr,
  34. hwaddr size,
  35. ram_addr_t ram_addr_offset,
  36. uint8_t lock,
  37. bool dma,
  38. bool is_write)
  39. {
  40. abort();
  41. }
  42. static inline ram_addr_t xen_ram_addr_from_mapcache(void *ptr)
  43. {
  44. abort();
  45. }
  46. static inline void xen_invalidate_map_cache_entry(uint8_t *buffer)
  47. {
  48. }
  49. static inline void xen_invalidate_map_cache(void)
  50. {
  51. }
  52. static inline uint8_t *xen_replace_cache_entry(hwaddr old_phys_addr,
  53. hwaddr new_phys_addr,
  54. hwaddr size)
  55. {
  56. abort();
  57. }
  58. #endif
  59. #endif /* XEN_MAPCACHE_H */