From nobody Sat Nov 2 14:22:41 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1487225853733662.6609042760024; Wed, 15 Feb 2017 22:17:33 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id F1BA3820F8; Wed, 15 Feb 2017 22:17:31 -0800 (PST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 7933A820F7 for ; Wed, 15 Feb 2017 22:17:30 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 15 Feb 2017 22:17:30 -0800 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by fmsmga004.fm.intel.com with ESMTP; 15 Feb 2017 22:17:29 -0800 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,168,1484035200"; d="scan'208";a="225933882" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Thu, 16 Feb 2017 14:17:27 +0800 Message-Id: <20170216061727.341364-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 Subject: [edk2] [PATCH] MdeModulePkg/PciBusDxe: Fix IA32 build failure 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: , Cc: Jiaxin Wu MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Compiler calculates the PciBar[BarIndex] using sizeof (PciBar[0]) * BarIndex, when BarIndex is type of UINT64, the above calculation generates assembly code using _allmul. Change BarIndex to UINTN to avoid the build failure. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Jiaxin Wu Reviewed-by: Wu Jiaxin --- .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 20 ++++++++++------= ---- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeMod= ulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index ecda088..d9a83be 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -1340,8 +1340,8 @@ UpdatePciInfo ( ) { EFI_STATUS Status; - UINT64 BarIndex; - UINT64 BarEndIndex; + UINTN BarIndex; + UINTN BarEndIndex; BOOLEAN SetFlag; VOID *Configuration; EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Ptr; @@ -1395,16 +1395,16 @@ UpdatePciInfo ( break; } =20 - BarIndex =3D Ptr->AddrTranslationOffset; - BarEndIndex =3D BarIndex; - - // - // Update all the bars in the device - // Compare against 0xFF is to keep backward compatibility. - // - if ((BarIndex =3D=3D MAX_UINT64) || (BarIndex =3D=3D 0xFF)) { + if ((Ptr->AddrTranslationOffset =3D=3D MAX_UINT64) || (Ptr->AddrTransl= ationOffset =3D=3D MAX_UINT8)) { + // + // Update all the bars in the device + // Compare against MAX_UINT8 is to keep backward compatibility. + // BarIndex =3D 0; BarEndIndex =3D PCI_MAX_BAR - 1; + } else { + BarIndex =3D (UINTN) Ptr->AddrTranslationOffset; + BarEndIndex =3D BarIndex; } =20 if (BarIndex >=3D PCI_MAX_BAR) { --=20 2.9.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel