From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 EA19021C8EFB5 for ; Thu, 25 Oct 2018 21:53:52 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2018 21:53:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,426,1534834800"; d="scan'208";a="85713016" Received: from jwang36-mobl2.ccr.corp.intel.com ([10.239.192.38]) by orsmga006.jf.intel.com with ESMTP; 25 Oct 2018 21:53:50 -0700 From: Jian J Wang To: edk2-devel@lists.01.org Cc: Star Zeng , Liming Gao Date: Fri, 26 Oct 2018 12:53:46 +0800 Message-Id: <20181026045346.10192-1-jian.j.wang@intel.com> X-Mailer: git-send-email 2.19.0.windows.1 MIME-Version: 1.0 Subject: [PATCH] MdeModulePkg/Core: fix an IA32 build failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2018 04:53:53 -0000 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1277 The failure is caused by data type conversion between UINTN and UINT64, which is checked in at 63ebde8ef6d4ff497d054ccc010904ecd4441198. Cc: Star Zeng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang --- MdeModulePkg/Core/Dxe/Mem/HeapGuard.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c index 449a022658..521e0d7b2a 100644 --- a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c +++ b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c @@ -463,7 +463,7 @@ IsGuardPage ( IN EFI_PHYSICAL_ADDRESS Address ) { - UINTN BitMap; + UINT64 BitMap; // // There must be at least one guarded page before and/or after given @@ -1368,7 +1368,7 @@ GuardAllFreedPages ( UINT64 Address; UINT64 GuardPage; INTN Level; - UINTN BitIndex; + UINT64 BitIndex; UINTN GuardPageNumber; if (mGuardedMemoryMap == 0 || @@ -1475,12 +1475,12 @@ MergeGuardPages ( } Bitmap = 0; - Pages = EFI_SIZE_TO_PAGES (MaxAddress - MemoryMapEntry->PhysicalStart); - Pages -= MemoryMapEntry->NumberOfPages; + Pages = EFI_SIZE_TO_PAGES ((UINTN)(MaxAddress - MemoryMapEntry->PhysicalStart)); + Pages -= (INTN)MemoryMapEntry->NumberOfPages; while (Pages > 0) { if (Bitmap == 0) { EndAddress = MemoryMapEntry->PhysicalStart + - EFI_PAGES_TO_SIZE (MemoryMapEntry->NumberOfPages); + EFI_PAGES_TO_SIZE ((UINTN)MemoryMapEntry->NumberOfPages); Bitmap = GetGuardedMemoryBits (EndAddress, GUARDED_HEAP_MAP_ENTRY_BITS); } -- 2.19.0.windows.1