OvmfPkg/VirtioLib: take VirtIo instance in VirtioRingInit/VirtioRingUninit

Passing the VirtIo protocol instance will allow the vring to use
VIRTIO_DEVICE_PROTOCOL.AllocateSharedPages () to allocate vring buffer.

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>
This commit is contained in:
Brijesh Singh
2017-08-23 06:57:17 -04:00
committed by Laszlo Ersek
parent 0a78d754ed
commit fc2c1543e5
8 changed files with 44 additions and 26 deletions

View File

@@ -37,6 +37,8 @@
- 1.1 Virtqueues,
- 2.3 Virtqueue Configuration.
@param[in] VirtIo The virtio device which will use the ring.
@param[in] The number of descriptors to allocate for the
virtio ring, as requested by the host.
@@ -54,8 +56,9 @@
EFI_STATUS
EFIAPI
VirtioRingInit (
IN UINT16 QueueSize,
OUT VRING *Ring
IN VIRTIO_DEVICE_PROTOCOL *VirtIo,
IN UINT16 QueueSize,
OUT VRING *Ring
)
{
UINTN RingSize;
@@ -128,13 +131,16 @@ VirtioRingInit (
invoking this function: the VSTAT_DRIVER_OK bit must be clear in
VhdrDeviceStatus.
@param[out] Ring The virtio ring to clean up.
@param[in] VirtIo The virtio device which was using the ring.
@param[out] Ring The virtio ring to clean up.
**/
VOID
EFIAPI
VirtioRingUninit (
IN OUT VRING *Ring
IN VIRTIO_DEVICE_PROTOCOL *VirtIo,
IN OUT VRING *Ring
)
{
FreePages (Ring->Base, Ring->NumPages);