mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-30 17:14:07 +02:00
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>
This commit is contained in:
parent
18591343b2
commit
189398dcf8
@ -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;
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -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.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user