MdeModulePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg 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: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
committed by
mergify[bot]
parent
7c7184e201
commit
1436aea4d5
@ -6,12 +6,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#include "NullMemoryTest.h"
|
||||
|
||||
UINT64 mTestedSystemMemory = 0;
|
||||
UINT64 mTotalSystemMemory = 0;
|
||||
EFI_HANDLE mGenericMemoryTestHandle;
|
||||
UINT64 mTestedSystemMemory = 0;
|
||||
UINT64 mTotalSystemMemory = 0;
|
||||
EFI_HANDLE mGenericMemoryTestHandle;
|
||||
|
||||
EFI_GENERIC_MEMORY_TEST_PROTOCOL mGenericMemoryTest = {
|
||||
InitializeMemoryTest,
|
||||
@ -35,8 +34,8 @@ EFI_GENERIC_MEMORY_TEST_PROTOCOL mGenericMemoryTest = {
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GenericMemoryTestEntryPoint (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
@ -64,12 +63,13 @@ GenericMemoryTestEntryPoint (
|
||||
**/
|
||||
EFI_STATUS
|
||||
ConvertToTestedMemory (
|
||||
IN UINT64 BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Capabilities
|
||||
IN UINT64 BaseAddress,
|
||||
IN UINT64 Length,
|
||||
IN UINT64 Capabilities
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = gDS->RemoveMemorySpace (
|
||||
BaseAddress,
|
||||
Length
|
||||
@ -84,6 +84,7 @@ ConvertToTestedMemory (
|
||||
(EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED | EFI_MEMORY_TESTED | EFI_MEMORY_RUNTIME)
|
||||
);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -107,22 +108,23 @@ ConvertToTestedMemory (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InitializeMemoryTest (
|
||||
IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
|
||||
IN EXTENDMEM_COVERAGE_LEVEL Level,
|
||||
OUT BOOLEAN *RequireSoftECCInit
|
||||
IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
|
||||
IN EXTENDMEM_COVERAGE_LEVEL Level,
|
||||
OUT BOOLEAN *RequireSoftECCInit
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN NumberOfDescriptors;
|
||||
EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap;
|
||||
UINTN Index;
|
||||
EFI_STATUS Status;
|
||||
UINTN NumberOfDescriptors;
|
||||
EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap;
|
||||
UINTN Index;
|
||||
|
||||
gDS->GetMemorySpaceMap (&NumberOfDescriptors, &MemorySpaceMap);
|
||||
for (Index = 0; Index < NumberOfDescriptors; Index++) {
|
||||
if (MemorySpaceMap[Index].GcdMemoryType == EfiGcdMemoryTypeReserved &&
|
||||
(MemorySpaceMap[Index].Capabilities & (EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED | EFI_MEMORY_TESTED)) ==
|
||||
(EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED)
|
||||
) {
|
||||
if ((MemorySpaceMap[Index].GcdMemoryType == EfiGcdMemoryTypeReserved) &&
|
||||
((MemorySpaceMap[Index].Capabilities & (EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED | EFI_MEMORY_TESTED)) ==
|
||||
(EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED))
|
||||
)
|
||||
{
|
||||
//
|
||||
// For those reserved memory that have not been tested, simply promote to system memory.
|
||||
//
|
||||
@ -133,9 +135,10 @@ InitializeMemoryTest (
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
mTestedSystemMemory += MemorySpaceMap[Index].Length;
|
||||
mTotalSystemMemory += MemorySpaceMap[Index].Length;
|
||||
mTotalSystemMemory += MemorySpaceMap[Index].Length;
|
||||
} else if ((MemorySpaceMap[Index].GcdMemoryType == EfiGcdMemoryTypeSystemMemory) ||
|
||||
(MemorySpaceMap[Index].GcdMemoryType == EfiGcdMemoryTypeMoreReliable)) {
|
||||
(MemorySpaceMap[Index].GcdMemoryType == EfiGcdMemoryTypeMoreReliable))
|
||||
{
|
||||
mTotalSystemMemory += MemorySpaceMap[Index].Length;
|
||||
}
|
||||
}
|
||||
@ -172,11 +175,11 @@ InitializeMemoryTest (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GenPerformMemoryTest (
|
||||
IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
|
||||
IN OUT UINT64 *TestedMemorySize,
|
||||
OUT UINT64 *TotalMemorySize,
|
||||
OUT BOOLEAN *ErrorOut,
|
||||
IN BOOLEAN TestAbort
|
||||
IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
|
||||
IN OUT UINT64 *TestedMemorySize,
|
||||
OUT UINT64 *TotalMemorySize,
|
||||
OUT BOOLEAN *ErrorOut,
|
||||
IN BOOLEAN TestAbort
|
||||
)
|
||||
{
|
||||
*ErrorOut = FALSE;
|
||||
@ -184,7 +187,6 @@ GenPerformMemoryTest (
|
||||
*TotalMemorySize = mTotalSystemMemory;
|
||||
|
||||
return EFI_NOT_FOUND;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -203,7 +205,7 @@ GenPerformMemoryTest (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GenMemoryTestFinished (
|
||||
IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This
|
||||
IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This
|
||||
)
|
||||
{
|
||||
return EFI_SUCCESS;
|
||||
@ -227,15 +229,15 @@ GenMemoryTestFinished (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GenCompatibleRangeTest (
|
||||
IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
|
||||
IN EFI_PHYSICAL_ADDRESS StartAddress,
|
||||
IN UINT64 Length
|
||||
IN EFI_GENERIC_MEMORY_TEST_PROTOCOL *This,
|
||||
IN EFI_PHYSICAL_ADDRESS StartAddress,
|
||||
IN UINT64 Length
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_GCD_MEMORY_SPACE_DESCRIPTOR Descriptor;
|
||||
EFI_PHYSICAL_ADDRESS CurrentBase;
|
||||
UINT64 CurrentLength;
|
||||
EFI_STATUS Status;
|
||||
EFI_GCD_MEMORY_SPACE_DESCRIPTOR Descriptor;
|
||||
EFI_PHYSICAL_ADDRESS CurrentBase;
|
||||
UINT64 CurrentLength;
|
||||
|
||||
//
|
||||
// Check if the parameter is below 16MB
|
||||
@ -243,6 +245,7 @@ GenCompatibleRangeTest (
|
||||
if (StartAddress + Length > SIZE_16MB) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
CurrentBase = StartAddress;
|
||||
do {
|
||||
//
|
||||
@ -257,14 +260,16 @@ GenCompatibleRangeTest (
|
||||
return Status;
|
||||
}
|
||||
|
||||
if (Descriptor.GcdMemoryType == EfiGcdMemoryTypeReserved &&
|
||||
(Descriptor.Capabilities & (EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED | EFI_MEMORY_TESTED)) ==
|
||||
(EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED)
|
||||
) {
|
||||
if ((Descriptor.GcdMemoryType == EfiGcdMemoryTypeReserved) &&
|
||||
((Descriptor.Capabilities & (EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED | EFI_MEMORY_TESTED)) ==
|
||||
(EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED))
|
||||
)
|
||||
{
|
||||
CurrentLength = Descriptor.BaseAddress + Descriptor.Length - CurrentBase;
|
||||
if (CurrentBase + CurrentLength > StartAddress + Length) {
|
||||
CurrentLength = StartAddress + Length - CurrentBase;
|
||||
}
|
||||
|
||||
Status = ConvertToTestedMemory (
|
||||
CurrentBase,
|
||||
CurrentLength,
|
||||
@ -274,11 +279,12 @@ GenCompatibleRangeTest (
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
CurrentBase = Descriptor.BaseAddress + Descriptor.Length;
|
||||
} while (CurrentBase < StartAddress + Length);
|
||||
|
||||
//
|
||||
// Here means the required range already be tested, so just return success.
|
||||
//
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user