GrantTable.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /** @file
  2. Grant Table function declaration.
  3. Grant Table are used to grant access to certain page of the current
  4. VM to an other VM.
  5. Copyright (C) 2014, Citrix Ltd.
  6. SPDX-License-Identifier: BSD-2-Clause-Patent
  7. **/
  8. #ifndef __GNTTAB_H__
  9. #define __GNTTAB_H__
  10. #include <IndustryStandard/Xen/grant_table.h>
  11. /**
  12. Initialize the Grant Table at the address MmioAddr.
  13. @param Dev A pointer to XENBUS_DEVICE.
  14. @param MmioAddr An address where the grant table can be mapped into
  15. the guest.
  16. **/
  17. VOID
  18. XenGrantTableInit (
  19. IN XENBUS_DEVICE *Dev
  20. );
  21. /**
  22. De-initialize the Grant Table.
  23. **/
  24. VOID
  25. XenGrantTableDeinit (
  26. IN XENBUS_DEVICE *Dev
  27. );
  28. /**
  29. Grant access to the page Frame to the domain DomainId.
  30. @param This A pointer to XENBUS_PROTOCOL instance.
  31. @param DomainId ID of the domain to grant access to.
  32. @param Frame Frame Number of the page to grant access to.
  33. @param ReadOnly Provide read-only or read-write access.
  34. @param RefPtr Reference number of the grant will be written to this pointer.
  35. **/
  36. EFI_STATUS
  37. EFIAPI
  38. XenBusGrantAccess (
  39. IN XENBUS_PROTOCOL *This,
  40. IN domid_t DomainId,
  41. IN UINTN Frame, // MFN
  42. IN BOOLEAN ReadOnly,
  43. OUT grant_ref_t *RefPtr
  44. );
  45. /**
  46. End access to grant Ref, previously return by XenBusGrantAccess.
  47. @param This A pointer to XENBUS_PROTOCOL instance.
  48. @param Ref Reference numeber of a grant previously returned by
  49. XenBusGrantAccess.
  50. **/
  51. EFI_STATUS
  52. EFIAPI
  53. XenBusGrantEndAccess (
  54. IN XENBUS_PROTOCOL *This,
  55. IN grant_ref_t Ref
  56. );
  57. #endif /* !__GNTTAB_H__ */