MdeModulePkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
@ -50,7 +50,7 @@ PeiImageRead (
|
||||
{
|
||||
CHAR8 *Destination8;
|
||||
CHAR8 *Source8;
|
||||
|
||||
|
||||
Destination8 = Buffer;
|
||||
Source8 = (CHAR8 *) ((UINTN) FileHandle + FileOffset);
|
||||
if (Destination8 != Source8) {
|
||||
@ -119,10 +119,10 @@ GetImageReadFunction (
|
||||
Private = PEI_CORE_INSTANCE_FROM_PS_THIS (GetPeiServicesTablePointer ());
|
||||
MemoryBuffer = 0;
|
||||
|
||||
if (Private->PeiMemoryInstalled && (((Private->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME) && PcdGetBool (PcdShadowPeimOnBoot)) ||
|
||||
if (Private->PeiMemoryInstalled && (((Private->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME) && PcdGetBool (PcdShadowPeimOnBoot)) ||
|
||||
((Private->HobList.HandoffInformationTable->BootMode == BOOT_ON_S3_RESUME) && PcdGetBool (PcdShadowPeimOnS3Boot)))) {
|
||||
//
|
||||
// Shadow algorithm makes lots of non ANSI C assumptions and only works for IA32 and X64
|
||||
//
|
||||
// Shadow algorithm makes lots of non ANSI C assumptions and only works for IA32 and X64
|
||||
// compilers that have been tested
|
||||
//
|
||||
if (Private->ShadowedImageRead == NULL) {
|
||||
@ -144,12 +144,12 @@ GetImageReadFunction (
|
||||
/**
|
||||
To check memory usage bit map array to figure out if the memory range the image will be loaded in is available or not. If
|
||||
memory range is available, the function will mark the corresponding bits to 1 which indicates the memory range is used.
|
||||
The function is only invoked when load modules at fixed address feature is enabled.
|
||||
|
||||
The function is only invoked when load modules at fixed address feature is enabled.
|
||||
|
||||
@param Private Pointer to the private data passed in from caller
|
||||
@param ImageBase The base address the image will be loaded at.
|
||||
@param ImageSize The size of the image
|
||||
|
||||
|
||||
@retval EFI_SUCCESS The memory range the image will be loaded in is available
|
||||
@retval EFI_NOT_FOUND The memory range the image will be loaded in is not available
|
||||
**/
|
||||
@ -167,7 +167,7 @@ CheckAndMarkFixLoadingMemoryUsageBitMap (
|
||||
UINT32 TopOffsetPageNumber;
|
||||
UINT32 Index;
|
||||
UINT64 *MemoryUsageBitMap;
|
||||
|
||||
|
||||
|
||||
//
|
||||
// The reserved code range includes RuntimeCodePage range, Boot time code range and PEI code range.
|
||||
@ -176,19 +176,19 @@ CheckAndMarkFixLoadingMemoryUsageBitMap (
|
||||
DxeCodePageNumber += PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber);
|
||||
ReservedCodeSize = EFI_PAGES_TO_SIZE(DxeCodePageNumber + PcdGet32(PcdLoadFixAddressPeiCodePageNumber));
|
||||
PeiCodeBase = Private->LoadModuleAtFixAddressTopAddress - ReservedCodeSize;
|
||||
|
||||
|
||||
//
|
||||
// Test the memory range for loading the image in the PEI code range.
|
||||
//
|
||||
if ((Private->LoadModuleAtFixAddressTopAddress - EFI_PAGES_TO_SIZE(DxeCodePageNumber)) < (ImageBase + ImageSize) ||
|
||||
(PeiCodeBase > ImageBase)) {
|
||||
return EFI_NOT_FOUND;
|
||||
(PeiCodeBase > ImageBase)) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Test if the memory is avalaible or not.
|
||||
//
|
||||
MemoryUsageBitMap = Private->PeiCodeMemoryRangeUsageBitMap;
|
||||
MemoryUsageBitMap = Private->PeiCodeMemoryRangeUsageBitMap;
|
||||
BaseOffsetPageNumber = EFI_SIZE_TO_PAGES((UINT32)(ImageBase - PeiCodeBase));
|
||||
TopOffsetPageNumber = EFI_SIZE_TO_PAGES((UINT32)(ImageBase + ImageSize - PeiCodeBase));
|
||||
for (Index = BaseOffsetPageNumber; Index < TopOffsetPageNumber; Index ++) {
|
||||
@ -196,17 +196,17 @@ CheckAndMarkFixLoadingMemoryUsageBitMap (
|
||||
//
|
||||
// This page is already used.
|
||||
//
|
||||
return EFI_NOT_FOUND;
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Being here means the memory range is available. So mark the bits for the memory range
|
||||
//
|
||||
//
|
||||
for (Index = BaseOffsetPageNumber; Index < TopOffsetPageNumber; Index ++) {
|
||||
MemoryUsageBitMap[Index / 64] |= LShiftU64(1, (Index % 64));
|
||||
}
|
||||
return EFI_SUCCESS;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
/**
|
||||
|
||||
@ -236,7 +236,7 @@ GetPeCoffImageFixLoadingAssignedAddress(
|
||||
UINTN Size;
|
||||
UINT16 NumberOfSections;
|
||||
UINT64 ValueInSectionHeader;
|
||||
|
||||
|
||||
|
||||
FixLoadingAddress = 0;
|
||||
Status = EFI_NOT_FOUND;
|
||||
@ -338,7 +338,7 @@ GetPeCoffImageFixLoadingAssignedAddress(
|
||||
|
||||
@retval EFI_SUCCESS The file was loaded and relocated
|
||||
@retval EFI_OUT_OF_RESOURCES There was not enough memory to load and relocate the PE/COFF file
|
||||
@retval EFI_WARN_BUFFER_TOO_SMALL
|
||||
@retval EFI_WARN_BUFFER_TOO_SMALL
|
||||
There is not enough heap to allocate the requested size.
|
||||
This will not prevent the XIP image from being invoked.
|
||||
|
||||
@ -377,7 +377,7 @@ LoadAndRelocatePeCoffImage (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Initilize local IsS3Boot and IsRegisterForShadow variable
|
||||
//
|
||||
@ -386,7 +386,7 @@ LoadAndRelocatePeCoffImage (
|
||||
IsS3Boot = TRUE;
|
||||
}
|
||||
IsRegisterForShadow = FALSE;
|
||||
if ((Private->CurrentFileHandle == FileHandle)
|
||||
if ((Private->CurrentFileHandle == FileHandle)
|
||||
&& (Private->Fv[Private->CurrentPeimFvCount].PeimState[Private->CurrentPeimCount] == PEIM_STATE_REGISTER_FOR_SHADOW)) {
|
||||
IsRegisterForShadow = TRUE;
|
||||
}
|
||||
@ -403,13 +403,13 @@ LoadAndRelocatePeCoffImage (
|
||||
//
|
||||
Status = PeiServicesFfsGetFileInfo (FileHandle, &FileInfo);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
|
||||
//
|
||||
// Check whether the file type is PEI module.
|
||||
//
|
||||
IsPeiModule = FALSE;
|
||||
if (FileInfo.FileType == EFI_FV_FILETYPE_PEI_CORE ||
|
||||
FileInfo.FileType == EFI_FV_FILETYPE_PEIM ||
|
||||
if (FileInfo.FileType == EFI_FV_FILETYPE_PEI_CORE ||
|
||||
FileInfo.FileType == EFI_FV_FILETYPE_PEIM ||
|
||||
FileInfo.FileType == EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER) {
|
||||
IsPeiModule = TRUE;
|
||||
}
|
||||
@ -548,7 +548,7 @@ LoadAndRelocatePeCoffImage (
|
||||
@retval EFI_SUCCESS Image is successfully loaded.
|
||||
@retval EFI_NOT_FOUND Fail to locate necessary PPI.
|
||||
@retval EFI_UNSUPPORTED Image Machine Type is not supported.
|
||||
@retval EFI_WARN_BUFFER_TOO_SMALL
|
||||
@retval EFI_WARN_BUFFER_TOO_SMALL
|
||||
There is not enough heap to allocate the requested size.
|
||||
This will not prevent the XIP image from being invoked.
|
||||
|
||||
|
Reference in New Issue
Block a user