From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1766E81F24 for ; Thu, 1 Dec 2016 00:23:46 -0800 (PST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP; 01 Dec 2016 00:23:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,723,1477983600"; d="scan'208";a="37560826" Received: from jyao1-mobl.ccr.corp.intel.com ([10.239.192.126]) by orsmga005.jf.intel.com with ESMTP; 01 Dec 2016 00:23:44 -0800 From: Jiewen Yao To: edk2-devel@lists.01.org Cc: Jeff Fan , Michael D Kinney , Laszlo Ersek Date: Thu, 1 Dec 2016 16:23:27 +0800 Message-Id: <1480580607-19928-4-git-send-email-jiewen.yao@intel.com> X-Mailer: git-send-email 2.7.4.windows.1 In-Reply-To: <1480580607-19928-1-git-send-email-jiewen.yao@intel.com> References: <1480580607-19928-1-git-send-email-jiewen.yao@intel.com> Subject: [PATCH] MdeModulePkg/PiSmmCore: use EfiPagesToSize to prevent build error. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 08:23:46 -0000 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 --- 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