mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-26 23:24:03 +02:00
StandaloneMmMemLib: Drop MM_CORE_PRIVATE_DATA
MM_CORE_PRIVATE_DATA is not used as shared structures between MM IPL and MM Core, therefore clean up the code related to gMmCorePrivate. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
This commit is contained in:
parent
189398dcf8
commit
0f89005d71
@ -51,5 +51,4 @@
|
|||||||
MemoryAllocationLib
|
MemoryAllocationLib
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gMmCoreDataHobGuid ## SOMETIMES_CONSUMES ## HOB
|
|
||||||
gEfiMmPeiMmramMemoryReserveGuid ## SOMETIMES_CONSUMES ## HOB
|
gEfiMmPeiMmramMemoryReserveGuid ## SOMETIMES_CONSUMES ## HOB
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/HobLib.h>
|
#include <Library/HobLib.h>
|
||||||
|
|
||||||
#include <Guid/MmCoreData.h>
|
|
||||||
#include <Guid/MmramMemoryReserve.h>
|
#include <Guid/MmramMemoryReserve.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -87,9 +86,6 @@ MmMemLibInternalPopulateMmramRanges (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
VOID *HobStart;
|
VOID *HobStart;
|
||||||
EFI_HOB_GUID_TYPE *GuidHob;
|
|
||||||
MM_CORE_DATA_HOB_DATA *DataInHob;
|
|
||||||
MM_CORE_PRIVATE_DATA *MmCorePrivateData;
|
|
||||||
EFI_HOB_GUID_TYPE *MmramRangesHob;
|
EFI_HOB_GUID_TYPE *MmramRangesHob;
|
||||||
EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHobData;
|
EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHobData;
|
||||||
EFI_MMRAM_DESCRIPTOR *MmramDescriptors;
|
EFI_MMRAM_DESCRIPTOR *MmramDescriptors;
|
||||||
@ -98,11 +94,8 @@ MmMemLibInternalPopulateMmramRanges (
|
|||||||
DEBUG ((DEBUG_INFO, "%a - 0x%x\n", __func__, HobStart));
|
DEBUG ((DEBUG_INFO, "%a - 0x%x\n", __func__, HobStart));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Extract MM Core Private context from the Hob. If absent search for
|
// Search for a Hob containing the MMRAM ranges
|
||||||
// a Hob containing the MMRAM ranges
|
|
||||||
//
|
//
|
||||||
GuidHob = GetNextGuidHob (&gMmCoreDataHobGuid, HobStart);
|
|
||||||
if (GuidHob == NULL) {
|
|
||||||
MmramRangesHob = GetFirstGuidHob (&gEfiMmPeiMmramMemoryReserveGuid);
|
MmramRangesHob = GetFirstGuidHob (&gEfiMmPeiMmramMemoryReserveGuid);
|
||||||
if (MmramRangesHob == NULL) {
|
if (MmramRangesHob == NULL) {
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
@ -115,20 +108,6 @@ MmMemLibInternalPopulateMmramRanges (
|
|||||||
|
|
||||||
mMmMemLibInternalMmramCount = MmramRangesHobData->NumberOfMmReservedRegions;
|
mMmMemLibInternalMmramCount = MmramRangesHobData->NumberOfMmReservedRegions;
|
||||||
MmramDescriptors = MmramRangesHobData->Descriptor;
|
MmramDescriptors = MmramRangesHobData->Descriptor;
|
||||||
} else {
|
|
||||||
DataInHob = GET_GUID_HOB_DATA (GuidHob);
|
|
||||||
if (DataInHob == NULL) {
|
|
||||||
return EFI_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
MmCorePrivateData = (MM_CORE_PRIVATE_DATA *)(UINTN)DataInHob->Address;
|
|
||||||
if ((MmCorePrivateData == NULL) || (MmCorePrivateData->MmramRanges == 0)) {
|
|
||||||
return EFI_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
mMmMemLibInternalMmramCount = (UINTN)MmCorePrivateData->MmramRangeCount;
|
|
||||||
MmramDescriptors = (EFI_MMRAM_DESCRIPTOR *)(UINTN)MmCorePrivateData->MmramRanges;
|
|
||||||
}
|
|
||||||
|
|
||||||
mMmMemLibInternalMmramRanges = AllocatePool (mMmMemLibInternalMmramCount * sizeof (EFI_MMRAM_DESCRIPTOR));
|
mMmMemLibInternalMmramRanges = AllocatePool (mMmMemLibInternalMmramCount * sizeof (EFI_MMRAM_DESCRIPTOR));
|
||||||
if (mMmMemLibInternalMmramRanges) {
|
if (mMmMemLibInternalMmramRanges) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user