EFI_PAGES_TO_SIZE only handles UINTN, so we use EfiPagesToSize
to handle UINT64.

Cc: Jeff Fan <jeff....@intel.com>
Cc: Michael D Kinney <michael.d.kin...@intel.com>
Cc: Laszlo Ersek <ler...@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen....@intel.com>
---
 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 a6ab830..f7e5029 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 ;
-- 
2.7.4.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to