xen-mapcache.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 <stdlib.h>
  11. typedef target_phys_addr_t (*phys_offset_to_gaddr_t)(target_phys_addr_t start_addr,
  12. ram_addr_t size,
  13. void *opaque);
  14. #ifdef CONFIG_XEN
  15. void xen_map_cache_init(phys_offset_to_gaddr_t f,
  16. void *opaque);
  17. uint8_t *xen_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size,
  18. uint8_t lock);
  19. ram_addr_t xen_ram_addr_from_mapcache(void *ptr);
  20. void xen_invalidate_map_cache_entry(uint8_t *buffer);
  21. void xen_invalidate_map_cache(void);
  22. #else
  23. static inline void xen_map_cache_init(phys_offset_to_gaddr_t f,
  24. void *opaque)
  25. {
  26. }
  27. static inline uint8_t *xen_map_cache(target_phys_addr_t phys_addr,
  28. target_phys_addr_t size,
  29. uint8_t lock)
  30. {
  31. abort();
  32. }
  33. static inline ram_addr_t xen_ram_addr_from_mapcache(void *ptr)
  34. {
  35. abort();
  36. }
  37. static inline void xen_invalidate_map_cache_entry(uint8_t *buffer)
  38. {
  39. }
  40. static inline void xen_invalidate_map_cache(void)
  41. {
  42. }
  43. #endif
  44. #endif /* !XEN_MAPCACHE_H */