diff options
author | Ruiyu Ni <ruiyu.ni@intel.com> | 2018-03-06 11:04:27 +0800 |
---|---|---|
committer | Ruiyu Ni <ruiyu.ni@intel.com> | 2018-03-07 12:36:13 +0800 |
commit | ee37e96479702566ef466bbbaae530c737c52b72 (patch) | |
tree | 38923caafd32df7e6582b633b00eadbcc9442b63 /MdeModulePkg | |
parent | 5e3719aeaef198f36808a5e53a1f5bb23762e3a5 (diff) | |
download | edk2-ee37e96479702566ef466bbbaae530c737c52b72.tar.gz edk2-ee37e96479702566ef466bbbaae530c737c52b72.tar.bz2 edk2-ee37e96479702566ef466bbbaae530c737c52b72.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>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTest.c | 37 |
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;
}
|