You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef _IPXE_XENMEM_H
  2. #define _IPXE_XENMEM_H
  3. /** @file
  4. *
  5. * Xen memory operations
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #include <ipxe/xen.h>
  10. #include <xen/memory.h>
  11. /**
  12. * Add page to physical address space
  13. *
  14. * @v xen Xen hypervisor
  15. * @v add Page mapping descriptor
  16. * @ret xenrc Xen status code
  17. */
  18. static inline __attribute__ (( always_inline )) int
  19. xenmem_add_to_physmap ( struct xen_hypervisor *xen,
  20. struct xen_add_to_physmap *add ) {
  21. return xen_hypercall_2 ( xen, __HYPERVISOR_memory_op,
  22. XENMEM_add_to_physmap, virt_to_phys ( add ) );
  23. }
  24. /**
  25. * Remove page from physical address space
  26. *
  27. * @v xen Xen hypervisor
  28. * @v remove Page mapping descriptor
  29. * @ret xenrc Xen status code
  30. */
  31. static inline __attribute__ (( always_inline )) int
  32. xenmem_remove_from_physmap ( struct xen_hypervisor *xen,
  33. struct xen_remove_from_physmap *remove ) {
  34. return xen_hypercall_2 ( xen, __HYPERVISOR_memory_op,
  35. XENMEM_remove_from_physmap,
  36. virt_to_phys ( remove ) );
  37. }
  38. #endif /* _IPXE_XENMEM_H */