+/**\r
+\r
+ Allocates pages that are suitable for an VirtioOperationBusMasterCommonBuffer\r
+ mapping. This means that the buffer allocated by this function supports\r
+ simultaneous access by both the processor and the bus master. The device\r
+ address that the bus master uses to access the buffer must be retrieved with\r
+ a call to VIRTIO_MAP_SHARED.\r
+\r
+ @param[in] This The protocol instance pointer.\r
+\r
+ @param[in] Pages The number of pages to allocate.\r
+\r
+ @param[in,out] HostAddress A pointer to store the system memory base\r
+ address of the allocated range.\r
+\r
+ @retval EFI_SUCCESS The requested memory pages were allocated.\r
+ @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *VIRTIO_ALLOCATE_SHARED)(\r
+ IN VIRTIO_DEVICE_PROTOCOL *This,\r
+ IN UINTN Pages,\r
+ IN OUT VOID **HostAddress\r
+ );\r
+\r
+/**\r
+ Frees memory that was allocated with VIRTIO_ALLOCATE_SHARED.\r
+\r
+ @param[in] This The protocol instance pointer.\r
+\r
+ @param[in] Pages The number of pages to free.\r
+\r
+ @param[in] HostAddress The system memory base address of the allocated\r
+ range.\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *VIRTIO_FREE_SHARED)(\r
+ IN VIRTIO_DEVICE_PROTOCOL *This,\r
+ IN UINTN Pages,\r
+ IN VOID *HostAddress\r
+ );\r
+\r
+/**\r
+ Provides the virtio device address required to access system memory from a\r
+ DMA bus master.\r
+\r
+ The interface follows the same usage pattern as defined in UEFI spec 2.6\r
+ (Section 13.2 PCI Root Bridge I/O Protocol)\r
+\r
+ @param[in] This The protocol instance pointer.\r
+\r
+ @param[in] Operation Indicates if the bus master is going to\r
+ read or write to system memory.\r
+\r
+ @param[in] HostAddress The system memory address to map to shared\r
+ buffer address.\r
+\r
+ @param[in,out] NumberOfBytes On input the number of bytes to map.\r
+ On output the number of bytes that were\r
+ mapped.\r
+\r
+ @param[out] DeviceAddress The resulting shared map address for the\r
+ bus master to access the hosts HostAddress.\r
+\r
+ @param[out] Mapping A resulting token to pass to\r
+ VIRTIO_UNMAP_SHARED.\r
+\r
+ @retval EFI_SUCCESS The range was mapped for the returned\r
+ NumberOfBytes.\r
+ @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a\r
+ common buffer.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to\r
+ a lack of resources.\r
+ @retval EFI_DEVICE_ERROR The system hardware could not map the\r
+ requested address.\r
+**/\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *VIRTIO_MAP_SHARED) (\r
+ IN VIRTIO_DEVICE_PROTOCOL *This,\r
+ IN VIRTIO_MAP_OPERATION Operation,\r
+ IN VOID *HostAddress,\r
+ IN OUT UINTN *NumberOfBytes,\r
+ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,\r
+ OUT VOID **Mapping\r
+ );\r
+\r
+/**\r
+ Completes the VIRTIO_MAP_SHARED operation and releases any corresponding\r
+ resources.\r
+\r
+ @param[in] This The protocol instance pointer.\r
+\r
+ @param[in] Mapping The mapping token returned from\r
+ VIRTIO_MAP_SHARED.\r
+\r
+ @retval EFI_SUCCESS The range was unmapped.\r
+ @retval EFI_INVALID_PARAMETER Mapping is not a value that was returned by\r
+ VIRTIO_MAP_SHARED. Passing an invalid Mapping\r
+ token can cause undefined behavior.\r
+ @retval EFI_DEVICE_ERROR The data was not committed to the target\r
+ system memory.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *VIRTIO_UNMAP_SHARED)(\r
+ IN VIRTIO_DEVICE_PROTOCOL *This,\r
+ IN VOID *Mapping\r
+ );\r