summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei6 Xu <wei6.xu@intel.com>2024-05-14 01:20:38 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-08-28 15:25:27 +0000
commit189398dcf8652efcd54de71f1f1395813d903c5e (patch)
treeae7d2d295183c60c8b22b5780de936655e2d8687
parent18591343b224316df6f616441d69a954b8350e22 (diff)
downloadedk2-189398dcf8652efcd54de71f1f1395813d903c5e.tar.gz
edk2-189398dcf8652efcd54de71f1f1395813d903c5e.tar.bz2
edk2-189398dcf8652efcd54de71f1f1395813d903c5e.zip
StandaloneMmCoreMemoryAllocationLib: 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>
-rw-r--r--StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.c44
-rw-r--r--StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationServices.h2
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.