diff options
2 files changed, 16 insertions, 30 deletions
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.c b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.c index 2246823886..afced78cde 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.c @@ -845,9 +845,6 @@ MemoryAllocationLibConstructor ( IN EFI_MM_SYSTEM_TABLE *MmSystemTable
)
{
- MM_CORE_PRIVATE_DATA *MmCorePrivate;
- EFI_HOB_GUID_TYPE *GuidHob;
- MM_CORE_DATA_HOB_DATA *DataInHob;
VOID *HobStart;
EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHobData;
EFI_MMRAM_DESCRIPTOR *MmramRanges;
@@ -858,35 +855,26 @@ MemoryAllocationLibConstructor ( DEBUG ((DEBUG_INFO, "StandaloneMmCoreMemoryAllocationLibConstructor - 0x%x\n", HobStart));
//
- // Extract MM Core Private context from the Hob. If absent search for
- // a Hob containing the MMRAM ranges
+ // Search for a Hob containing the MMRAM ranges
//
- GuidHob = GetNextGuidHob (&gMmCoreDataHobGuid, HobStart);
- if (GuidHob == NULL) {
- MmramRangesHob = GetNextGuidHob (&gEfiMmPeiMmramMemoryReserveGuid, HobStart);
- if (MmramRangesHob == NULL) {
- return EFI_UNSUPPORTED;
- }
+ MmramRangesHob = GetNextGuidHob (&gEfiMmPeiMmramMemoryReserveGuid, HobStart);
+ if (MmramRangesHob == NULL) {
+ return EFI_UNSUPPORTED;
+ }
- MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob);
- if (MmramRangesHobData == NULL) {
- return EFI_UNSUPPORTED;
- }
+ MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob);
+ if (MmramRangesHobData == NULL) {
+ return EFI_UNSUPPORTED;
+ }
- MmramRanges = MmramRangesHobData->Descriptor;
- if (MmramRanges == NULL) {
- return EFI_UNSUPPORTED;
- }
+ MmramRanges = MmramRangesHobData->Descriptor;
+ if (MmramRanges == NULL) {
+ return EFI_UNSUPPORTED;
+ }
- MmramRangeCount = (UINTN)MmramRangesHobData->NumberOfMmReservedRegions;
- if (MmramRanges == NULL) {
- return EFI_UNSUPPORTED;
- }
- } else {
- DataInHob = GET_GUID_HOB_DATA (GuidHob);
- MmCorePrivate = (MM_CORE_PRIVATE_DATA *)(UINTN)DataInHob->Address;
- MmramRanges = (EFI_MMRAM_DESCRIPTOR *)(UINTN)MmCorePrivate->MmramRanges;
- MmramRangeCount = (UINTN)MmCorePrivate->MmramRangeCount;
+ MmramRangeCount = (UINTN)MmramRangesHobData->NumberOfMmReservedRegions;
+ if (MmramRanges == NULL) {
+ return EFI_UNSUPPORTED;
}
{
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationServices.h b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationServices.h index 833ab0d177..1fd0478707 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationServices.h +++ b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationServices.h @@ -14,8 +14,6 @@ #ifndef _PI_MM_CORE_MEMORY_ALLOCATION_SERVICES_H_
#define _PI_MM_CORE_MEMORY_ALLOCATION_SERVICES_H_
-#include <Guid/MmCoreData.h>
-
/**
Called to initialize the memory service.
|