MdeModulePkg: Fixed code style.

This commit is contained in:
Mikhail Krichanov 2023-03-06 12:45:30 +03:00 committed by MikhailKrichanov
parent aba1c68ac1
commit be0b5fc5da

View File

@ -115,7 +115,7 @@ GetMachineTypeName (
{ {
UINTN Index; UINTN Index;
for (Index = 0; Index < sizeof (mMachineTypeInfo)/sizeof (mMachineTypeInfo[0]); Index++) { for (Index = 0; Index < sizeof (mMachineTypeInfo)/sizeof (mMachineTypeInfo[0]); ++Index) {
if (mMachineTypeInfo[Index].MachineType == MachineType) { if (mMachineTypeInfo[Index].MachineType == MachineType) {
return mMachineTypeInfo[Index].MachineTypeName; return mMachineTypeInfo[Index].MachineTypeName;
} }
@ -269,8 +269,8 @@ CoreInitializeImageServices (
// //
// Fill in DXE globals // Fill in DXE globals
// //
gDxeCoreImageHandle = Image->Handle; gDxeCoreImageHandle = Image->Handle;
gDxeCoreLoadedImage = &Image->Info; gDxeCoreLoadedImage = &Image->Info;
// //
// Create the PE/COFF emulator protocol registration event // Create the PE/COFF emulator protocol registration event
@ -404,8 +404,8 @@ CheckAndMarkFixLoadingMemoryUsageBitMap (
// //
// Test the memory range for loading the image in the DXE code range. // Test the memory range for loading the image in the DXE code range.
// //
if ((gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress < ImageBase + ImageSize) || if ((gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress < ImageBase + ImageSize) ||
(DxeCodeBase > ImageBase)) (DxeCodeBase > ImageBase))
{ {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
@ -415,7 +415,7 @@ CheckAndMarkFixLoadingMemoryUsageBitMap (
// //
BaseOffsetPageNumber = EFI_SIZE_TO_PAGES ((UINT32)(ImageBase - DxeCodeBase)); BaseOffsetPageNumber = EFI_SIZE_TO_PAGES ((UINT32)(ImageBase - DxeCodeBase));
TopOffsetPageNumber = EFI_SIZE_TO_PAGES ((UINT32)(ImageBase + ImageSize - DxeCodeBase)); TopOffsetPageNumber = EFI_SIZE_TO_PAGES ((UINT32)(ImageBase + ImageSize - DxeCodeBase));
for (Index = BaseOffsetPageNumber; Index < TopOffsetPageNumber; Index++) { for (Index = BaseOffsetPageNumber; Index < TopOffsetPageNumber; ++Index) {
if ((mDxeCodeMemoryRangeUsageBitMap[Index / 64] & LShiftU64 (1, (Index % 64))) != 0) { if ((mDxeCodeMemoryRangeUsageBitMap[Index / 64] & LShiftU64 (1, (Index % 64))) != 0) {
// //
// This page is already used. // This page is already used.
@ -427,7 +427,7 @@ CheckAndMarkFixLoadingMemoryUsageBitMap (
// //
// Being here means the memory range is available. So mark the bits for the memory range // Being here means the memory range is available. So mark the bits for the memory range
// //
for (Index = BaseOffsetPageNumber; Index < TopOffsetPageNumber; Index++) { for (Index = BaseOffsetPageNumber; Index < TopOffsetPageNumber; ++Index) {
mDxeCodeMemoryRangeUsageBitMap[Index / 64] |= LShiftU64 (1, (Index % 64)); mDxeCodeMemoryRangeUsageBitMap[Index / 64] |= LShiftU64 (1, (Index % 64));
} }
@ -477,8 +477,8 @@ GetUefiImageFixLoadingAssignedAddress (
// //
// Check if the memory range is available. // Check if the memory range is available.
// //
SizeOfImage = UefiImageGetImageSize (ImageContext); SizeOfImage = UefiImageGetImageSize (ImageContext);
Status = CheckAndMarkFixLoadingMemoryUsageBitMap (FixLoadingAddress, SizeOfImage); Status = CheckAndMarkFixLoadingMemoryUsageBitMap (FixLoadingAddress, SizeOfImage);
*LoadAddress = FixLoadingAddress; *LoadAddress = FixLoadingAddress;
DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED INFO: Loading module at fixed address 0x%11p. Status = %r \n", (VOID *)(UINTN)FixLoadingAddress, Status)); DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED INFO: Loading module at fixed address 0x%11p. Status = %r \n", (VOID *)(UINTN)FixLoadingAddress, Status));
@ -561,15 +561,15 @@ CoreLoadPeImage (
IN OUT UEFI_IMAGE_LOADER_IMAGE_CONTEXT *ImageContext IN OUT UEFI_IMAGE_LOADER_IMAGE_CONTEXT *ImageContext
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
BOOLEAN DstBufAlocated; BOOLEAN DstBufAlocated;
UINT32 Size; UINT32 Size;
EFI_MEMORY_TYPE ImageCodeMemoryType; EFI_MEMORY_TYPE ImageCodeMemoryType;
EFI_MEMORY_TYPE ImageDataMemoryType; EFI_MEMORY_TYPE ImageDataMemoryType;
PE_COFF_LOADER_RUNTIME_CONTEXT *RelocationData; PE_COFF_LOADER_RUNTIME_CONTEXT *RelocationData;
EFI_PHYSICAL_ADDRESS BufferAddress; EFI_PHYSICAL_ADDRESS BufferAddress;
UINTN LoadAddress; UINTN LoadAddress;
UINT32 RelocDataSize; UINT32 RelocDataSize;
RelocationData = NULL; RelocationData = NULL;
@ -680,7 +680,7 @@ CoreLoadPeImage (
} }
DstBufAlocated = TRUE; DstBufAlocated = TRUE;
*DstBuffer = BufferAddress; *DstBuffer = BufferAddress;
} else { } else {
// //
// Caller provided the destination buffer // Caller provided the destination buffer
@ -705,8 +705,8 @@ CoreLoadPeImage (
return EFI_BUFFER_TOO_SMALL; return EFI_BUFFER_TOO_SMALL;
} }
Image->NumberOfPages = EFI_SIZE_TO_PAGES (Size); Image->NumberOfPages = EFI_SIZE_TO_PAGES (Size);
BufferAddress = *DstBuffer; BufferAddress = *DstBuffer;
} }
Image->ImageBasePage = BufferAddress; Image->ImageBasePage = BufferAddress;
@ -945,14 +945,14 @@ CoreUnloadAndCloseImage (
&HandleBuffer &HandleBuffer
); );
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) { for (HandleIndex = 0; HandleIndex < HandleCount; ++HandleIndex) {
Status = CoreProtocolsPerHandle ( Status = CoreProtocolsPerHandle (
HandleBuffer[HandleIndex], HandleBuffer[HandleIndex],
&ProtocolGuidArray, &ProtocolGuidArray,
&ArrayCount &ArrayCount
); );
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) { for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ++ProtocolIndex) {
Status = CoreOpenProtocolInformation ( Status = CoreOpenProtocolInformation (
HandleBuffer[HandleIndex], HandleBuffer[HandleIndex],
ProtocolGuidArray[ProtocolIndex], ProtocolGuidArray[ProtocolIndex],
@ -960,7 +960,7 @@ CoreUnloadAndCloseImage (
&OpenInfoCount &OpenInfoCount
); );
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) { for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; ++OpenInfoIndex) {
if (OpenInfo[OpenInfoIndex].AgentHandle == Image->Handle) { if (OpenInfo[OpenInfoIndex].AgentHandle == Image->Handle) {
Status = CoreCloseProtocol ( Status = CoreCloseProtocol (
HandleBuffer[HandleIndex], HandleBuffer[HandleIndex],