summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/CompatImageLoaderDxe
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:09 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commitac0a286f4d747a4c6c603a7b225917293cbe1e9f (patch)
tree32654f2b35755afc961e2c97296b2dec5762da75 /OvmfPkg/CompatImageLoaderDxe
parentd1050b9dff1cace252aff86630bfdb59dff5f507 (diff)
downloadedk2-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/CompatImageLoaderDxe')
-rw-r--r--OvmfPkg/CompatImageLoaderDxe/CompatImageLoaderDxe.c67
1 files changed, 36 insertions, 31 deletions
diff --git a/OvmfPkg/CompatImageLoaderDxe/CompatImageLoaderDxe.c b/OvmfPkg/CompatImageLoaderDxe/CompatImageLoaderDxe.c
index 41ddfbc517..c4416494a9 100644
--- a/OvmfPkg/CompatImageLoaderDxe/CompatImageLoaderDxe.c
+++ b/OvmfPkg/CompatImageLoaderDxe/CompatImageLoaderDxe.c
@@ -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
+ );
}