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>
This commit is contained in:
committed by
mergify[bot]
parent
d1050b9dff
commit
ac0a286f4d
@@ -14,26 +14,26 @@
|
||||
|
||||
#include "VirtioMmioDevice.h"
|
||||
|
||||
STATIC CONST VIRTIO_DEVICE_PROTOCOL mMmioDeviceProtocolTemplate = {
|
||||
0, // Revision
|
||||
0, // SubSystemDeviceId
|
||||
VirtioMmioGetDeviceFeatures, // GetDeviceFeatures
|
||||
VirtioMmioSetGuestFeatures, // SetGuestFeatures
|
||||
VirtioMmioSetQueueAddress, // SetQueueAddress
|
||||
VirtioMmioSetQueueSel, // SetQueueSel
|
||||
VirtioMmioSetQueueNotify, // SetQueueNotify
|
||||
VirtioMmioSetQueueAlignment, // SetQueueAlign
|
||||
VirtioMmioSetPageSize, // SetPageSize
|
||||
VirtioMmioGetQueueSize, // GetQueueNumMax
|
||||
VirtioMmioSetQueueSize, // SetQueueNum
|
||||
VirtioMmioGetDeviceStatus, // GetDeviceStatus
|
||||
VirtioMmioSetDeviceStatus, // SetDeviceStatus
|
||||
VirtioMmioDeviceWrite, // WriteDevice
|
||||
VirtioMmioDeviceRead, // ReadDevice
|
||||
VirtioMmioAllocateSharedPages, // AllocateSharedPages
|
||||
VirtioMmioFreeSharedPages, // FreeSharedPages
|
||||
VirtioMmioMapSharedBuffer, // MapSharedBuffer
|
||||
VirtioMmioUnmapSharedBuffer // UnmapSharedBuffer
|
||||
STATIC CONST VIRTIO_DEVICE_PROTOCOL mMmioDeviceProtocolTemplate = {
|
||||
0, // Revision
|
||||
0, // SubSystemDeviceId
|
||||
VirtioMmioGetDeviceFeatures, // GetDeviceFeatures
|
||||
VirtioMmioSetGuestFeatures, // SetGuestFeatures
|
||||
VirtioMmioSetQueueAddress, // SetQueueAddress
|
||||
VirtioMmioSetQueueSel, // SetQueueSel
|
||||
VirtioMmioSetQueueNotify, // SetQueueNotify
|
||||
VirtioMmioSetQueueAlignment, // SetQueueAlign
|
||||
VirtioMmioSetPageSize, // SetPageSize
|
||||
VirtioMmioGetQueueSize, // GetQueueNumMax
|
||||
VirtioMmioSetQueueSize, // SetQueueNum
|
||||
VirtioMmioGetDeviceStatus, // GetDeviceStatus
|
||||
VirtioMmioSetDeviceStatus, // SetDeviceStatus
|
||||
VirtioMmioDeviceWrite, // WriteDevice
|
||||
VirtioMmioDeviceRead, // ReadDevice
|
||||
VirtioMmioAllocateSharedPages, // AllocateSharedPages
|
||||
VirtioMmioFreeSharedPages, // FreeSharedPages
|
||||
VirtioMmioMapSharedBuffer, // MapSharedBuffer
|
||||
VirtioMmioUnmapSharedBuffer // UnmapSharedBuffer
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -54,19 +54,22 @@ EFI_STATUS
|
||||
EFIAPI
|
||||
VirtioMmioInit (
|
||||
IN PHYSICAL_ADDRESS BaseAddress,
|
||||
IN OUT VIRTIO_MMIO_DEVICE *Device
|
||||
IN OUT VIRTIO_MMIO_DEVICE *Device
|
||||
)
|
||||
{
|
||||
UINT32 MagicValue;
|
||||
UINT32 MagicValue;
|
||||
|
||||
//
|
||||
// Initialize VirtIo Mmio Device
|
||||
//
|
||||
CopyMem (&Device->VirtioDevice, &mMmioDeviceProtocolTemplate,
|
||||
sizeof (VIRTIO_DEVICE_PROTOCOL));
|
||||
Device->BaseAddress = BaseAddress;
|
||||
CopyMem (
|
||||
&Device->VirtioDevice,
|
||||
&mMmioDeviceProtocolTemplate,
|
||||
sizeof (VIRTIO_DEVICE_PROTOCOL)
|
||||
);
|
||||
Device->BaseAddress = BaseAddress;
|
||||
Device->VirtioDevice.SubSystemDeviceId =
|
||||
MmioRead32 (BaseAddress + VIRTIO_MMIO_OFFSET_DEVICE_ID);
|
||||
MmioRead32 (BaseAddress + VIRTIO_MMIO_OFFSET_DEVICE_ID);
|
||||
|
||||
//
|
||||
// Double-check MMIO-specific values
|
||||
@@ -78,24 +81,31 @@ VirtioMmioInit (
|
||||
|
||||
Device->Version = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_VERSION);
|
||||
switch (Device->Version) {
|
||||
case VIRTIO_MMIO_DEVICE_VERSION_0_95:
|
||||
DEBUG ((DEBUG_INFO, "%a virtio 0.9.5, id %d\n", __FUNCTION__,
|
||||
Device->VirtioDevice.SubSystemDeviceId));
|
||||
Device->VirtioDevice.Revision = VIRTIO_SPEC_REVISION (0, 9, 5);
|
||||
break;
|
||||
case VIRTIO_MMIO_DEVICE_VERSION_1_00:
|
||||
DEBUG ((DEBUG_INFO, "%a virtio 1.0, id %d\n", __FUNCTION__,
|
||||
Device->VirtioDevice.SubSystemDeviceId));
|
||||
Device->VirtioDevice.Revision = VIRTIO_SPEC_REVISION (1, 0, 0);
|
||||
break;
|
||||
default:
|
||||
return EFI_UNSUPPORTED;
|
||||
case VIRTIO_MMIO_DEVICE_VERSION_0_95:
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"%a virtio 0.9.5, id %d\n",
|
||||
__FUNCTION__,
|
||||
Device->VirtioDevice.SubSystemDeviceId
|
||||
));
|
||||
Device->VirtioDevice.Revision = VIRTIO_SPEC_REVISION (0, 9, 5);
|
||||
break;
|
||||
case VIRTIO_MMIO_DEVICE_VERSION_1_00:
|
||||
DEBUG ((
|
||||
DEBUG_INFO,
|
||||
"%a virtio 1.0, id %d\n",
|
||||
__FUNCTION__,
|
||||
Device->VirtioDevice.SubSystemDeviceId
|
||||
));
|
||||
Device->VirtioDevice.Revision = VIRTIO_SPEC_REVISION (1, 0, 0);
|
||||
break;
|
||||
default:
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Uninitialize the internals of a virtio-mmio device that has been successfully
|
||||
@@ -104,12 +114,11 @@ VirtioMmioInit (
|
||||
@param[in, out] Device The device to clean up.
|
||||
|
||||
**/
|
||||
|
||||
STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
VirtioMmioUninit (
|
||||
IN VIRTIO_MMIO_DEVICE *Device
|
||||
IN VIRTIO_MMIO_DEVICE *Device
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -120,16 +129,17 @@ VirtioMmioUninit (
|
||||
|
||||
EFI_STATUS
|
||||
VirtioMmioInstallDevice (
|
||||
IN PHYSICAL_ADDRESS BaseAddress,
|
||||
IN EFI_HANDLE Handle
|
||||
IN PHYSICAL_ADDRESS BaseAddress,
|
||||
IN EFI_HANDLE Handle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
VIRTIO_MMIO_DEVICE *VirtIo;
|
||||
VIRTIO_MMIO_DEVICE *VirtIo;
|
||||
|
||||
if (!BaseAddress) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (Handle == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
@@ -152,9 +162,12 @@ VirtioMmioInstallDevice (
|
||||
//
|
||||
// Install VIRTIO_DEVICE_PROTOCOL to Handle
|
||||
//
|
||||
Status = gBS->InstallProtocolInterface (&Handle,
|
||||
&gVirtioDeviceProtocolGuid, EFI_NATIVE_INTERFACE,
|
||||
&VirtIo->VirtioDevice);
|
||||
Status = gBS->InstallProtocolInterface (
|
||||
&Handle,
|
||||
&gVirtioDeviceProtocolGuid,
|
||||
EFI_NATIVE_INTERFACE,
|
||||
&VirtIo->VirtioDevice
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto UninitVirtio;
|
||||
}
|
||||
@@ -171,7 +184,7 @@ FreeVirtioMem:
|
||||
|
||||
EFI_STATUS
|
||||
VirtioMmioUninstallDevice (
|
||||
IN EFI_HANDLE DeviceHandle
|
||||
IN EFI_HANDLE DeviceHandle
|
||||
)
|
||||
{
|
||||
VIRTIO_DEVICE_PROTOCOL *VirtioDevice;
|
||||
@@ -198,9 +211,11 @@ VirtioMmioUninstallDevice (
|
||||
//
|
||||
// Uninstall the protocol interface
|
||||
//
|
||||
Status = gBS->UninstallProtocolInterface (DeviceHandle,
|
||||
&gVirtioDeviceProtocolGuid, &MmioDevice->VirtioDevice
|
||||
);
|
||||
Status = gBS->UninstallProtocolInterface (
|
||||
DeviceHandle,
|
||||
&gVirtioDeviceProtocolGuid,
|
||||
&MmioDevice->VirtioDevice
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
Reference in New Issue
Block a user