54 Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
58 Dev->DeviceSpecificConfigurationOffset + FieldOffset,
93 Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
97 Dev->DeviceSpecificConfigurationOffset + FieldOffset,
105VirtioPciGetDeviceFeatures (
107 OUT UINT64 *DeviceFeatures
114 if (DeviceFeatures ==
NULL) {
115 return EFI_INVALID_PARAMETER;
118 Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
122 VIRTIO_PCI_OFFSET_DEVICE_FEATURES,
127 if (!EFI_ERROR (Status)) {
128 *DeviceFeatures = Features32;
136VirtioPciGetQueueSize (
138 OUT UINT16 *QueueNumMax
143 if (QueueNumMax ==
NULL) {
144 return EFI_INVALID_PARAMETER;
147 Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
151 VIRTIO_PCI_OFFSET_QUEUE_SIZE,
160VirtioPciGetDeviceStatus (
162 OUT UINT8 *DeviceStatus
167 if (DeviceStatus ==
NULL) {
168 return EFI_INVALID_PARAMETER;
171 Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
175 VIRTIO_PCI_OFFSET_QUEUE_DEVICE_STATUS,
184VirtioPciSetGuestFeatures (
191 Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
193 if (Features > MAX_UINT32) {
194 return EFI_UNSUPPORTED;
199 VIRTIO_PCI_OFFSET_GUEST_FEATURES,
207VirtioPciSetQueueAddress (
210 IN UINT64 RingBaseShift
215 ASSERT (RingBaseShift == 0);
217 Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
221 VIRTIO_PCI_OFFSET_QUEUE_ADDRESS,
223 (UINT32)((
UINTN)Ring->Base >> EFI_PAGE_SHIFT)
229VirtioPciSetQueueSel (
236 Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
240 VIRTIO_PCI_OFFSET_QUEUE_SELECT,
248VirtioPciSetQueueAlignment (
258VirtioPciSetPageSize (
263 return (PageSize == EFI_PAGE_SIZE) ?
EFI_SUCCESS : EFI_UNSUPPORTED;
268VirtioPciSetQueueNotify (
275 Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
279 VIRTIO_PCI_OFFSET_QUEUE_NOTIFY,
287VirtioPciSetQueueSize (
301VirtioPciSetDeviceStatus (
303 IN UINT8 DeviceStatus
308 Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
312 VIRTIO_PCI_OFFSET_QUEUE_DEVICE_STATUS,
320VirtioPciAllocateSharedPages (
323 OUT VOID **HostAddress
329 if (Buffer ==
NULL) {
330 return EFI_OUT_OF_RESOURCES;
333 *HostAddress = Buffer;
339VirtioPciFreeSharedPages (
350VirtioPciMapSharedBuffer (
352 IN VIRTIO_MAP_OPERATION Operation,
353 IN VOID *HostAddress,
367VirtioPciUnmapSharedBuffer (
VOID EFIAPI FreePages(IN VOID *Buffer, IN UINTN Pages)
VOID *EFIAPI AllocatePages(IN UINTN Pages)
UINT64 EFI_PHYSICAL_ADDRESS
EFI_STATUS EFIAPI VirtioPciIoRead(IN VIRTIO_PCI_DEVICE *Dev, IN UINTN FieldOffset, IN UINTN FieldSize, IN UINTN BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI VirtioPciIoWrite(IN VIRTIO_PCI_DEVICE *Dev, IN UINTN FieldOffset, IN UINTN FieldSize, IN UINT64 Value)
EFI_STATUS EFIAPI VirtioPciDeviceWrite(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINTN FieldOffset, IN UINTN FieldSize, IN UINT64 Value)
EFI_STATUS EFIAPI VirtioPciDeviceRead(IN VIRTIO_DEVICE_PROTOCOL *This, IN UINTN FieldOffset, IN UINTN FieldSize, IN UINTN BufferSize, OUT VOID *Buffer)