From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 1BEBE81F29 for ; Tue, 6 Dec 2016 19:02:42 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP; 06 Dec 2016 19:02:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,310,1477983600"; d="scan'208";a="39755126" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga005.fm.intel.com with ESMTP; 06 Dec 2016 19:02:41 -0800 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 6 Dec 2016 19:02:41 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 6 Dec 2016 19:02:41 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.116]) with mapi id 14.03.0248.002; Wed, 7 Dec 2016 11:02:37 +0800 From: "Fan, Jeff" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , Laszlo Ersek Thread-Topic: [PATCH] MdeModulePkg/PiSmmCore: use EfiPagesToSize to prevent build error. Thread-Index: AQHSS6w+K1sCTxhHAUq7QYp09zA4PKD71UkA Date: Wed, 7 Dec 2016 03:02:36 +0000 Message-ID: <542CF652F8836A4AB8DBFAAD40ED192A4A2F59C3@shsmsx102.ccr.corp.intel.com> References: <1480580607-19928-1-git-send-email-jiewen.yao@intel.com> <1480580607-19928-4-git-send-email-jiewen.yao@intel.com> In-Reply-To: <1480580607-19928-4-git-send-email-jiewen.yao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWYzNTYzZmEtYzRiNi00OTMyLWJjNTYtY2JhYmFjMDA3M2M4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlJwVFRuQWRKVTFVYW43WUtuYlY0dEdQbFJOYlJMcU4zRWI2Y1JqNkFSaEk9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: Wed, 07 Dec 2016 03:02:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jeff Fan -----Original Message----- From: Yao, Jiewen=20 Sent: Thursday, December 01, 2016 4:23 PM To: edk2-devel@lists.01.org Cc: Fan, Jeff; Kinney, Michael D; Laszlo Ersek Subject: [PATCH] MdeModulePkg/PiSmmCore: use EfiPagesToSize to prevent buil= d error. EFI_PAGES_TO_SIZE only handles UINTN, so we use EfiPagesToSize to handle UI= NT64. 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/MdeModul= ePkg/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 !=3D 0) { ASSERT (Address =3D=3D MemoryMap->PhysicalStart); } - Address =3D MemoryMap->PhysicalStart + EFI_PAGES_TO_SIZE(MemoryMap->Nu= mberOfPages); + Address =3D MemoryMap->PhysicalStart +=20 + EfiPagesToSize(MemoryMap->NumberOfPages); MemoryMap =3D NEXT_MEMORY_DESCRIPTOR(MemoryMap, DescriptorSize); } } @@ -1077,7 +1077,7 @@ SmmInsertImageRecord ( // Step 1: record whole region // ImageRecord->ImageBase =3D DriverEntry->ImageBuffer; - ImageRecord->ImageSize =3D EFI_PAGES_TO_SIZE(DriverEntry->NumberOfPage); + ImageRecord->ImageSize =3D EfiPagesToSize(DriverEntry->NumberOfPage); =20 ImageAddress =3D (VOID *)(UINTN)DriverEntry->ImageBuffer; =20 @@ -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)); =20 - ImageRecord =3D FindImageRecord (DriverEntry->ImageBuffer, EFI_PAGES_TO_= SIZE(DriverEntry->NumberOfPage)); + ImageRecord =3D FindImageRecord (DriverEntry->ImageBuffer,=20 + EfiPagesToSize(DriverEntry->NumberOfPage)); if (ImageRecord =3D=3D NULL) { DEBUG ((DEBUG_ERROR, "SMM !!!!!!!! ImageRecord not found !!!!!!!!\n"))= ; return ; -- 2.7.4.windows.1