summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-03-06 11:04:27 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-03-07 12:37:24 +0800
commit38cde47ec5e99312f3b4ef8a3f89f4878b0b319a (patch)
treed46f031076529b71632bc43db57eebe9e9445d1d /MdeModulePkg
parent86445d72de2847c07bba7a75b543ee967eae4b8d (diff)
downloadedk2-38cde47ec5e99312f3b4ef8a3f89f4878b0b319a.tar.gz
edk2-38cde47ec5e99312f3b4ef8a3f89f4878b0b319a.tar.bz2
edk2-38cde47ec5e99312f3b4ef8a3f89f4878b0b319a.zip
MdeModulePkg/NullMemoryTest: Change prototype of ConvertToTestedMemory
The patch should not impact the functionality. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit ee37e96479702566ef466bbbaae530c737c52b72)
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c b/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c
index 11af8ea77f..c66f3fd208 100644
--- a/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c
+++ b/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c
@@ -59,37 +59,40 @@ GenericMemoryTestEntryPoint (
}
/**
- Convert the memory descriptor to tested.
+ Convert the memory range to tested.
- @param Descriptor Pointer to EFI_GCD_MEMORY_SPACE_DESCRIPTOR
+ @param BaseAddress Base address of the memory range.
+ @param Length Length of the memory range.
+ @param Capabilities Capabilities of the memory range.
- @retval EFI_SUCCESS The memory descriptor is converted to tested.
+ @retval EFI_SUCCESS The memory range is converted to tested.
@retval others Error happens.
**/
EFI_STATUS
ConvertToTestedMemory (
- IN CONST EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor
+ IN UINT64 BaseAddress,
+ IN UINT64 Length,
+ IN UINT64 Capabilities
)
{
EFI_STATUS Status;
Status = gDS->RemoveMemorySpace (
- Descriptor->BaseAddress,
- Descriptor->Length
+ BaseAddress,
+ Length
);
if (!EFI_ERROR (Status)) {
Status = gDS->AddMemorySpace (
- ((Descriptor->Capabilities & EFI_MEMORY_MORE_RELIABLE) == EFI_MEMORY_MORE_RELIABLE) ?
+ ((Capabilities & EFI_MEMORY_MORE_RELIABLE) == EFI_MEMORY_MORE_RELIABLE) ?
EfiGcdMemoryTypeMoreReliable : EfiGcdMemoryTypeSystemMemory,
- Descriptor->BaseAddress,
- Descriptor->Length,
- Descriptor->Capabilities &~
+ BaseAddress,
+ Length,
+ Capabilities &~
(EFI_MEMORY_PRESENT | EFI_MEMORY_INITIALIZED | EFI_MEMORY_TESTED | EFI_MEMORY_RUNTIME)
);
}
return Status;
}
-
/**
Initialize the generic memory test.
@@ -129,7 +132,11 @@ InitializeMemoryTest (
//
// For those reserved memory that have not been tested, simply promote to system memory.
//
- Status = ConvertToTestedMemory (&MemorySpaceMap[Index]);
+ Status = ConvertToTestedMemory (
+ MemorySpaceMap[Index].BaseAddress,
+ MemorySpaceMap[Index].Length,
+ MemorySpaceMap[Index].Capabilities
+ );
ASSERT_EFI_ERROR (Status);
mTestedSystemMemory += MemorySpaceMap[Index].Length;
mTotalSystemMemory += MemorySpaceMap[Index].Length;
@@ -236,7 +243,11 @@ GenCompatibleRangeTest (
Status = gDS->GetMemorySpaceDescriptor (StartAddress, &Descriptor);
if (!EFI_ERROR (Status)) {
- Status = ConvertToTestedMemory (&Descriptor);
+ Status = ConvertToTestedMemory (
+ Descriptor.BaseAddress,
+ Descriptor.Length,
+ Descriptor.Capabilities
+ );
}
return Status;
}