From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 4C53D820F8 for ; Wed, 15 Feb 2017 22:20:10 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP; 15 Feb 2017 22:20:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,168,1484035200"; d="scan'208";a="1095871870" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 15 Feb 2017 22:20:09 -0800 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 15 Feb 2017 22:20:09 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 15 Feb 2017 22:20:09 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0248.002; Thu, 16 Feb 2017 14:20:07 +0800 From: "Wu, Jiaxin" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] MdeModulePkg/PciBusDxe: Fix IA32 build failure Thread-Index: AQHSiBxdi11NwMxXA0Ktx5nh0sUEOKFrKP4A Date: Thu, 16 Feb 2017 06:20:06 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B72741629B45D@SHSMSX103.ccr.corp.intel.com> References: <20170216061727.341364-1-ruiyu.ni@intel.com> In-Reply-To: <20170216061727.341364-1-ruiyu.ni@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTk5ZmNhZjktZjFkMi00YTdlLThiMjQtNzE0ZmJlNGVhZjdhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNS45LjYuNiIsIlRydXN0ZWRMYWJlbEhhc2giOiJ1UkxoOWM5V2o3MG5Gc3JIS2Vibm04ZzloNnRSUWFWdkxYZmNrOGJBYjRFPSJ9 x-ctpclassification: CTP_PUBLIC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Thu, 16 Feb 2017 06:20:10 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Wu Jiaxin > -----Original Message----- > From: Ni, Ruiyu > Sent: Thursday, February 16, 2017 2:17 PM > To: edk2-devel@lists.01.org > Cc: Wu, Jiaxin > Subject: [PATCH] MdeModulePkg/PciBusDxe: Fix IA32 build failure >=20 > Compiler calculates the PciBar[BarIndex] using > sizeof (PciBar[0]) * BarIndex, when BarIndex is type of UINT64, > the above calculation generates assembly code using _allmul. >=20 > Change BarIndex to UINTN to avoid the build failure. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ruiyu Ni > Cc: Jiaxin Wu > --- > .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 20 ++++++++++----= ----- > - > 1 file changed, 10 insertions(+), 10 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c > b/MdeModulePkg/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- > >AddrTranslationOffset =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) { > -- > 2.9.0.windows.1