summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg/Library
diff options
context:
space:
mode:
authorWei6 Xu <wei6.xu@intel.com>2024-05-14 01:22:03 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-08-28 15:25:27 +0000
commit0f89005d71b79cb795adf5806845a9790df44839 (patch)
tree11dba8b398740c1b00cdb305d291e2abc40499d5 /StandaloneMmPkg/Library
parent189398dcf8652efcd54de71f1f1395813d903c5e (diff)
downloadedk2-0f89005d71b79cb795adf5806845a9790df44839.tar.gz
edk2-0f89005d71b79cb795adf5806845a9790df44839.tar.bz2
edk2-0f89005d71b79cb795adf5806845a9790df44839.zip
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>
Diffstat (limited to 'StandaloneMmPkg/Library')
-rw-r--r--StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf1
-rw-r--r--StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c43
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 (