From 07af4eee931210bad04b98d37a35bd0f61ba6bd3 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Sat, 12 Mar 2016 03:39:00 +0100 Subject: OvmfPkg: VIRTIO_DEVICE_PROTOCOL: pass VRING object to SetQueueAddress() In virtio-1.0, it is not enough to pass the base address of the virtio queue to the hypervisor (as a frame number); instead it will want the addresses of the descriptor table, the available ring, and the used ring separately. Pass the VRING object to the SetQueueAddress() member function; this will enable a virtio-1.0 implementation. Convert the current producers and consumers to this prototype. Cc: Ard Biesheuvel Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Tested-by: Ard Biesheuvel Reviewed-by: Jordan Justen --- OvmfPkg/Include/Protocol/VirtioDevice.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'OvmfPkg/Include/Protocol') diff --git a/OvmfPkg/Include/Protocol/VirtioDevice.h b/OvmfPkg/Include/Protocol/VirtioDevice.h index f8afa7120a..910a4866e7 100644 --- a/OvmfPkg/Include/Protocol/VirtioDevice.h +++ b/OvmfPkg/Include/Protocol/VirtioDevice.h @@ -19,6 +19,8 @@ #ifndef __VIRTIO_DEVICE_H__ #define __VIRTIO_DEVICE_H__ +#include + // VirtIo Specification Revision: Major[31:24].Minor[23:16].Revision[15:0 #define VIRTIO_SPEC_REVISION(major,minor,revision) \ ((((major) & 0xFF) << 24) | (((minor) & 0xFF) << 16) | ((revision) & 0xFFFF)) @@ -127,14 +129,12 @@ EFI_STATUS ); /** - Write the queue address field in the Virtio Header. - - The parameter Address must be the base address of the virtqueue divided - by 4096. + Write the queue address field(s) in the Virtio Header. @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL - @param[in] Address The 32-bit Queue Address field + @param[in] Ring The initialized VRING object to take the + addresses from. @retval EFI_SUCCESS The data was written successfully. @retval EFI_UNSUPPORTED The underlying IO device doesn't support the @@ -144,7 +144,7 @@ typedef EFI_STATUS (EFIAPI *VIRTIO_SET_QUEUE_ADDRESS) ( IN VIRTIO_DEVICE_PROTOCOL *This, - IN UINT32 Address + IN VRING *Ring ); /** -- cgit v1.2.3