OvmfPkg/VirtioMmioDeviceLib: Add virtio 1.0 detection.

Add #defines for the Version field.  Read and store the version,
log the version found as info message.

Continue to return UNSUPPORTED for now, we need some more patches
to complete virtio 1.0 support first.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Gerd Hoffmann
2021-08-27 21:44:54 +08:00
committed by mergify[bot]
parent 94e465e5cb
commit 08293e43da
2 changed files with 17 additions and 4 deletions

View File

@@ -23,9 +23,13 @@
#include <Library/MemoryAllocationLib.h>
#define VIRTIO_MMIO_DEVICE_SIGNATURE SIGNATURE_32 ('V', 'M', 'I', 'O')
#define VIRTIO_MMIO_DEVICE_VERSION_0_95 1
#define VIRTIO_MMIO_DEVICE_VERSION_1_00 2
typedef struct {
UINT32 Signature;
UINT32 Version;
VIRTIO_DEVICE_PROTOCOL VirtioDevice;
PHYSICAL_ADDRESS BaseAddress;
} VIRTIO_MMIO_DEVICE;