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:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Capsule update PEIM for UEFI2.0
|
||||
|
||||
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
@@ -133,7 +133,7 @@ Create4GPageTables (
|
||||
IN EFI_PHYSICAL_ADDRESS PageTablesAddress,
|
||||
IN BOOLEAN Page1GSupport
|
||||
)
|
||||
{
|
||||
{
|
||||
UINT8 PhysicalAddressBits;
|
||||
EFI_PHYSICAL_ADDRESS PageAddress;
|
||||
UINTN IndexOfPml4Entries;
|
||||
@@ -172,7 +172,7 @@ Create4GPageTables (
|
||||
}
|
||||
|
||||
//
|
||||
// Pre-allocate big pages to avoid later allocations.
|
||||
// Pre-allocate big pages to avoid later allocations.
|
||||
//
|
||||
BigPageAddress = (UINTN) PageTablesAddress;
|
||||
|
||||
@@ -201,7 +201,7 @@ Create4GPageTables (
|
||||
|
||||
if (Page1GSupport) {
|
||||
PageDirectory1GEntry = (VOID *) PageDirectoryPointerEntry;
|
||||
|
||||
|
||||
for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectory1GEntry++, PageAddress += SIZE_1GB) {
|
||||
//
|
||||
// Fill in the Page Directory entries
|
||||
@@ -216,7 +216,7 @@ Create4GPageTables (
|
||||
//
|
||||
// Each Directory Pointer entries points to a page of Page Directory entires.
|
||||
// So allocate space for them and fill them in in the IndexOfPageDirectoryEntries loop.
|
||||
//
|
||||
//
|
||||
PageDirectoryEntry = (VOID *) BigPageAddress;
|
||||
BigPageAddress += SIZE_4KB;
|
||||
|
||||
@@ -360,7 +360,7 @@ Thunk32To64 (
|
||||
if ((UINTN) ReturnContext->ReturnStatus != 0) {
|
||||
Status = ENCODE_ERROR ((UINTN) ReturnContext->ReturnStatus);
|
||||
}
|
||||
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ ModeSwitch (
|
||||
|
||||
ZeroMem (&Context, sizeof (SWITCH_32_TO_64_CONTEXT));
|
||||
ZeroMem (&ReturnContext, sizeof (SWITCH_64_TO_32_CONTEXT));
|
||||
|
||||
|
||||
MemoryBase64 = (UINT64) (UINTN) *MemoryBase;
|
||||
MemorySize64 = (UINT64) (UINTN) *MemorySize;
|
||||
MemoryEnd64 = MemoryBase64 + MemorySize64;
|
||||
@@ -409,7 +409,7 @@ ModeSwitch (
|
||||
Page1GSupport = IsPage1GSupport ();
|
||||
|
||||
//
|
||||
// Merge memory range reserved for stack and page table
|
||||
// Merge memory range reserved for stack and page table
|
||||
//
|
||||
if (LongModeBuffer->StackBaseAddress < LongModeBuffer->PageTableAddress) {
|
||||
ReservedRangeBase = LongModeBuffer->StackBaseAddress;
|
||||
@@ -462,14 +462,14 @@ ModeSwitch (
|
||||
// Will save the return status of processing capsule
|
||||
//
|
||||
ReturnContext.ReturnStatus = 0;
|
||||
|
||||
|
||||
//
|
||||
// Save original GDT
|
||||
//
|
||||
AsmReadGdtr ((IA32_DESCRIPTOR *)&ReturnContext.Gdtr);
|
||||
|
||||
|
||||
Status = Thunk32To64 (LongModeBuffer->PageTableAddress, &Context, &ReturnContext);
|
||||
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
*MemoryBase = (VOID *) (UINTN) MemoryBase64;
|
||||
*MemorySize = (UINTN) MemorySize64;
|
||||
@@ -685,7 +685,7 @@ MergeMemoryResourceDescriptor (
|
||||
if (NewMemoryResourceEntry != MemoryResourceEntry) {
|
||||
NewMemoryResourceEntry->ResourceLength += NextMemoryResourceEntry->ResourceLength;
|
||||
}
|
||||
|
||||
|
||||
NextMemoryResourceEntry = NextMemoryResourceEntry + 1;
|
||||
}
|
||||
|
||||
@@ -743,7 +743,7 @@ BuildMemoryResourceDescriptor (
|
||||
Status = PeiServicesAllocatePool ((1 + 1) * sizeof (MEMORY_RESOURCE_DESCRIPTOR), (VOID **) &MemoryResource);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
ZeroMem (MemoryResource, (1 + 1) * sizeof (MEMORY_RESOURCE_DESCRIPTOR));
|
||||
|
||||
|
||||
MemoryResource[0].PhysicalStart = 0;
|
||||
MemoryResource[0].ResourceLength = LShiftU64 (1, GetPhysicalAddressBits ());
|
||||
DEBUG ((EFI_D_INFO, "MemoryResource[0x0] - Start(0x%0lx) Length(0x%0lx)\n",
|
||||
@@ -828,7 +828,7 @@ GetCapsuleDescriptors (
|
||||
CapsuleVarName[0] = 0;
|
||||
ValidIndex = 0;
|
||||
CapsuleDataPtr64 = 0;
|
||||
|
||||
|
||||
Status = PeiServicesLocatePpi (
|
||||
&gEfiPeiReadOnlyVariable2PpiGuid,
|
||||
0,
|
||||
@@ -885,7 +885,7 @@ GetCapsuleDescriptors (
|
||||
if (EFI_ERROR (Status)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// If this BlockList has been linked before, skip this variable
|
||||
//
|
||||
@@ -901,7 +901,7 @@ GetCapsuleDescriptors (
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Cache BlockList which has been processed
|
||||
//
|
||||
@@ -909,7 +909,7 @@ GetCapsuleDescriptors (
|
||||
Index ++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -949,7 +949,7 @@ CapsuleCoalesce (
|
||||
UINTN VariableCount;
|
||||
CHAR16 CapsuleVarName[30];
|
||||
CHAR16 *TempVarName;
|
||||
EFI_PHYSICAL_ADDRESS CapsuleDataPtr64;
|
||||
EFI_PHYSICAL_ADDRESS CapsuleDataPtr64;
|
||||
EFI_STATUS Status;
|
||||
EFI_BOOT_MODE BootMode;
|
||||
EFI_PEI_READ_ONLY_VARIABLE2_PPI *PPIVariableServices;
|
||||
@@ -973,11 +973,11 @@ CapsuleCoalesce (
|
||||
//
|
||||
Status = PeiServicesGetBootMode (&BootMode);
|
||||
if (EFI_ERROR (Status) || (BootMode != BOOT_ON_FLASH_UPDATE)) {
|
||||
DEBUG ((EFI_D_ERROR, "Boot mode is not correct for capsule update path.\n"));
|
||||
DEBUG ((EFI_D_ERROR, "Boot mode is not correct for capsule update path.\n"));
|
||||
Status = EFI_NOT_FOUND;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// User may set the same ScatterGatherList with several different variables,
|
||||
// so cache all ScatterGatherList for check later.
|
||||
@@ -1022,9 +1022,9 @@ CapsuleCoalesce (
|
||||
VariableCount++;
|
||||
Index++;
|
||||
}
|
||||
|
||||
|
||||
DEBUG ((EFI_D_INFO,"Capsule variable count = %d\n", VariableCount));
|
||||
|
||||
|
||||
//
|
||||
// The last entry is the end flag.
|
||||
//
|
||||
@@ -1037,9 +1037,9 @@ CapsuleCoalesce (
|
||||
DEBUG ((EFI_D_ERROR, "AllocatePages Failed!, Status = %x\n", Status));
|
||||
goto Done;
|
||||
}
|
||||
|
||||
|
||||
ZeroMem (VariableArrayAddress, (VariableCount + 1) * sizeof (EFI_PHYSICAL_ADDRESS));
|
||||
|
||||
|
||||
//
|
||||
// Find out if we actually have a capsule.
|
||||
// GetCapsuleDescriptors depends on variable PPI, so it should run in 32-bit environment.
|
||||
@@ -1068,7 +1068,7 @@ CapsuleCoalesce (
|
||||
Status = EFI_NOT_FOUND;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
|
||||
Status = FindCapsuleCoalesceImage (&CoalesceImageEntryPoint, &CoalesceImageMachineType);
|
||||
if ((EFI_ERROR (Status)) || (CoalesceImageMachineType != EFI_IMAGE_MACHINE_X64)) {
|
||||
DEBUG ((EFI_D_ERROR, "Fail to find CapsuleX64 module in FV!\n"));
|
||||
@@ -1090,13 +1090,13 @@ CapsuleCoalesce (
|
||||
//
|
||||
Status = CapsuleDataCoalesce (PeiServices, (EFI_PHYSICAL_ADDRESS *)(UINTN)VariableArrayAddress, MemoryResource, MemoryBase, MemorySize);
|
||||
#endif
|
||||
|
||||
|
||||
DEBUG ((EFI_D_INFO, "Capsule Coalesce Status = %r!\n", Status));
|
||||
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
DEBUG ((EFI_D_ERROR, "There is not enough memory to process capsule!\n"));
|
||||
}
|
||||
|
||||
|
||||
if (Status == EFI_NOT_FOUND) {
|
||||
DEBUG ((EFI_D_ERROR, "Fail to parse capsule descriptor in memory!\n"));
|
||||
REPORT_STATUS_CODE (
|
||||
@@ -1129,9 +1129,9 @@ CheckCapsuleUpdate (
|
||||
return Status;
|
||||
}
|
||||
/**
|
||||
This function will look at a capsule and determine if it's a test pattern.
|
||||
This function will look at a capsule and determine if it's a test pattern.
|
||||
If it is, then it will verify it and emit an error message if corruption is detected.
|
||||
|
||||
|
||||
@param PeiServices Standard pei services pointer
|
||||
@param CapsuleBase Base address of coalesced capsule, which is preceeded
|
||||
by private data. Very implementation specific.
|
||||
@@ -1220,7 +1220,7 @@ CreateState (
|
||||
UINT32 Index;
|
||||
EFI_PHYSICAL_ADDRESS BaseAddress;
|
||||
UINT64 Length;
|
||||
|
||||
|
||||
PrivateData = (EFI_CAPSULE_PEIM_PRIVATE_DATA *) CapsuleBase;
|
||||
if (PrivateData->Signature != EFI_CAPSULE_PEIM_PRIVATE_DATA_SIGNATURE) {
|
||||
return EFI_VOLUME_CORRUPTED;
|
||||
@@ -1276,7 +1276,7 @@ CreateState (
|
||||
|
||||
BuildCvHob (BaseAddress, Length);
|
||||
}
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user