12#ifndef _VIRTIO_MMIO_DEVICE_INTERNAL_H_
13#define _VIRTIO_MMIO_DEVICE_INTERNAL_H_
25#define VIRTIO_MMIO_DEVICE_SIGNATURE SIGNATURE_32 ('V', 'M', 'I', 'O')
26#define VIRTIO_MMIO_DEVICE_VERSION_0_95 1
27#define VIRTIO_MMIO_DEVICE_VERSION_1_00 2
34 PHYSICAL_ADDRESS BaseAddress;
37#define VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE(Device) \
38 CR (Device, VIRTIO_MMIO_DEVICE, VirtioDevice, VIRTIO_MMIO_DEVICE_SIGNATURE)
40#define VIRTIO_CFG_WRITE(Device, Offset, Val) \
41 (MmioWrite32 (Device->BaseAddress + (Offset), Val))
42#define VIRTIO_CFG_READ(Device, Offset) \
43 (MmioRead32 (Device->BaseAddress + (Offset)))
57VirtioMmioDeviceWrite (
66VirtioMmioGetDeviceFeatures (
68 OUT UINT64 *DeviceFeatures
73VirtioMmioGetQueueSize (
75 OUT UINT16 *QueueNumMax
80VirtioMmioGetDeviceStatus (
82 OUT UINT8 *DeviceStatus
87VirtioMmioSetQueueSize (
94VirtioMmioSetDeviceStatus (
101VirtioMmioSetQueueNotify (
103 IN UINT16 QueueNotify
108VirtioMmioSetQueueSel (
115VirtioMmioSetQueueAddress (
118 IN UINT64 RingBaseShift
123VirtioMmioSetQueueAlignment (
130VirtioMmioSetPageSize (
137VirtioMmioSetGuestFeatures (
144VirtioMmioAllocateSharedPages (
147 OUT VOID **HostAddress
152VirtioMmioFreeSharedPages (
160VirtioMmioMapSharedBuffer (
162 IN VIRTIO_MAP_OPERATION Operation,
163 IN VOID *HostAddress,
171VirtioMmioUnmapSharedBuffer (
UINT64 EFI_PHYSICAL_ADDRESS