diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:54:09 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | ac0a286f4d747a4c6c603a7b225917293cbe1e9f (patch) | |
tree | 32654f2b35755afc961e2c97296b2dec5762da75 /OvmfPkg/Virtio10Dxe | |
parent | d1050b9dff1cace252aff86630bfdb59dff5f507 (diff) | |
download | edk2-ac0a286f4d747a4c6c603a7b225917293cbe1e9f.tar.gz edk2-ac0a286f4d747a4c6c603a7b225917293cbe1e9f.tar.bz2 edk2-ac0a286f4d747a4c6c603a7b225917293cbe1e9f.zip |
OvmfPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737
Apply uncrustify changes to .c/.h files in the OvmfPkg package
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Andrew Fish <afish@apple.com>
Diffstat (limited to 'OvmfPkg/Virtio10Dxe')
-rw-r--r-- | OvmfPkg/Virtio10Dxe/Virtio10.c | 732 | ||||
-rw-r--r-- | OvmfPkg/Virtio10Dxe/Virtio10.h | 28 |
2 files changed, 459 insertions, 301 deletions
diff --git a/OvmfPkg/Virtio10Dxe/Virtio10.c b/OvmfPkg/Virtio10Dxe/Virtio10.c index 4d8e5b58a9..970524f6d7 100644 --- a/OvmfPkg/Virtio10Dxe/Virtio10.c +++ b/OvmfPkg/Virtio10Dxe/Virtio10.c @@ -22,7 +22,6 @@ #include "Virtio10.h"
-
//
// Utility functions
//
@@ -66,22 +65,23 @@ STATIC
EFI_STATUS
Virtio10Transfer (
- IN EFI_PCI_IO_PROTOCOL *PciIo,
- IN VIRTIO_1_0_CONFIG *Config,
- IN BOOLEAN Write,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN OUT VOID *Buffer
+ IN EFI_PCI_IO_PROTOCOL *PciIo,
+ IN VIRTIO_1_0_CONFIG *Config,
+ IN BOOLEAN Write,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN OUT VOID *Buffer
)
{
- UINTN Count;
- EFI_PCI_IO_PROTOCOL_WIDTH Width;
- EFI_PCI_IO_PROTOCOL_ACCESS *BarType;
- EFI_PCI_IO_PROTOCOL_IO_MEM Access;
+ UINTN Count;
+ EFI_PCI_IO_PROTOCOL_WIDTH Width;
+ EFI_PCI_IO_PROTOCOL_ACCESS *BarType;
+ EFI_PCI_IO_PROTOCOL_IO_MEM Access;
if (!Config->Exists ||
- FieldSize > Config->Length ||
- FieldOffset > Config->Length - FieldSize) {
+ (FieldSize > Config->Length) ||
+ (FieldOffset > Config->Length - FieldSize))
+ {
return EFI_INVALID_PARAMETER;
}
@@ -97,9 +97,9 @@ Virtio10Transfer ( case 8:
Count = 2;
- //
- // fall through
- //
+ //
+ // fall through
+ //
case 4:
Width = EfiPciIoWidthUint32;
@@ -110,13 +110,18 @@ Virtio10Transfer ( }
BarType = (Config->BarType == Virtio10BarTypeMem) ? &PciIo->Mem : &PciIo->Io;
- Access = Write ? BarType->Write : BarType->Read;
-
- return Access (PciIo, Width, Config->Bar, Config->Offset + FieldOffset,
- Count, Buffer);
+ Access = Write ? BarType->Write : BarType->Read;
+
+ return Access (
+ PciIo,
+ Width,
+ Config->Bar,
+ Config->Offset + FieldOffset,
+ Count,
+ Buffer
+ );
}
-
/**
Determine if a PCI BAR is IO or MMIO.
@@ -140,13 +145,13 @@ Virtio10Transfer ( STATIC
EFI_STATUS
GetBarType (
- IN EFI_PCI_IO_PROTOCOL *PciIo,
- IN UINT8 BarIndex,
- OUT VIRTIO_1_0_BAR_TYPE *BarType
+ IN EFI_PCI_IO_PROTOCOL *PciIo,
+ IN UINT8 BarIndex,
+ OUT VIRTIO_1_0_BAR_TYPE *BarType
)
{
- EFI_STATUS Status;
- VOID *Resources;
+ EFI_STATUS Status;
+ VOID *Resources;
Status = PciIo->GetBarAttributes (PciIo, BarIndex, NULL, &Resources);
if (EFI_ERROR (Status)) {
@@ -156,22 +161,22 @@ GetBarType ( Status = EFI_UNSUPPORTED;
if (*(UINT8 *)Resources == ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR) {
- EFI_ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR *Descriptor;
+ EFI_ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR *Descriptor;
Descriptor = Resources;
switch (Descriptor->ResType) {
- case ACPI_ADDRESS_SPACE_TYPE_MEM:
- *BarType = Virtio10BarTypeMem;
- Status = EFI_SUCCESS;
- break;
-
- case ACPI_ADDRESS_SPACE_TYPE_IO:
- *BarType = Virtio10BarTypeIo;
- Status = EFI_SUCCESS;
- break;
-
- default:
- break;
+ case ACPI_ADDRESS_SPACE_TYPE_MEM:
+ *BarType = Virtio10BarTypeMem;
+ Status = EFI_SUCCESS;
+ break;
+
+ case ACPI_ADDRESS_SPACE_TYPE_IO:
+ *BarType = Virtio10BarTypeIo;
+ Status = EFI_SUCCESS;
+ break;
+
+ default:
+ break;
}
}
@@ -179,7 +184,6 @@ GetBarType ( return Status;
}
-
/*
Traverse the PCI capabilities list of a virtio-1.0 device, and capture the
locations of the interesting virtio-1.0 register blocks.
@@ -201,42 +205,55 @@ GetBarType ( STATIC
EFI_STATUS
ParseCapabilities (
- IN OUT VIRTIO_1_0_DEV *Device
+ IN OUT VIRTIO_1_0_DEV *Device
)
{
- EFI_STATUS Status;
- PCI_CAP_DEV *PciDevice;
- PCI_CAP_LIST *CapList;
- UINT16 VendorInstance;
- PCI_CAP *VendorCap;
+ EFI_STATUS Status;
+ PCI_CAP_DEV *PciDevice;
+ PCI_CAP_LIST *CapList;
+ UINT16 VendorInstance;
+ PCI_CAP *VendorCap;
Status = PciCapPciIoDeviceInit (Device->PciIo, &PciDevice);
if (EFI_ERROR (Status)) {
return Status;
}
+
Status = PciCapListInit (PciDevice, &CapList);
if (EFI_ERROR (Status)) {
goto UninitPciDevice;
}
for (VendorInstance = 0;
- !EFI_ERROR (PciCapListFindCap (CapList, PciCapNormal,
- EFI_PCI_CAPABILITY_ID_VENDOR, VendorInstance,
- &VendorCap));
- VendorInstance++) {
- UINT8 CapLen;
- VIRTIO_PCI_CAP VirtIoCap;
- VIRTIO_1_0_CONFIG *ParsedConfig;
+ !EFI_ERROR (
+ PciCapListFindCap (
+ CapList,
+ PciCapNormal,
+ EFI_PCI_CAPABILITY_ID_VENDOR,
+ VendorInstance,
+ &VendorCap
+ )
+ );
+ VendorInstance++)
+ {
+ UINT8 CapLen;
+ VIRTIO_PCI_CAP VirtIoCap;
+ VIRTIO_1_0_CONFIG *ParsedConfig;
//
// Big enough to accommodate a VIRTIO_PCI_CAP structure?
//
- Status = PciCapRead (PciDevice, VendorCap,
- OFFSET_OF (EFI_PCI_CAPABILITY_VENDOR_HDR, Length), &CapLen,
- sizeof CapLen);
+ Status = PciCapRead (
+ PciDevice,
+ VendorCap,
+ OFFSET_OF (EFI_PCI_CAPABILITY_VENDOR_HDR, Length),
+ &CapLen,
+ sizeof CapLen
+ );
if (EFI_ERROR (Status)) {
goto UninitCapList;
}
+
if (CapLen < sizeof VirtIoCap) {
//
// Too small, move to next.
@@ -253,20 +270,20 @@ ParseCapabilities ( }
switch (VirtIoCap.ConfigType) {
- case VIRTIO_PCI_CAP_COMMON_CFG:
- ParsedConfig = &Device->CommonConfig;
- break;
- case VIRTIO_PCI_CAP_NOTIFY_CFG:
- ParsedConfig = &Device->NotifyConfig;
- break;
- case VIRTIO_PCI_CAP_DEVICE_CFG:
- ParsedConfig = &Device->SpecificConfig;
- break;
- default:
- //
- // Capability is not interesting.
- //
- continue;
+ case VIRTIO_PCI_CAP_COMMON_CFG:
+ ParsedConfig = &Device->CommonConfig;
+ break;
+ case VIRTIO_PCI_CAP_NOTIFY_CFG:
+ ParsedConfig = &Device->NotifyConfig;
+ break;
+ case VIRTIO_PCI_CAP_DEVICE_CFG:
+ ParsedConfig = &Device->SpecificConfig;
+ break;
+ default:
+ //
+ // Capability is not interesting.
+ //
+ continue;
}
//
@@ -276,6 +293,7 @@ ParseCapabilities ( if (EFI_ERROR (Status)) {
goto UninitCapList;
}
+
ParsedConfig->Bar = VirtIoCap.Bar;
ParsedConfig->Offset = VirtIoCap.Offset;
ParsedConfig->Length = VirtIoCap.Length;
@@ -292,9 +310,13 @@ ParseCapabilities ( continue;
}
- Status = PciCapRead (PciDevice, VendorCap, sizeof VirtIoCap,
+ Status = PciCapRead (
+ PciDevice,
+ VendorCap,
+ sizeof VirtIoCap,
&Device->NotifyOffsetMultiplier,
- sizeof Device->NotifyOffsetMultiplier);
+ sizeof Device->NotifyOffsetMultiplier
+ );
if (EFI_ERROR (Status)) {
goto UninitCapList;
}
@@ -317,7 +339,6 @@ UninitPciDevice: return Status;
}
-
/**
Accumulate the BAR type of a virtio-1.0 register block into a UINT64
attribute map, such that the latter is suitable for enabling IO / MMIO
@@ -335,18 +356,17 @@ UninitPciDevice: STATIC
VOID
UpdateAttributes (
- IN VIRTIO_1_0_CONFIG *Config,
- IN OUT UINT64 *Attributes
+ IN VIRTIO_1_0_CONFIG *Config,
+ IN OUT UINT64 *Attributes
)
{
if (Config->Exists) {
*Attributes |= (Config->BarType == Virtio10BarTypeMem) ?
- EFI_PCI_IO_ATTRIBUTE_MEMORY:
- EFI_PCI_IO_ATTRIBUTE_IO;
+ EFI_PCI_IO_ATTRIBUTE_MEMORY :
+ EFI_PCI_IO_ATTRIBUTE_IO;
}
}
-
//
// VIRTIO_DEVICE_PROTOCOL member functions
//
@@ -355,25 +375,30 @@ STATIC EFI_STATUS
EFIAPI
Virtio10GetDeviceFeatures (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT64 *DeviceFeatures
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT64 *DeviceFeatures
)
{
- VIRTIO_1_0_DEV *Dev;
- UINT32 Selector;
- UINT32 Features32[2];
+ VIRTIO_1_0_DEV *Dev;
+ UINT32 Selector;
+ UINT32 Features32[2];
Dev = VIRTIO_1_0_FROM_VIRTIO_DEVICE (This);
for (Selector = 0; Selector < 2; ++Selector) {
- EFI_STATUS Status;
+ EFI_STATUS Status;
//
// Select the low or high half of the features.
//
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ TRUE,
OFFSET_OF (VIRTIO_PCI_COMMON_CFG, DeviceFeatureSelect),
- sizeof Selector, &Selector);
+ sizeof Selector,
+ &Selector
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -381,9 +406,14 @@ Virtio10GetDeviceFeatures ( //
// Fetch that half.
//
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, FALSE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ FALSE,
OFFSET_OF (VIRTIO_PCI_COMMON_CFG, DeviceFeature),
- sizeof Features32[Selector], &Features32[Selector]);
+ sizeof Features32[Selector],
+ &Features32[Selector]
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -393,18 +423,17 @@ Virtio10GetDeviceFeatures ( return EFI_SUCCESS;
}
-
STATIC
EFI_STATUS
EFIAPI
Virtio10SetGuestFeatures (
IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT64 Features
+ IN UINT64 Features
)
{
- VIRTIO_1_0_DEV *Dev;
- UINT32 Selector;
- UINT32 Features32[2];
+ VIRTIO_1_0_DEV *Dev;
+ UINT32 Selector;
+ UINT32 Features32[2];
Dev = VIRTIO_1_0_FROM_VIRTIO_DEVICE (This);
@@ -412,14 +441,19 @@ Virtio10SetGuestFeatures ( Features32[1] = (UINT32)RShiftU64 (Features, 32);
for (Selector = 0; Selector < 2; ++Selector) {
- EFI_STATUS Status;
+ EFI_STATUS Status;
//
// Select the low or high half of the features.
//
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ TRUE,
OFFSET_OF (VIRTIO_PCI_COMMON_CFG, DriverFeatureSelect),
- sizeof Selector, &Selector);
+ sizeof Selector,
+ &Selector
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -427,9 +461,14 @@ Virtio10SetGuestFeatures ( //
// Write that half.
//
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ TRUE,
OFFSET_OF (VIRTIO_PCI_COMMON_CFG, DriverFeature),
- sizeof Features32[Selector], &Features32[Selector]);
+ sizeof Features32[Selector],
+ &Features32[Selector]
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -438,7 +477,6 @@ Virtio10SetGuestFeatures ( return EFI_SUCCESS;
}
-
STATIC
EFI_STATUS
EFIAPI
@@ -448,80 +486,103 @@ Virtio10SetQueueAddress ( IN UINT64 RingBaseShift
)
{
- VIRTIO_1_0_DEV *Dev;
- EFI_STATUS Status;
- UINT64 Address;
- UINT16 Enable;
+ VIRTIO_1_0_DEV *Dev;
+ EFI_STATUS Status;
+ UINT64 Address;
+ UINT16 Enable;
Dev = VIRTIO_1_0_FROM_VIRTIO_DEVICE (This);
- Address = (UINTN)Ring->Desc;
+ Address = (UINTN)Ring->Desc;
Address += RingBaseShift;
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE,
- OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueDesc),
- sizeof Address, &Address);
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ TRUE,
+ OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueDesc),
+ sizeof Address,
+ &Address
+ );
if (EFI_ERROR (Status)) {
return Status;
}
- Address = (UINTN)Ring->Avail.Flags;
+ Address = (UINTN)Ring->Avail.Flags;
Address += RingBaseShift;
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE,
- OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueAvail),
- sizeof Address, &Address);
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ TRUE,
+ OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueAvail),
+ sizeof Address,
+ &Address
+ );
if (EFI_ERROR (Status)) {
return Status;
}
- Address = (UINTN)Ring->Used.Flags;
+ Address = (UINTN)Ring->Used.Flags;
Address += RingBaseShift;
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE,
- OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueUsed),
- sizeof Address, &Address);
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ TRUE,
+ OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueUsed),
+ sizeof Address,
+ &Address
+ );
if (EFI_ERROR (Status)) {
return Status;
}
Enable = 1;
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ TRUE,
OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueEnable),
- sizeof Enable, &Enable);
+ sizeof Enable,
+ &Enable
+ );
return Status;
}
-
STATIC
EFI_STATUS
EFIAPI
Virtio10SetQueueSel (
IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT16 Index
+ IN UINT16 Index
)
{
- VIRTIO_1_0_DEV *Dev;
- EFI_STATUS Status;
+ VIRTIO_1_0_DEV *Dev;
+ EFI_STATUS Status;
Dev = VIRTIO_1_0_FROM_VIRTIO_DEVICE (This);
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ TRUE,
OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueSelect),
- sizeof Index, &Index);
+ sizeof Index,
+ &Index
+ );
return Status;
}
-
STATIC
EFI_STATUS
EFIAPI
Virtio10SetQueueNotify (
IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT16 Index
+ IN UINT16 Index
)
{
- VIRTIO_1_0_DEV *Dev;
- EFI_STATUS Status;
- UINT16 SavedQueueSelect;
- UINT16 NotifyOffset;
+ VIRTIO_1_0_DEV *Dev;
+ EFI_STATUS Status;
+ UINT16 SavedQueueSelect;
+ UINT16 NotifyOffset;
Dev = VIRTIO_1_0_FROM_VIRTIO_DEVICE (This);
@@ -531,9 +592,14 @@ Virtio10SetQueueNotify ( //
// So, start with saving the current queue selector.
//
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, FALSE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ FALSE,
OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueSelect),
- sizeof SavedQueueSelect, &SavedQueueSelect);
+ sizeof SavedQueueSelect,
+ &SavedQueueSelect
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -541,9 +607,14 @@ Virtio10SetQueueNotify ( //
// Select the requested queue.
//
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ TRUE,
OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueSelect),
- sizeof Index, &Index);
+ sizeof Index,
+ &Index
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -551,9 +622,14 @@ Virtio10SetQueueNotify ( //
// Read the QueueNotifyOff field.
//
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, FALSE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ FALSE,
OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueNotifyOff),
- sizeof NotifyOffset, &NotifyOffset);
+ sizeof NotifyOffset,
+ &NotifyOffset
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -561,9 +637,14 @@ Virtio10SetQueueNotify ( //
// Re-select the original queue.
//
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ TRUE,
OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueSelect),
- sizeof SavedQueueSelect, &SavedQueueSelect);
+ sizeof SavedQueueSelect,
+ &SavedQueueSelect
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -571,37 +652,39 @@ Virtio10SetQueueNotify ( //
// We can now kick the queue.
//
- Status = Virtio10Transfer (Dev->PciIo, &Dev->NotifyConfig, TRUE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->NotifyConfig,
+ TRUE,
NotifyOffset * Dev->NotifyOffsetMultiplier,
- sizeof Index, &Index);
+ sizeof Index,
+ &Index
+ );
return Status;
}
-
STATIC
EFI_STATUS
EFIAPI
Virtio10SetQueueAlign (
IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT32 Alignment
+ IN UINT32 Alignment
)
{
return (Alignment == EFI_PAGE_SIZE) ? EFI_SUCCESS : EFI_UNSUPPORTED;
}
-
STATIC
EFI_STATUS
EFIAPI
Virtio10SetPageSize (
IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT32 PageSize
+ IN UINT32 PageSize
)
{
return (PageSize == EFI_PAGE_SIZE) ? EFI_SUCCESS : EFI_UNSUPPORTED;
}
-
STATIC
EFI_STATUS
EFIAPI
@@ -610,28 +693,32 @@ Virtio10GetQueueNumMax ( OUT UINT16 *QueueNumMax
)
{
- VIRTIO_1_0_DEV *Dev;
- EFI_STATUS Status;
+ VIRTIO_1_0_DEV *Dev;
+ EFI_STATUS Status;
Dev = VIRTIO_1_0_FROM_VIRTIO_DEVICE (This);
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, FALSE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ FALSE,
OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueSize),
- sizeof *QueueNumMax, QueueNumMax);
+ sizeof *QueueNumMax,
+ QueueNumMax
+ );
return Status;
}
-
STATIC
EFI_STATUS
EFIAPI
Virtio10SetQueueNum (
IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT16 QueueSize
+ IN UINT16 QueueSize
)
{
- EFI_STATUS Status;
- UINT16 CurrentSize;
+ EFI_STATUS Status;
+ UINT16 CurrentSize;
//
// This member function is required for VirtIo MMIO, and a no-op in
@@ -643,10 +730,10 @@ Virtio10SetQueueNum ( if (EFI_ERROR (Status)) {
return Status;
}
+
return (CurrentSize == QueueSize) ? EFI_SUCCESS : EFI_UNSUPPORTED;
}
-
STATIC
EFI_STATUS
EFIAPI
@@ -655,18 +742,22 @@ Virtio10GetDeviceStatus ( OUT UINT8 *DeviceStatus
)
{
- VIRTIO_1_0_DEV *Dev;
- EFI_STATUS Status;
+ VIRTIO_1_0_DEV *Dev;
+ EFI_STATUS Status;
Dev = VIRTIO_1_0_FROM_VIRTIO_DEVICE (This);
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, FALSE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ FALSE,
OFFSET_OF (VIRTIO_PCI_COMMON_CFG, DeviceStatus),
- sizeof *DeviceStatus, DeviceStatus);
+ sizeof *DeviceStatus,
+ DeviceStatus
+ );
return Status;
}
-
STATIC
EFI_STATUS
EFIAPI
@@ -675,52 +766,61 @@ Virtio10SetDeviceStatus ( IN UINT8 DeviceStatus
)
{
- VIRTIO_1_0_DEV *Dev;
- EFI_STATUS Status;
+ VIRTIO_1_0_DEV *Dev;
+ EFI_STATUS Status;
Dev = VIRTIO_1_0_FROM_VIRTIO_DEVICE (This);
- Status = Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE,
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->CommonConfig,
+ TRUE,
OFFSET_OF (VIRTIO_PCI_COMMON_CFG, DeviceStatus),
- sizeof DeviceStatus, &DeviceStatus);
+ sizeof DeviceStatus,
+ &DeviceStatus
+ );
return Status;
}
-
STATIC
EFI_STATUS
EFIAPI
Virtio10WriteDevice (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINT64 Value
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINT64 Value
)
{
- VIRTIO_1_0_DEV *Dev;
- EFI_STATUS Status;
+ VIRTIO_1_0_DEV *Dev;
+ EFI_STATUS Status;
Dev = VIRTIO_1_0_FROM_VIRTIO_DEVICE (This);
- Status = Virtio10Transfer (Dev->PciIo, &Dev->SpecificConfig, TRUE,
- FieldOffset, FieldSize, &Value);
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->SpecificConfig,
+ TRUE,
+ FieldOffset,
+ FieldSize,
+ &Value
+ );
return Status;
}
-
STATIC
EFI_STATUS
EFIAPI
Virtio10ReadDevice (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINTN BufferSize,
- OUT VOID *Buffer
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
)
{
- VIRTIO_1_0_DEV *Dev;
- EFI_STATUS Status;
+ VIRTIO_1_0_DEV *Dev;
+ EFI_STATUS Status;
if (FieldSize != BufferSize) {
return EFI_INVALID_PARAMETER;
@@ -728,8 +828,14 @@ Virtio10ReadDevice ( Dev = VIRTIO_1_0_FROM_VIRTIO_DEVICE (This);
- Status = Virtio10Transfer (Dev->PciIo, &Dev->SpecificConfig, FALSE,
- FieldOffset, FieldSize, Buffer);
+ Status = Virtio10Transfer (
+ Dev->PciIo,
+ &Dev->SpecificConfig,
+ FALSE,
+ FieldOffset,
+ FieldSize,
+ Buffer
+ );
return Status;
}
@@ -742,8 +848,8 @@ Virtio10AllocateSharedPages ( IN OUT VOID **HostAddress
)
{
- VIRTIO_1_0_DEV *Dev;
- EFI_STATUS Status;
+ VIRTIO_1_0_DEV *Dev;
+ EFI_STATUS Status;
Dev = VIRTIO_1_0_FROM_VIRTIO_DEVICE (This);
@@ -767,7 +873,7 @@ Virtio10FreeSharedPages ( IN VOID *HostAddress
)
{
- VIRTIO_1_0_DEV *Dev;
+ VIRTIO_1_0_DEV *Dev;
Dev = VIRTIO_1_0_FROM_VIRTIO_DEVICE (This);
@@ -790,9 +896,9 @@ Virtio10MapSharedBuffer ( OUT VOID **Mapping
)
{
- EFI_STATUS Status;
- VIRTIO_1_0_DEV *Dev;
- EFI_PCI_IO_PROTOCOL_OPERATION PciIoOperation;
+ EFI_STATUS Status;
+ VIRTIO_1_0_DEV *Dev;
+ EFI_PCI_IO_PROTOCOL_OPERATION PciIoOperation;
Dev = VIRTIO_1_0_FROM_VIRTIO_DEVICE (This);
@@ -800,17 +906,17 @@ Virtio10MapSharedBuffer ( // Map VIRTIO_MAP_OPERATION to EFI_PCI_IO_PROTOCOL_OPERATION
//
switch (Operation) {
- case VirtioOperationBusMasterRead:
- PciIoOperation = EfiPciIoOperationBusMasterRead;
- break;
- case VirtioOperationBusMasterWrite:
- PciIoOperation = EfiPciIoOperationBusMasterWrite;
- break;
- case VirtioOperationBusMasterCommonBuffer:
- PciIoOperation = EfiPciIoOperationBusMasterCommonBuffer;
- break;
- default:
- return EFI_INVALID_PARAMETER;
+ case VirtioOperationBusMasterRead:
+ PciIoOperation = EfiPciIoOperationBusMasterRead;
+ break;
+ case VirtioOperationBusMasterWrite:
+ PciIoOperation = EfiPciIoOperationBusMasterWrite;
+ break;
+ case VirtioOperationBusMasterCommonBuffer:
+ PciIoOperation = EfiPciIoOperationBusMasterCommonBuffer;
+ break;
+ default:
+ return EFI_INVALID_PARAMETER;
}
Status = Dev->PciIo->Map (
@@ -845,9 +951,9 @@ Virtio10UnmapSharedBuffer ( return Status;
}
-STATIC CONST VIRTIO_DEVICE_PROTOCOL mVirtIoTemplate = {
- VIRTIO_SPEC_REVISION (1, 0, 0),
- 0, // SubSystemDeviceId, filled in dynamically
+STATIC CONST VIRTIO_DEVICE_PROTOCOL mVirtIoTemplate = {
+ VIRTIO_SPEC_REVISION (1, 0, 0),
+ 0, // SubSystemDeviceId, filled in dynamically
Virtio10GetDeviceFeatures,
Virtio10SetGuestFeatures,
Virtio10SetQueueAddress,
@@ -867,7 +973,6 @@ STATIC CONST VIRTIO_DEVICE_PROTOCOL mVirtIoTemplate = { Virtio10UnmapSharedBuffer
};
-
//
// EFI_DRIVER_BINDING_PROTOCOL member functions
//
@@ -876,24 +981,34 @@ STATIC EFI_STATUS
EFIAPI
Virtio10BindingSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE DeviceHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE DeviceHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
{
- EFI_STATUS Status;
- EFI_PCI_IO_PROTOCOL *PciIo;
- PCI_TYPE00 Pci;
-
- Status = gBS->OpenProtocol (DeviceHandle, &gEfiPciIoProtocolGuid,
- (VOID **)&PciIo, This->DriverBindingHandle,
- DeviceHandle, EFI_OPEN_PROTOCOL_BY_DRIVER);
+ EFI_STATUS Status;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+ PCI_TYPE00 Pci;
+
+ Status = gBS->OpenProtocol (
+ DeviceHandle,
+ &gEfiPciIoProtocolGuid,
+ (VOID **)&PciIo,
+ This->DriverBindingHandle,
+ DeviceHandle,
+ EFI_OPEN_PROTOCOL_BY_DRIVER
+ );
if (EFI_ERROR (Status)) {
return Status;
}
- Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, 0,
- sizeof Pci / sizeof (UINT32), &Pci);
+ Status = PciIo->Pci.Read (
+ PciIo,
+ EfiPciIoWidthUint32,
+ 0,
+ sizeof Pci / sizeof (UINT32),
+ &Pci
+ );
if (EFI_ERROR (Status)) {
goto CloseProtocol;
}
@@ -903,12 +1018,13 @@ Virtio10BindingSupported ( // Recognize non-transitional modern devices. Also, we'll have to parse the
// PCI capability list, so make sure the CapabilityPtr field will be valid.
//
- if (Pci.Hdr.VendorId == VIRTIO_VENDOR_ID &&
- Pci.Hdr.DeviceId >= 0x1040 &&
- Pci.Hdr.DeviceId <= 0x107F &&
- Pci.Hdr.RevisionID >= 0x01 &&
- Pci.Device.SubsystemID >= 0x40 &&
- (Pci.Hdr.Status & EFI_PCI_STATUS_CAPABILITY) != 0) {
+ if ((Pci.Hdr.VendorId == VIRTIO_VENDOR_ID) &&
+ (Pci.Hdr.DeviceId >= 0x1040) &&
+ (Pci.Hdr.DeviceId <= 0x107F) &&
+ (Pci.Hdr.RevisionID >= 0x01) &&
+ (Pci.Device.SubsystemID >= 0x40) &&
+ ((Pci.Hdr.Status & EFI_PCI_STATUS_CAPABILITY) != 0))
+ {
//
// The virtio-vga device is special. It can be driven both as a VGA device
// with a linear framebuffer, and through its underlying, modern,
@@ -920,32 +1036,35 @@ Virtio10BindingSupported ( // Both virtio-vga and virtio-gpu-pci have DeviceId 0x1050, but only the
// former has device class PCI_CLASS_DISPLAY_VGA.
//
- if (Pci.Hdr.DeviceId != 0x1050 || !IS_PCI_VGA (&Pci)) {
+ if ((Pci.Hdr.DeviceId != 0x1050) || !IS_PCI_VGA (&Pci)) {
Status = EFI_SUCCESS;
}
}
CloseProtocol:
- gBS->CloseProtocol (DeviceHandle, &gEfiPciIoProtocolGuid,
- This->DriverBindingHandle, DeviceHandle);
+ gBS->CloseProtocol (
+ DeviceHandle,
+ &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle,
+ DeviceHandle
+ );
return Status;
}
-
STATIC
EFI_STATUS
EFIAPI
Virtio10BindingStart (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE DeviceHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE DeviceHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
{
- VIRTIO_1_0_DEV *Device;
- EFI_STATUS Status;
- PCI_TYPE00 Pci;
- UINT64 SetAttributes;
+ VIRTIO_1_0_DEV *Device;
+ EFI_STATUS Status;
+ PCI_TYPE00 Pci;
+ UINT64 SetAttributes;
Device = AllocateZeroPool (sizeof *Device);
if (Device == NULL) {
@@ -955,15 +1074,25 @@ Virtio10BindingStart ( Device->Signature = VIRTIO_1_0_SIGNATURE;
CopyMem (&Device->VirtIo, &mVirtIoTemplate, sizeof mVirtIoTemplate);
- Status = gBS->OpenProtocol (DeviceHandle, &gEfiPciIoProtocolGuid,
- (VOID **)&Device->PciIo, This->DriverBindingHandle,
- DeviceHandle, EFI_OPEN_PROTOCOL_BY_DRIVER);
+ Status = gBS->OpenProtocol (
+ DeviceHandle,
+ &gEfiPciIoProtocolGuid,
+ (VOID **)&Device->PciIo,
+ This->DriverBindingHandle,
+ DeviceHandle,
+ EFI_OPEN_PROTOCOL_BY_DRIVER
+ );
if (EFI_ERROR (Status)) {
goto FreeDevice;
}
- Status = Device->PciIo->Pci.Read (Device->PciIo, EfiPciIoWidthUint32, 0,
- sizeof Pci / sizeof (UINT32), &Pci);
+ Status = Device->PciIo->Pci.Read (
+ Device->PciIo,
+ EfiPciIoWidthUint32,
+ 0,
+ sizeof Pci / sizeof (UINT32),
+ &Pci
+ );
if (EFI_ERROR (Status)) {
goto ClosePciIo;
}
@@ -975,9 +1104,12 @@ Virtio10BindingStart ( goto ClosePciIo;
}
- Status = Device->PciIo->Attributes (Device->PciIo,
- EfiPciIoAttributeOperationGet, 0,
- &Device->OriginalPciAttributes);
+ Status = Device->PciIo->Attributes (
+ Device->PciIo,
+ EfiPciIoAttributeOperationGet,
+ 0,
+ &Device->OriginalPciAttributes
+ );
if (EFI_ERROR (Status)) {
goto ClosePciIo;
}
@@ -987,16 +1119,22 @@ Virtio10BindingStart ( UpdateAttributes (&Device->CommonConfig, &SetAttributes);
UpdateAttributes (&Device->NotifyConfig, &SetAttributes);
UpdateAttributes (&Device->SpecificConfig, &SetAttributes);
- Status = Device->PciIo->Attributes (Device->PciIo,
- EfiPciIoAttributeOperationEnable, SetAttributes,
- NULL);
+ Status = Device->PciIo->Attributes (
+ Device->PciIo,
+ EfiPciIoAttributeOperationEnable,
+ SetAttributes,
+ NULL
+ );
if (EFI_ERROR (Status)) {
goto ClosePciIo;
}
- Status = gBS->InstallProtocolInterface (&DeviceHandle,
- &gVirtioDeviceProtocolGuid, EFI_NATIVE_INTERFACE,
- &Device->VirtIo);
+ Status = gBS->InstallProtocolInterface (
+ &DeviceHandle,
+ &gVirtioDeviceProtocolGuid,
+ EFI_NATIVE_INTERFACE,
+ &Device->VirtIo
+ );
if (EFI_ERROR (Status)) {
goto RestorePciAttributes;
}
@@ -1004,12 +1142,20 @@ Virtio10BindingStart ( return EFI_SUCCESS;
RestorePciAttributes:
- Device->PciIo->Attributes (Device->PciIo, EfiPciIoAttributeOperationSet,
- Device->OriginalPciAttributes, NULL);
+ Device->PciIo->Attributes (
+ Device->PciIo,
+ EfiPciIoAttributeOperationSet,
+ Device->OriginalPciAttributes,
+ NULL
+ );
ClosePciIo:
- gBS->CloseProtocol (DeviceHandle, &gEfiPciIoProtocolGuid,
- This->DriverBindingHandle, DeviceHandle);
+ gBS->CloseProtocol (
+ DeviceHandle,
+ &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle,
+ DeviceHandle
+ );
FreeDevice:
FreePool (Device);
@@ -1017,47 +1163,61 @@ FreeDevice: return Status;
}
-
STATIC
EFI_STATUS
EFIAPI
Virtio10BindingStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE DeviceHandle,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE DeviceHandle,
+ IN UINTN NumberOfChildren,
+ IN EFI_HANDLE *ChildHandleBuffer
)
{
- EFI_STATUS Status;
- VIRTIO_DEVICE_PROTOCOL *VirtIo;
- VIRTIO_1_0_DEV *Device;
-
- Status = gBS->OpenProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
- (VOID **)&VirtIo, This->DriverBindingHandle,
- DeviceHandle, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+ EFI_STATUS Status;
+ VIRTIO_DEVICE_PROTOCOL *VirtIo;
+ VIRTIO_1_0_DEV *Device;
+
+ Status = gBS->OpenProtocol (
+ DeviceHandle,
+ &gVirtioDeviceProtocolGuid,
+ (VOID **)&VirtIo,
+ This->DriverBindingHandle,
+ DeviceHandle,
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL
+ );
if (EFI_ERROR (Status)) {
return Status;
}
Device = VIRTIO_1_0_FROM_VIRTIO_DEVICE (VirtIo);
- Status = gBS->UninstallProtocolInterface (DeviceHandle,
- &gVirtioDeviceProtocolGuid, &Device->VirtIo);
+ Status = gBS->UninstallProtocolInterface (
+ DeviceHandle,
+ &gVirtioDeviceProtocolGuid,
+ &Device->VirtIo
+ );
if (EFI_ERROR (Status)) {
return Status;
}
- Device->PciIo->Attributes (Device->PciIo, EfiPciIoAttributeOperationSet,
- Device->OriginalPciAttributes, NULL);
- gBS->CloseProtocol (DeviceHandle, &gEfiPciIoProtocolGuid,
- This->DriverBindingHandle, DeviceHandle);
+ Device->PciIo->Attributes (
+ Device->PciIo,
+ EfiPciIoAttributeOperationSet,
+ Device->OriginalPciAttributes,
+ NULL
+ );
+ gBS->CloseProtocol (
+ DeviceHandle,
+ &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle,
+ DeviceHandle
+ );
FreePool (Device);
return EFI_SUCCESS;
}
-
-STATIC EFI_DRIVER_BINDING_PROTOCOL mDriverBinding = {
+STATIC EFI_DRIVER_BINDING_PROTOCOL mDriverBinding = {
&Virtio10BindingSupported,
&Virtio10BindingStart,
&Virtio10BindingStop,
@@ -1066,28 +1226,27 @@ STATIC EFI_DRIVER_BINDING_PROTOCOL mDriverBinding = { NULL // DriverBindingHandle, to be overwritten
};
-
//
// EFI_COMPONENT_NAME_PROTOCOL and EFI_COMPONENT_NAME2_PROTOCOL
// implementations
//
STATIC
-EFI_UNICODE_STRING_TABLE mDriverNameTable[] = {
+EFI_UNICODE_STRING_TABLE mDriverNameTable[] = {
{ "eng;en", L"Virtio 1.0 PCI Driver" },
{ NULL, NULL }
};
STATIC
-EFI_COMPONENT_NAME_PROTOCOL mComponentName;
+EFI_COMPONENT_NAME_PROTOCOL mComponentName;
STATIC
EFI_STATUS
EFIAPI
Virtio10GetDriverName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN CHAR8 *Language,
- OUT CHAR16 **DriverName
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,
+ IN CHAR8 *Language,
+ OUT CHAR16 **DriverName
)
{
return LookupUnicodeString2 (
@@ -1103,31 +1262,30 @@ STATIC EFI_STATUS
EFIAPI
Virtio10GetDeviceName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN EFI_HANDLE DeviceHandle,
- IN EFI_HANDLE ChildHandle,
- IN CHAR8 *Language,
- OUT CHAR16 **ControllerName
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,
+ IN EFI_HANDLE DeviceHandle,
+ IN EFI_HANDLE ChildHandle,
+ IN CHAR8 *Language,
+ OUT CHAR16 **ControllerName
)
{
return EFI_UNSUPPORTED;
}
STATIC
-EFI_COMPONENT_NAME_PROTOCOL mComponentName = {
+EFI_COMPONENT_NAME_PROTOCOL mComponentName = {
&Virtio10GetDriverName,
&Virtio10GetDeviceName,
"eng"
};
STATIC
-EFI_COMPONENT_NAME2_PROTOCOL mComponentName2 = {
- (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) &Virtio10GetDriverName,
- (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) &Virtio10GetDeviceName,
+EFI_COMPONENT_NAME2_PROTOCOL mComponentName2 = {
+ (EFI_COMPONENT_NAME2_GET_DRIVER_NAME)&Virtio10GetDriverName,
+ (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)&Virtio10GetDeviceName,
"en"
};
-
//
// Entry point of this driver
//
@@ -1135,8 +1293,8 @@ EFI_COMPONENT_NAME2_PROTOCOL mComponentName2 = { EFI_STATUS
EFIAPI
Virtio10EntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
return EfiLibInstallDriverBindingComponentName2 (
diff --git a/OvmfPkg/Virtio10Dxe/Virtio10.h b/OvmfPkg/Virtio10Dxe/Virtio10.h index 4258bbfcaa..355f2a0785 100644 --- a/OvmfPkg/Virtio10Dxe/Virtio10.h +++ b/OvmfPkg/Virtio10Dxe/Virtio10.h @@ -12,7 +12,7 @@ #include <Protocol/PciIo.h>
#include <Protocol/VirtioDevice.h>
-#define VIRTIO_1_0_SIGNATURE SIGNATURE_32 ('V', 'I', 'O', '1')
+#define VIRTIO_1_0_SIGNATURE SIGNATURE_32 ('V', 'I', 'O', '1')
//
// Type of the PCI BAR that contains a VirtIo 1.0 config structure.
@@ -26,22 +26,22 @@ typedef enum { // The type below defines the access to a VirtIo 1.0 config structure.
//
typedef struct {
- BOOLEAN Exists; // The device exposes this structure
- VIRTIO_1_0_BAR_TYPE BarType;
- UINT8 Bar;
- UINT32 Offset; // Offset into BAR where structure starts
- UINT32 Length; // Length of structure in BAR.
+ BOOLEAN Exists; // The device exposes this structure
+ VIRTIO_1_0_BAR_TYPE BarType;
+ UINT8 Bar;
+ UINT32 Offset; // Offset into BAR where structure starts
+ UINT32 Length; // Length of structure in BAR.
} VIRTIO_1_0_CONFIG;
typedef struct {
- UINT32 Signature;
- VIRTIO_DEVICE_PROTOCOL VirtIo;
- EFI_PCI_IO_PROTOCOL *PciIo;
- UINT64 OriginalPciAttributes;
- VIRTIO_1_0_CONFIG CommonConfig; // Common settings
- VIRTIO_1_0_CONFIG NotifyConfig; // Notifications
- UINT32 NotifyOffsetMultiplier;
- VIRTIO_1_0_CONFIG SpecificConfig; // Device specific settings
+ UINT32 Signature;
+ VIRTIO_DEVICE_PROTOCOL VirtIo;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+ UINT64 OriginalPciAttributes;
+ VIRTIO_1_0_CONFIG CommonConfig; // Common settings
+ VIRTIO_1_0_CONFIG NotifyConfig; // Notifications
+ UINT32 NotifyOffsetMultiplier;
+ VIRTIO_1_0_CONFIG SpecificConfig; // Device specific settings
} VIRTIO_1_0_DEV;
#define VIRTIO_1_0_FROM_VIRTIO_DEVICE(Device) \
|