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:
Michael Kubacki
2021-12-05 14:54:09 -08:00
committed by mergify[bot]
parent d1050b9dff
commit ac0a286f4d
445 changed files with 30894 additions and 26369 deletions

View File

@@ -13,13 +13,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
STATIC VOID
BhyveGetGraphicsMode (
EFI_PCI_IO_PROTOCOL *PciIo,
UINT16 *Width,
UINT16 *Height,
UINT16 *Depth
EFI_PCI_IO_PROTOCOL *PciIo,
UINT16 *Width,
UINT16 *Height,
UINT16 *Depth
);
/**
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
@@ -65,15 +64,15 @@ BhyveGetGraphicsMode (
EFI_STATUS
EFIAPI
EmuGopDriverBindingSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Handle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Handle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
{
EFI_STATUS Status;
EFI_PCI_IO_PROTOCOL *PciIo;
PCI_TYPE00 Pci;
UINT16 Width, Height, Depth;
EFI_STATUS Status;
EFI_PCI_IO_PROTOCOL *PciIo;
PCI_TYPE00 Pci;
UINT16 Width, Height, Depth;
//
// Open the IO Abstraction(s) needed to perform the supported test
@@ -81,7 +80,7 @@ EmuGopDriverBindingSupported (
Status = gBS->OpenProtocol (
Handle,
&gEfiPciIoProtocolGuid,
(VOID **) &PciIo,
(VOID **)&PciIo,
This->DriverBindingHandle,
Handle,
EFI_OPEN_PROTOCOL_BY_DRIVER
@@ -107,11 +106,11 @@ EmuGopDriverBindingSupported (
}
Status = EFI_UNSUPPORTED;
if (Pci.Hdr.VendorId == 0xFB5D && Pci.Hdr.DeviceId == 0x40FB) {
DEBUG((DEBUG_INFO, "BHYVE framebuffer device detected\n"));
if ((Pci.Hdr.VendorId == 0xFB5D) && (Pci.Hdr.DeviceId == 0x40FB)) {
DEBUG ((DEBUG_INFO, "BHYVE framebuffer device detected\n"));
Status = EFI_SUCCESS;
BhyveGetGraphicsMode(PciIo, &Width, &Height, &Depth);
BhyveGetGraphicsMode (PciIo, &Width, &Height, &Depth);
PcdSet32S (PcdVideoHorizontalResolution, Width);
PcdSet32S (PcdVideoVerticalResolution, Height);
}
@@ -121,16 +120,15 @@ Done:
// Close the PCI I/O Protocol
//
gBS->CloseProtocol (
Handle,
&gEfiPciIoProtocolGuid,
This->DriverBindingHandle,
Handle
);
Handle,
&gEfiPciIoProtocolGuid,
This->DriverBindingHandle,
Handle
);
return Status;
}
/**
Starts a device controller or a bus controller.
@@ -169,25 +167,25 @@ Done:
EFI_STATUS
EFIAPI
EmuGopDriverBindingStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Handle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Handle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
{
BHYVE_FBUF_MEMREGS Memregs;
GOP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *MmioDesc;
BHYVE_FBUF_MEMREGS Memregs;
GOP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *MmioDesc;
//
// Allocate Private context data for SGO inteface.
//
Private = NULL;
Status = gBS->AllocatePool (
EfiBootServicesData,
sizeof (GOP_PRIVATE_DATA),
(VOID **)&Private
);
Status = gBS->AllocatePool (
EfiBootServicesData,
sizeof (GOP_PRIVATE_DATA),
(VOID **)&Private
);
if (EFI_ERROR (Status)) {
goto Done;
}
@@ -204,7 +202,7 @@ EmuGopDriverBindingStart (
Status = gBS->OpenProtocol (
Handle,
&gEfiPciIoProtocolGuid,
(VOID **) &Private->PciIo,
(VOID **)&Private->PciIo,
This->DriverBindingHandle,
Handle,
EFI_OPEN_PROTOCOL_BY_DRIVER
@@ -217,24 +215,30 @@ EmuGopDriverBindingStart (
// Check if fbuf mmio BAR is present
//
MmioDesc = NULL;
Status = Private->PciIo->GetBarAttributes (
Private->PciIo,
PCI_BAR_IDX0,
NULL,
(VOID**) &MmioDesc
);
Status = Private->PciIo->GetBarAttributes (
Private->PciIo,
PCI_BAR_IDX0,
NULL,
(VOID **)&MmioDesc
);
if (EFI_ERROR (Status) ||
MmioDesc->ResType != ACPI_ADDRESS_SPACE_TYPE_MEM) {
(MmioDesc->ResType != ACPI_ADDRESS_SPACE_TYPE_MEM))
{
DEBUG ((DEBUG_INFO, "BHYVE GOP: No mmio bar\n"));
} else {
DEBUG ((DEBUG_INFO, "BHYVE GOP: Using mmio bar @ 0x%lx\n",
MmioDesc->AddrRangeMin));
BhyveGetMemregs(Private, &Memregs);
DEBUG ((
DEBUG_INFO,
"BHYVE GOP: Using mmio bar @ 0x%lx\n",
MmioDesc->AddrRangeMin
));
BhyveGetMemregs (Private, &Memregs);
Private->FbSize = Memregs.FbSize;
}
if (MmioDesc != NULL) {
FreePool (MmioDesc);
}
if (EFI_ERROR (Status)) {
goto Done;
}
@@ -243,18 +247,22 @@ EmuGopDriverBindingStart (
// Check if fbuf frame-buffer BAR is present
//
MmioDesc = NULL;
Status = Private->PciIo->GetBarAttributes (
Private->PciIo,
PCI_BAR_IDX1,
NULL,
(VOID**) &MmioDesc
);
Status = Private->PciIo->GetBarAttributes (
Private->PciIo,
PCI_BAR_IDX1,
NULL,
(VOID **)&MmioDesc
);
if (EFI_ERROR (Status) ||
MmioDesc->ResType != ACPI_ADDRESS_SPACE_TYPE_MEM) {
(MmioDesc->ResType != ACPI_ADDRESS_SPACE_TYPE_MEM))
{
DEBUG ((DEBUG_INFO, "BHYVE GOP: No frame-buffer bar\n"));
} else {
DEBUG ((DEBUG_INFO, "BHYVE GOP: Using frame-buffer bar @ 0x%lx\n",
MmioDesc->AddrRangeMin));
DEBUG ((
DEBUG_INFO,
"BHYVE GOP: Using frame-buffer bar @ 0x%lx\n",
MmioDesc->AddrRangeMin
));
Private->FbAddr = MmioDesc->AddrRangeMin;
// XXX assert BAR is >= size
}
@@ -262,12 +270,17 @@ EmuGopDriverBindingStart (
if (MmioDesc != NULL) {
FreePool (MmioDesc);
}
if (EFI_ERROR (Status)) {
goto Done;
}
DEBUG ((DEBUG_INFO, "BHYVE GOP: Framebuf addr 0x%lx, size %x\n",
Private->FbAddr, Private->FbSize));
DEBUG ((
DEBUG_INFO,
"BHYVE GOP: Framebuf addr 0x%lx, size %x\n",
Private->FbAddr,
Private->FbSize
));
Status = EmuGopConstructor (Private);
if (EFI_ERROR (Status)) {
@@ -279,18 +292,19 @@ EmuGopDriverBindingStart (
//
Status = gBS->InstallMultipleProtocolInterfaces (
&Private->Handle,
&gEfiGraphicsOutputProtocolGuid, &Private->GraphicsOutput,
&gEfiGraphicsOutputProtocolGuid,
&Private->GraphicsOutput,
NULL
);
DEBUG((DEBUG_INFO, "BHYVE framebuffer device started\n"));
DEBUG ((DEBUG_INFO, "BHYVE framebuffer device started\n"));
//
// Install int10 handler
//
#ifndef CSM_ENABLE
#ifndef CSM_ENABLE
InstallVbeShim (L"Framebuffer", Private->FbAddr);
#endif
#endif
Done:
if (EFI_ERROR (Status)) {
@@ -309,8 +323,6 @@ Done:
return Status;
}
/**
Stops a device controller or a bus controller.
@@ -346,11 +358,11 @@ EmuGopDriverBindingStop (
IN EFI_HANDLE *ChildHandleBuffer
)
{
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
EFI_STATUS Status;
GOP_PRIVATE_DATA *Private;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
EFI_STATUS Status;
GOP_PRIVATE_DATA *Private;
DEBUG((DEBUG_INFO, "BHYVE framebuffer device stopping\n"));
DEBUG ((DEBUG_INFO, "BHYVE framebuffer device stopping\n"));
Status = gBS->OpenProtocol (
Handle,
@@ -377,7 +389,8 @@ EmuGopDriverBindingStop (
//
Status = gBS->UninstallMultipleProtocolInterfaces (
Private->Handle,
&gEfiGraphicsOutputProtocolGuid, &Private->GraphicsOutput,
&gEfiGraphicsOutputProtocolGuid,
&Private->GraphicsOutput,
NULL
);
if (!EFI_ERROR (Status)) {
@@ -390,11 +403,11 @@ EmuGopDriverBindingStop (
}
gBS->CloseProtocol (
Handle,
&gEfiPciIoProtocolGuid,
This->DriverBindingHandle,
Private->Handle
);
Handle,
&gEfiPciIoProtocolGuid,
This->DriverBindingHandle,
Private->Handle
);
//
// Free our instance data
@@ -402,18 +415,16 @@ EmuGopDriverBindingStop (
FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private);
}
return Status;
}
///
/// This protocol provides the services required to determine if a driver supports a given controller.
/// If a controller is supported, then it also provides routines to start and stop the controller.
///
EFI_DRIVER_BINDING_PROTOCOL gEmuGopDriverBinding = {
EFI_DRIVER_BINDING_PROTOCOL gEmuGopDriverBinding = {
EmuGopDriverBindingSupported,
EmuGopDriverBindingStart,
EmuGopDriverBindingStop,
@@ -422,8 +433,6 @@ EFI_DRIVER_BINDING_PROTOCOL gEmuGopDriverBinding = {
NULL
};
/**
The user Entry Point for module EmuGop. The user code starts with this function.
@@ -437,11 +446,11 @@ EFI_DRIVER_BINDING_PROTOCOL gEmuGopDriverBinding = {
EFI_STATUS
EFIAPI
InitializeEmuGop (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
EFI_STATUS Status;
Status = EfiLibInstallDriverBindingComponentName2 (
ImageHandle,
@@ -453,33 +462,31 @@ InitializeEmuGop (
);
ASSERT_EFI_ERROR (Status);
return Status;
}
STATIC VOID
BhyveGetGraphicsMode (
EFI_PCI_IO_PROTOCOL *PciIo,
UINT16 *Width,
UINT16 *Height,
UINT16 *Depth
EFI_PCI_IO_PROTOCOL *PciIo,
UINT16 *Width,
UINT16 *Height,
UINT16 *Depth
)
{
BHYVE_FBUF_MEMREGS BhyveRegs;
UINT64 Offset;
EFI_STATUS Status;
BHYVE_FBUF_MEMREGS BhyveRegs;
UINT64 Offset;
EFI_STATUS Status;
Offset = (UINT64)&BhyveRegs.Width - (UINT64)&BhyveRegs;
Status = PciIo->Mem.Read (
PciIo,
EfiPciIoWidthUint16,
PCI_BAR_IDX0,
Offset,
3,
&BhyveRegs.Width
);
PciIo,
EfiPciIoWidthUint16,
PCI_BAR_IDX0,
Offset,
3,
&BhyveRegs.Width
);
*Width = BhyveRegs.Width;
*Height = BhyveRegs.Height;
@@ -493,51 +500,56 @@ BhyveGetGraphicsMode (
VOID
BhyveSetGraphicsMode (
GOP_PRIVATE_DATA *Private,
UINT16 Width,
UINT16 Height,
UINT16 Depth
UINT16 Width,
UINT16 Height,
UINT16 Depth
)
{
BHYVE_FBUF_MEMREGS BhyveRegs;
UINT64 Offset;
EFI_STATUS Status;
BHYVE_FBUF_MEMREGS BhyveRegs;
UINT64 Offset;
EFI_STATUS Status;
DEBUG ((DEBUG_INFO, "BHYVE Set Graphics Mode: w %d, h %d\n", Width, Height));
BhyveRegs.Width = Width;
BhyveRegs.Height = Height;
BhyveRegs.Depth = Depth;
Offset = (UINT64)&BhyveRegs.Width - (UINT64)&BhyveRegs;
Offset = (UINT64)&BhyveRegs.Width - (UINT64)&BhyveRegs;
Status = Private->PciIo->Mem.Write (
Private->PciIo,
EfiPciIoWidthUint16,
PCI_BAR_IDX0,
Offset,
3,
&BhyveRegs.Width
);
Private->PciIo,
EfiPciIoWidthUint16,
PCI_BAR_IDX0,
Offset,
3,
&BhyveRegs.Width
);
ASSERT_EFI_ERROR (Status);
}
VOID
BhyveGetMemregs (
GOP_PRIVATE_DATA *Private,
BHYVE_FBUF_MEMREGS *Memregs
GOP_PRIVATE_DATA *Private,
BHYVE_FBUF_MEMREGS *Memregs
)
{
EFI_STATUS Status;
EFI_STATUS Status;
Status = Private->PciIo->Mem.Read (
Private->PciIo,
EfiPciIoWidthUint32,
PCI_BAR_IDX0,
0,
3,
Memregs
);
Private->PciIo,
EfiPciIoWidthUint32,
PCI_BAR_IDX0,
0,
3,
Memregs
);
ASSERT_EFI_ERROR (Status);
DEBUG ((DEBUG_INFO, "BHYVE Get Memregs, size %d width %d height %d\n",
Memregs->FbSize, Memregs->Width, Memregs->Height));
DEBUG ((
DEBUG_INFO,
"BHYVE Get Memregs, size %d width %d height %d\n",
Memregs->FbSize,
Memregs->Width,
Memregs->Height
));
}