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

@@ -19,10 +19,10 @@
#pragma pack (1)
typedef struct {
UINT8 Type;
UINT8 Size;
UINT16 MachineType;
UINT32 EntryPoint;
UINT8 Type;
UINT8 Size;
UINT16 MachineType;
UINT32 EntryPoint;
} PE_COMPAT_TYPE1;
#pragma pack ()
@@ -30,9 +30,9 @@ STATIC
BOOLEAN
EFIAPI
IsImageSupported (
IN EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *This,
IN UINT16 ImageType,
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL
IN EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *This,
IN UINT16 ImageType,
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL
)
{
return ImageType == EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION;
@@ -42,16 +42,16 @@ STATIC
EFI_IMAGE_ENTRY_POINT
EFIAPI
GetCompatEntryPoint (
IN EFI_PHYSICAL_ADDRESS ImageBase
IN EFI_PHYSICAL_ADDRESS ImageBase
)
{
EFI_IMAGE_DOS_HEADER *DosHdr;
UINTN PeCoffHeaderOffset;
EFI_IMAGE_NT_HEADERS32 *Pe32;
EFI_IMAGE_SECTION_HEADER *Section;
UINTN NumberOfSections;
PE_COMPAT_TYPE1 *PeCompat;
UINTN PeCompatEnd;
EFI_IMAGE_DOS_HEADER *DosHdr;
UINTN PeCoffHeaderOffset;
EFI_IMAGE_NT_HEADERS32 *Pe32;
EFI_IMAGE_SECTION_HEADER *Section;
UINTN NumberOfSections;
PE_COMPAT_TYPE1 *PeCompat;
UINTN PeCompatEnd;
DosHdr = (EFI_IMAGE_DOS_HEADER *)(UINTN)ImageBase;
if (DosHdr->e_magic != EFI_IMAGE_DOS_SIGNATURE) {
@@ -59,7 +59,7 @@ GetCompatEntryPoint (
}
PeCoffHeaderOffset = DosHdr->e_lfanew;
Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)ImageBase + PeCoffHeaderOffset);
Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)ImageBase + PeCoffHeaderOffset);
Section = (EFI_IMAGE_SECTION_HEADER *)((UINTN)&Pe32->OptionalHeader +
Pe32->FileHeader.SizeOfOptionalHeader);
@@ -70,22 +70,25 @@ GetCompatEntryPoint (
//
// Dereference the section contents to find the mixed mode entry point
//
PeCompat = (PE_COMPAT_TYPE1 *)((UINTN)ImageBase + Section->VirtualAddress);
PeCompat = (PE_COMPAT_TYPE1 *)((UINTN)ImageBase + Section->VirtualAddress);
PeCompatEnd = (UINTN)(VOID *)PeCompat + Section->Misc.VirtualSize;
while (PeCompat->Type != 0 && (UINTN)(VOID *)PeCompat < PeCompatEnd) {
if (PeCompat->Type == 1 &&
PeCompat->Size >= sizeof (PE_COMPAT_TYPE1) &&
EFI_IMAGE_MACHINE_TYPE_SUPPORTED (PeCompat->MachineType)) {
if ((PeCompat->Type == 1) &&
(PeCompat->Size >= sizeof (PE_COMPAT_TYPE1)) &&
EFI_IMAGE_MACHINE_TYPE_SUPPORTED (PeCompat->MachineType))
{
return (EFI_IMAGE_ENTRY_POINT)((UINTN)ImageBase + PeCompat->EntryPoint);
}
PeCompat = (PE_COMPAT_TYPE1 *)((UINTN)PeCompat + PeCompat->Size);
ASSERT ((UINTN)(VOID *)PeCompat < PeCompatEnd);
}
}
Section++;
}
return NULL;
}
@@ -93,13 +96,13 @@ STATIC
EFI_STATUS
EFIAPI
RegisterImage (
IN EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *This,
IN EFI_PHYSICAL_ADDRESS ImageBase,
IN UINT64 ImageSize,
IN OUT EFI_IMAGE_ENTRY_POINT *EntryPoint
IN EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *This,
IN EFI_PHYSICAL_ADDRESS ImageBase,
IN UINT64 ImageSize,
IN OUT EFI_IMAGE_ENTRY_POINT *EntryPoint
)
{
EFI_IMAGE_ENTRY_POINT CompatEntryPoint;
EFI_IMAGE_ENTRY_POINT CompatEntryPoint;
CompatEntryPoint = GetCompatEntryPoint (ImageBase);
if (CompatEntryPoint == NULL) {
@@ -114,14 +117,14 @@ STATIC
EFI_STATUS
EFIAPI
UnregisterImage (
IN EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *This,
IN EFI_PHYSICAL_ADDRESS ImageBase
IN EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *This,
IN EFI_PHYSICAL_ADDRESS ImageBase
)
{
return EFI_SUCCESS;
}
STATIC EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL mCompatLoaderPeCoffEmuProtocol = {
STATIC EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL mCompatLoaderPeCoffEmuProtocol = {
IsImageSupported,
RegisterImage,
UnregisterImage,
@@ -136,8 +139,10 @@ CompatImageLoaderDxeEntryPoint (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
return gBS->InstallProtocolInterface (&ImageHandle,
return gBS->InstallProtocolInterface (
&ImageHandle,
&gEdkiiPeCoffImageEmulatorProtocolGuid,
EFI_NATIVE_INTERFACE,
&mCompatLoaderPeCoffEmuProtocol);
&mCompatLoaderPeCoffEmuProtocol
);
}