OvmfPkg/VirtioLib: add function to map VRING
Add a function to map the ring buffer with BusMasterCommonBuffer so that ring can be accessed by both guest and hypervisor. 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> [lersek@redhat.com: fix typo in commit message] Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
committed by
Laszlo Ersek
parent
60ee56295f
commit
fef6becb55
@@ -60,6 +60,32 @@ VirtioRingInit (
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Map the ring buffer so that it can be accessed equally by both guest
|
||||
and hypervisor.
|
||||
|
||||
@param[in] VirtIo The virtio device instance.
|
||||
|
||||
@param[in] Ring The virtio ring to map.
|
||||
|
||||
@param[out] RingBaseShift A resulting translation offset, to be
|
||||
passed to VirtIo->SetQueueAddress().
|
||||
|
||||
@param[out] Mapping A resulting token to pass to
|
||||
VirtIo->UnmapSharedBuffer().
|
||||
|
||||
@return Status code from VirtIo->MapSharedBuffer()
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
VirtioRingMap (
|
||||
IN VIRTIO_DEVICE_PROTOCOL *VirtIo,
|
||||
IN VRING *Ring,
|
||||
OUT UINT64 *RingBaseShift,
|
||||
OUT VOID **Mapping
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Tear down the internal resources of a configured virtio ring.
|
||||
|
Reference in New Issue
Block a user