summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h
diff options
context:
space:
mode:
authorBrijesh Singh <brijesh.singh@amd.com>2017-08-23 06:57:16 -0400
committerLaszlo Ersek <lersek@redhat.com>2017-08-25 10:42:18 +0200
commit084cfc1a35d4d9775c73345485596a12a71fd2a6 (patch)
treea7b51e3495d37fc2c65850fef835577bea60ac53 /OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h
parent4157b8416a15ff25e0fee131a2391bb95ae21904 (diff)
downloadedk2-084cfc1a35d4d9775c73345485596a12a71fd2a6.tar.gz
edk2-084cfc1a35d4d9775c73345485596a12a71fd2a6.tar.bz2
edk2-084cfc1a35d4d9775c73345485596a12a71fd2a6.zip
OvmfPkg/VirtioMmioDeviceLib: implement IOMMU-like member functions
The patch implements the newly added IOMMU-like member functions by respectively delegating the job to: - VIRTIO_DEVICE_PROTOCOL.AllocateSharedPages () -> MemoryAllocationLib.AllocatePages() - VIRTIO_DEVICE_PROTOCOL.FreeSharedPages () -> MemoryAllocationLib.FreePages () - VIRTIO_DEVICE_PROTOCOL.MapSharedBuffer () -> no-op - VIRTIO_DEVICE_PROTOCOL.UnmapSharedBuffer () -> no-op Suggested-by: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h')
-rw-r--r--OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h
index bedd635e1a..e5881d537f 100644
--- a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h
+++ b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h
@@ -3,6 +3,7 @@
Internal definitions for the VirtIo MMIO Device driver
Copyright (C) 2013, ARM Ltd
+ Copyright (C) 2017, AMD Inc. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
@@ -25,6 +26,7 @@
#include <Library/IoLib.h>
#include <Library/UefiLib.h>
#include <Library/VirtioMmioDeviceLib.h>
+#include <Library/MemoryAllocationLib.h>
#define VIRTIO_MMIO_DEVICE_SIGNATURE SIGNATURE_32 ('V', 'M', 'I', 'O')
@@ -137,4 +139,38 @@ VirtioMmioSetGuestFeatures (
IN UINT64 Features
);
+EFI_STATUS
+EFIAPI
+VirtioMmioAllocateSharedPages (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN NumPages,
+ OUT VOID **HostAddress
+ );
+
+VOID
+EFIAPI
+VirtioMmioFreeSharedPages (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN NumPages,
+ IN VOID *HostAddress
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioMapSharedBuffer (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN VIRTIO_MAP_OPERATION Operation,
+ IN VOID *HostAddress,
+ IN OUT UINTN *NumberOfBytes,
+ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
+ OUT VOID **Mapping
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioUnmapSharedBuffer (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN VOID *Mapping
+ );
+
#endif // _VIRTIO_MMIO_DEVICE_INTERNAL_H_