From f1afa0a92d12ed307cb4f7189bcc7ec6abf8e90a Mon Sep 17 00:00:00 2001 From: Jiewen Yao Date: Wed, 30 Nov 2016 23:20:46 +0800 Subject: [PATCH] MdeModulePkg/PiSmmCore: use EfiPagesToSize to prevent build error. EFI_PAGES_TO_SIZE only handles UINTN, so we use EfiPagesToSize to handle UINT64. Cc: Jeff Fan Cc: Michael D Kinney Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao Reviewed-by: Jeff Fan Regression-tested-by: Laszlo Ersek --- MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c index 10820ca2db..f8edb78157 100644 --- a/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c +++ b/MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c @@ -138,7 +138,7 @@ SmmMemoryAttributesTableConsistencyCheck ( if (Address != 0) { ASSERT (Address == MemoryMap->PhysicalStart); } - Address = MemoryMap->PhysicalStart + EFI_PAGES_TO_SIZE(MemoryMap->NumberOfPages); + Address = MemoryMap->PhysicalStart + EfiPagesToSize(MemoryMap->NumberOfPages); MemoryMap = NEXT_MEMORY_DESCRIPTOR(MemoryMap, DescriptorSize); } } @@ -1077,7 +1077,7 @@ SmmInsertImageRecord ( // Step 1: record whole region // ImageRecord->ImageBase = DriverEntry->ImageBuffer; - ImageRecord->ImageSize = EFI_PAGES_TO_SIZE(DriverEntry->NumberOfPage); + ImageRecord->ImageSize = EfiPagesToSize(DriverEntry->NumberOfPage); ImageAddress = (VOID *)(UINTN)DriverEntry->ImageBuffer; @@ -1281,7 +1281,7 @@ SmmRemoveImageRecord ( DEBUG ((DEBUG_VERBOSE, "SMM RemoveImageRecord - 0x%x\n", DriverEntry)); DEBUG ((DEBUG_VERBOSE, "SMM RemoveImageRecord - 0x%016lx - 0x%016lx\n", DriverEntry->ImageBuffer, DriverEntry->NumberOfPage)); - ImageRecord = FindImageRecord (DriverEntry->ImageBuffer, EFI_PAGES_TO_SIZE(DriverEntry->NumberOfPage)); + ImageRecord = FindImageRecord (DriverEntry->ImageBuffer, EfiPagesToSize(DriverEntry->NumberOfPage)); if (ImageRecord == NULL) { DEBUG ((DEBUG_ERROR, "SMM !!!!!!!! ImageRecord not found !!!!!!!!\n")); return ;