summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
diff options
context:
space:
mode:
Diffstat (limited to 'StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c')
-rw-r--r--StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c69
1 files changed, 0 insertions, 69 deletions
diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c b/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
index 8f87e7803d..ee7aa74825 100644
--- a/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
+++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/X86StandaloneMmMemLibInternal.c
@@ -18,8 +18,6 @@
#include <Library/MemoryAllocationLib.h>
#include <Library/HobLib.h>
-#include <Guid/MmramMemoryReserve.h>
-
typedef struct {
EFI_PHYSICAL_ADDRESS Base;
UINT64 Length;
@@ -32,8 +30,6 @@ UINTN mValidNonMmramCount;
// Maximum support address used to check input buffer
//
extern EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress;
-extern EFI_MMRAM_DESCRIPTOR *mMmMemLibInternalMmramRanges;
-extern UINTN mMmMemLibInternalMmramCount;
/**
Calculate and save the maximum support address.
@@ -80,71 +76,6 @@ MmMemLibCalculateMaximumSupportAddress (
}
/**
- Initialize cached Mmram Ranges from HOB.
-
- @retval EFI_UNSUPPORTED The routine is unable to extract MMRAM information.
- @retval EFI_SUCCESS MmRanges are populated successfully.
-
-**/
-EFI_STATUS
-MmMemLibInternalPopulateMmramRanges (
- VOID
- )
-{
- VOID *HobStart;
- EFI_HOB_GUID_TYPE *MmramRangesHob;
- EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHobData;
- EFI_MMRAM_DESCRIPTOR *MmramDescriptors;
-
- HobStart = GetHobList ();
- DEBUG ((DEBUG_INFO, "%a - 0x%x\n", __func__, HobStart));
-
- //
- // Search for a Hob containing the MMRAM ranges
- //
- MmramRangesHob = GetFirstGuidHob (&gEfiSmmSmramMemoryGuid);
- if (MmramRangesHob == 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;
-
- mMmMemLibInternalMmramRanges = AllocatePool (mMmMemLibInternalMmramCount * sizeof (EFI_MMRAM_DESCRIPTOR));
- if (mMmMemLibInternalMmramRanges) {
- CopyMem (
- mMmMemLibInternalMmramRanges,
- MmramDescriptors,
- mMmMemLibInternalMmramCount * sizeof (EFI_MMRAM_DESCRIPTOR)
- );
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Deinitialize cached Mmram Ranges.
-
-**/
-VOID
-MmMemLibInternalFreeMmramRanges (
- VOID
- )
-{
- if (mMmMemLibInternalMmramRanges != NULL) {
- FreePool (mMmMemLibInternalMmramRanges);
- }
-}
-
-/**
Merge the overlapped or continuous ranges in input MemoryRange. This function is to optimize
the process of checking whether a buffer range belongs to the range reported by resource HOB,
since the buffer to be checked may be covered by multi resource HOB.