From 8171f0265b5f9e5274770653cdb7ed27c786b8b1 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Thu, 2 Jul 2015 07:32:10 +0000 Subject: [PATCH] MdeModulePkg: remove unused functions from Core/Dxe/Misc/PropertiesTable.c This removes the functions RevertRuntimeMemoryMap () and DumpMemoryMap () which are not referenced anywhere in the code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Reviewed-by: "Yao, Jiewen" git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17808 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c | 82 -------------------- 1 file changed, 82 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c index 3515993112..2424011365 100644 --- a/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c +++ b/MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c @@ -143,35 +143,6 @@ CoreReleasePropertiesTableLock ( CoreReleaseLock (&mPropertiesTableLock); } -/** - Dump memory map. - - @param MemoryMap A pointer to the buffer in which firmware places - the current memory map. - @param MemoryMapSize Size, in bytes, of the MemoryMap buffer. - @param DescriptorSize Size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR. -**/ -VOID -DumpMemoryMap ( - IN EFI_MEMORY_DESCRIPTOR *MemoryMap, - IN UINTN MemoryMapSize, - IN UINTN DescriptorSize - ) -{ - EFI_MEMORY_DESCRIPTOR *MemoryMapEntry; - EFI_MEMORY_DESCRIPTOR *MemoryMapEnd; - UINT64 MemoryBlockLength; - - DEBUG ((EFI_D_VERBOSE, " MemoryMap:\n")); - MemoryMapEntry = MemoryMap; - MemoryMapEnd = (EFI_MEMORY_DESCRIPTOR *) ((UINT8 *) MemoryMap + MemoryMapSize); - while (MemoryMapEntry < MemoryMapEnd) { - MemoryBlockLength = (UINT64) (EfiPagesToSize (MemoryMapEntry->NumberOfPages)); - DEBUG ((EFI_D_VERBOSE, " Entry(0x%02x) 0x%016lx - 0x%016lx (0x%016lx)\n", MemoryMapEntry->Type, MemoryMapEntry->PhysicalStart, MemoryMapEntry->PhysicalStart + MemoryBlockLength, MemoryMapEntry->Attribute)); - MemoryMapEntry = NEXT_MEMORY_DESCRIPTOR (MemoryMapEntry, DescriptorSize); - } -} - /** Sort memory map entries based upon PhysicalStart, from low to high. @@ -304,59 +275,6 @@ EnforceMemoryMapAttribute ( return ; } -/** - Sort memory map entries whose type is EfiRuntimeServicesCode/EfiRuntimeServicesData, - from high to low. - This function assumes memory map is already from low to high, so it just reverts them. - - @param MemoryMap A pointer to the buffer in which firmware places - the current memory map. - @param MemoryMapSize Size, in bytes, of the MemoryMap buffer. - @param DescriptorSize Size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR. -**/ -VOID -RevertRuntimeMemoryMap ( - IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap, - IN UINTN MemoryMapSize, - IN UINTN DescriptorSize - ) -{ - EFI_MEMORY_DESCRIPTOR *MemoryMapEntry; - EFI_MEMORY_DESCRIPTOR *MemoryMapEnd; - EFI_MEMORY_DESCRIPTOR TempMemoryMap; - - EFI_MEMORY_DESCRIPTOR *RuntimeMapEntryBegin; - EFI_MEMORY_DESCRIPTOR *RuntimeMapEntryEnd; - - MemoryMapEntry = MemoryMap; - RuntimeMapEntryBegin = NULL; - RuntimeMapEntryEnd = NULL; - MemoryMapEnd = (EFI_MEMORY_DESCRIPTOR *) ((UINT8 *) MemoryMap + MemoryMapSize); - while ((UINTN)MemoryMapEntry < (UINTN)MemoryMapEnd) { - if ((MemoryMapEntry->Type == EfiRuntimeServicesCode) || - (MemoryMapEntry->Type == EfiRuntimeServicesData)) { - if (RuntimeMapEntryBegin == NULL) { - RuntimeMapEntryBegin = MemoryMapEntry; - } - RuntimeMapEntryEnd = MemoryMapEntry; - } - MemoryMapEntry = NEXT_MEMORY_DESCRIPTOR (MemoryMapEntry, DescriptorSize); - } - - MemoryMapEntry = RuntimeMapEntryBegin; - MemoryMapEnd = RuntimeMapEntryEnd; - while (MemoryMapEntry < MemoryMapEnd) { - CopyMem (&TempMemoryMap, MemoryMapEntry, sizeof(EFI_MEMORY_DESCRIPTOR)); - CopyMem (MemoryMapEntry, MemoryMapEnd, sizeof(EFI_MEMORY_DESCRIPTOR)); - CopyMem (MemoryMapEnd, &TempMemoryMap, sizeof(EFI_MEMORY_DESCRIPTOR)); - - MemoryMapEntry = NEXT_MEMORY_DESCRIPTOR (MemoryMapEntry, DescriptorSize); - MemoryMapEnd = PREVIOUS_MEMORY_DESCRIPTOR (MemoryMapEnd, DescriptorSize); - } - - return ; -} - /** Return the first image record, whose [ImageBase, ImageSize] covered by [Buffer, Length]. -- 2.39.2