MdeModulePkg PiSmmCore: Remove redundant functions

The functions that are never called have been removed.
They are IsImageInsideSmram,FindImageRecord,SmmRemoveImageRecord,
SmmMemoryAttributesTableConsistencyCheck,DumpSmmMemoryMapEntry,
SmmMemoryMapConsistencyCheckRange,SmmMemoryMapConsistencyCheck,
DumpSmmMemoryMap,ClearGuardMapBit,SetGuardMapBit,AdjustMemoryA,
AdjustMemoryS,IsHeadGuard and IsTailGuard.
FindImageRecord() is called by SmmRemoveImageRecord(); however,
nothing calls SmmRemoveImageRecord().
SmmMemoryMapConsistencyCheckRange() is called by
SmmMemoryMapConsistencyCheck(); however, nothing calls
SmmMemoryMapConsistencyCheck().
https://bugzilla.tianocore.org/show_bug.cgi?id=1062

v2:append the following to the commit message.
- FindImageRecord() is called by SmmRemoveImageRecord(); however,
nothing calls SmmRemoveImageRecord().
- SmmMemoryMapConsistencyCheckRange() is called by
SmmMemoryMapConsistencyCheck(); however, nothing calls
SmmMemoryMapConsistencyCheck().

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei <shenglei.zhang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
shenglei
2018-08-08 15:52:21 +08:00
committed by Star Zeng
parent 5bde6c2019
commit d637282efe
3 changed files with 0 additions and 418 deletions

View File

@ -451,128 +451,7 @@ GetSmmMemoryMapEntryCount (
return Count;
}
/**
Dump Smm memory map entry.
**/
VOID
DumpSmmMemoryMapEntry (
VOID
)
{
LIST_ENTRY *Link;
MEMORY_MAP *Entry;
EFI_PHYSICAL_ADDRESS Last;
Last = 0;
DEBUG ((DEBUG_INFO, "DumpSmmMemoryMapEntry:\n"));
Link = gMemoryMap.ForwardLink;
while (Link != &gMemoryMap) {
Entry = CR (Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE);
Link = Link->ForwardLink;
if ((Last != 0) && (Last != (UINT64)-1)) {
if (Last + 1 != Entry->Start) {
Last = (UINT64)-1;
} else {
Last = Entry->End;
}
} else if (Last == 0) {
Last = Entry->End;
}
DEBUG ((DEBUG_INFO, "Entry (Link - 0x%x)\n", &Entry->Link));
DEBUG ((DEBUG_INFO, " Signature - 0x%x\n", Entry->Signature));
DEBUG ((DEBUG_INFO, " Link.ForwardLink - 0x%x\n", Entry->Link.ForwardLink));
DEBUG ((DEBUG_INFO, " Link.BackLink - 0x%x\n", Entry->Link.BackLink));
DEBUG ((DEBUG_INFO, " Type - 0x%x\n", Entry->Type));
DEBUG ((DEBUG_INFO, " Start - 0x%016lx\n", Entry->Start));
DEBUG ((DEBUG_INFO, " End - 0x%016lx\n", Entry->End));
}
ASSERT (Last != (UINT64)-1);
}
/**
Dump Smm memory map.
**/
VOID
DumpSmmMemoryMap (
VOID
)
{
LIST_ENTRY *Node;
FREE_PAGE_LIST *Pages;
DEBUG ((DEBUG_INFO, "DumpSmmMemoryMap\n"));
Pages = NULL;
Node = mSmmMemoryMap.ForwardLink;
while (Node != &mSmmMemoryMap) {
Pages = BASE_CR (Node, FREE_PAGE_LIST, Link);
DEBUG ((DEBUG_INFO, "Pages - 0x%x\n", Pages));
DEBUG ((DEBUG_INFO, "Pages->NumberOfPages - 0x%x\n", Pages->NumberOfPages));
Node = Node->ForwardLink;
}
}
/**
Check if a Smm base~length is in Smm memory map.
@param[in] Base The base address of Smm memory to be checked.
@param[in] Length THe length of Smm memory to be checked.
@retval TRUE Smm base~length is in smm memory map.
@retval FALSE Smm base~length is in smm memory map.
**/
BOOLEAN
SmmMemoryMapConsistencyCheckRange (
IN EFI_PHYSICAL_ADDRESS Base,
IN UINTN Length
)
{
LIST_ENTRY *Link;
MEMORY_MAP *Entry;
BOOLEAN Result;
Result = FALSE;
Link = gMemoryMap.ForwardLink;
while (Link != &gMemoryMap) {
Entry = CR (Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE);
Link = Link->ForwardLink;
if (Entry->Type != EfiConventionalMemory) {
continue;
}
if (Entry->Start == Base && Entry->End == Base + Length - 1) {
Result = TRUE;
break;
}
}
return Result;
}
/**
Check the consistency of Smm memory map.
**/
VOID
SmmMemoryMapConsistencyCheck (
VOID
)
{
LIST_ENTRY *Node;
FREE_PAGE_LIST *Pages;
BOOLEAN Result;
Pages = NULL;
Node = mSmmMemoryMap.ForwardLink;
while (Node != &mSmmMemoryMap) {
Pages = BASE_CR (Node, FREE_PAGE_LIST, Link);
Result = SmmMemoryMapConsistencyCheckRange ((EFI_PHYSICAL_ADDRESS)(UINTN)Pages, (UINTN)EFI_PAGES_TO_SIZE(Pages->NumberOfPages));
ASSERT (Result);
Node = Node->ForwardLink;
}
}
/**
Internal Function. Allocate n pages from given free page node.