diff options
Diffstat (limited to 'StandaloneMmPkg/Library')
-rw-r--r-- | StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf | 1 | ||||
-rw-r--r-- | StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c | 43 |
2 files changed, 11 insertions, 33 deletions
diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf b/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf index ed3cdf1994..696b8e0689 100644 --- a/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf +++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf @@ -51,5 +51,4 @@ MemoryAllocationLib
[Guids]
- gMmCoreDataHobGuid ## SOMETIMES_CONSUMES ## HOB
gEfiMmPeiMmramMemoryReserveGuid ## SOMETIMES_CONSUMES ## HOB
diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c b/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c index 0b4b1174de..c8ffe43cd1 100644 --- a/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c +++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c @@ -20,7 +20,6 @@ #include <Library/DebugLib.h>
#include <Library/HobLib.h>
-#include <Guid/MmCoreData.h>
#include <Guid/MmramMemoryReserve.h>
//
@@ -87,9 +86,6 @@ MmMemLibInternalPopulateMmramRanges ( )
{
VOID *HobStart;
- EFI_HOB_GUID_TYPE *GuidHob;
- MM_CORE_DATA_HOB_DATA *DataInHob;
- MM_CORE_PRIVATE_DATA *MmCorePrivateData;
EFI_HOB_GUID_TYPE *MmramRangesHob;
EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHobData;
EFI_MMRAM_DESCRIPTOR *MmramDescriptors;
@@ -98,38 +94,21 @@ MmMemLibInternalPopulateMmramRanges ( DEBUG ((DEBUG_INFO, "%a - 0x%x\n", __func__, 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 = GetFirstGuidHob (&gEfiMmPeiMmramMemoryReserveGuid);
- if (MmramRangesHob == NULL) {
- return EFI_UNSUPPORTED;
- }
-
- MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob);
- if ((MmramRangesHobData == NULL) || (MmramRangesHobData->Descriptor == NULL)) {
- return EFI_UNSUPPORTED;
- }
-
- mMmMemLibInternalMmramCount = MmramRangesHobData->NumberOfMmReservedRegions;
- 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;
- }
+ MmramRangesHob = GetFirstGuidHob (&gEfiMmPeiMmramMemoryReserveGuid);
+ if (MmramRangesHob == NULL) {
+ return EFI_UNSUPPORTED;
+ }
- mMmMemLibInternalMmramCount = (UINTN)MmCorePrivateData->MmramRangeCount;
- MmramDescriptors = (EFI_MMRAM_DESCRIPTOR *)(UINTN)MmCorePrivateData->MmramRanges;
+ MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob);
+ if ((MmramRangesHobData == NULL) || (MmramRangesHobData->Descriptor == NULL)) {
+ return EFI_UNSUPPORTED;
}
+ mMmMemLibInternalMmramCount = MmramRangesHobData->NumberOfMmReservedRegions;
+ MmramDescriptors = MmramRangesHobData->Descriptor;
+
mMmMemLibInternalMmramRanges = AllocatePool (mMmMemLibInternalMmramCount * sizeof (EFI_MMRAM_DESCRIPTOR));
if (mMmMemLibInternalMmramRanges) {
CopyMem (
|