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 0242B817E4 for ; Tue, 10 Jan 2017 18:05:18 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP; 10 Jan 2017 18:05:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,345,1477983600"; d="scan'208";a="211941142" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 10 Jan 2017 18:05:18 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 10 Jan 2017 18:05:18 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 10 Jan 2017 18:05:18 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.59]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.177]) with mapi id 14.03.0248.002; Wed, 11 Jan 2017 10:05:16 +0800 From: "Ni, Ruiyu" To: "Wu, Hao A" , "edk2-devel@lists.01.org" CC: "Wu, Hao A" , Ard Biesheuvel Thread-Topic: [edk2] [PATCH] MdeModulePkg/NonDiscoverable: Compare SIZE_4GB with address type Thread-Index: AQHSa66hDMPEWC54Q0aUGRiBWHLd8aEyhn1w Date: Wed, 11 Jan 2017 02:05:15 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5B87AE3E@SHSMSX104.ccr.corp.intel.com> References: <1484100071-33228-1-git-send-email-hao.a.wu@intel.com> In-Reply-To: <1484100071-33228-1-git-send-email-hao.a.wu@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg/NonDiscoverable: Compare SIZE_4GB with address type 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, 11 Jan 2017 02:05:19 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable One minor comments: put one space after (EFI_PHYSICAL_ADDRESS) and (UINTN) = as below. > + (EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress + *NumberOfBytes = > SIZE_4GB Reviewed-by: Ruiyu Ni > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Hao Wu > Sent: Wednesday, January 11, 2017 10:01 AM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A ; Ni, Ruiyu ; Ard > Biesheuvel > Subject: [edk2] [PATCH] MdeModulePkg/NonDiscoverable: Compare > SIZE_4GB with address type >=20 > Refine the codes to compare the definition 'SIZE_4GB' with type > EFI_PHYSICAL_ADDRESS. >=20 > Cc: Ard Biesheuvel > Cc: Ruiyu Ni > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Hao Wu > --- > .../Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c | > 4 ++-- > .../NonDiscoverableDeviceRegistrationLib.c | = 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git > a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable > PciDeviceIo.c > b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable > PciDeviceIo.c > index b07c129..c836ad6 100644 > --- > a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable > PciDeviceIo.c > +++ > b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable > Pc > +++ iDeviceIo.c > @@ -598,7 +598,7 @@ CoherentPciIoMap ( > // > Dev =3D NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO(This); > if ((Dev->Attributes & EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE) =3D=3D > 0 && > - (UINTN)HostAddress + *NumberOfBytes > SIZE_4GB) { > + (EFI_PHYSICAL_ADDRESS)(UINTN)HostAddress + *NumberOfBytes > > + SIZE_4GB) { >=20 > // > // Bounce buffering is not possible for consistent mappings @@ -1006= ,7 > +1006,7 @@ NonCoherentPciIoMap ( > // a bounce buffer and copy over the data in case HostAddress >=3D 4 G= B. > // > Bounce =3D ((Dev->Attributes & > EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE) =3D=3D 0 && > - (UINTN)HostAddress + *NumberOfBytes > SIZE_4GB); > + (EFI_PHYSICAL_ADDRESS)(UINTN)HostAddress + *NumberOfBytes > > + SIZE_4GB); >=20 > if (!Bounce) { > switch (Operation) { > diff --git > a/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDisco > verableDeviceRegistrationLib.c > b/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDisco > verableDeviceRegistrationLib.c > index 6f46dfa..4180b0a 100644 > --- > a/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDisco > verableDeviceRegistrationLib.c > +++ > b/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDisco > +++ verableDeviceRegistrationLib.c > @@ -163,7 +163,7 @@ RegisterNonDiscoverableMmioDevice ( > Desc->AddrLen =3D Size; > Desc->AddrRangeMax =3D Base + Size - 1; > Desc->ResType =3D ACPI_ADDRESS_SPACE_TYPE_MEM; > - Desc->AddrSpaceGranularity =3D (Base + Size > SIZE_4GB) ? 64 : 32; > + Desc->AddrSpaceGranularity =3D ((EFI_PHYSICAL_ADDRESS) Base + Size = > > + SIZE_4GB) ? 64 : 32; > Desc->AddrTranslationOffset =3D 0; > } > VA_END (Args); > -- > 1.9.5.msysgit.0 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel