From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 B1DE781F5C for ; Mon, 6 Feb 2017 09:55:06 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP; 06 Feb 2017 09:55:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,342,1477983600"; d="scan'208";a="930760538" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by orsmga003.jf.intel.com with ESMTP; 06 Feb 2017 09:55:06 -0800 Received: from orsmsx162.amr.corp.intel.com (10.22.240.85) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 6 Feb 2017 09:55:06 -0800 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.27]) by ORSMSX162.amr.corp.intel.com ([10.22.240.85]) with mapi id 14.03.0248.002; Mon, 6 Feb 2017 09:55:05 -0800 From: "Kinney, Michael D" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" , "Kinney, Michael D" CC: "Tian, Feng" , "Fan, Jeff" Thread-Topic: [edk2] [PATCH v2 3/6] MdeModulePkg/IncompatiblePciDevice: Do not use deprecated macros Thread-Index: AQHSgD5vpAXVNI7qnkGjT9a37+CK8qFcP59QgAADpsA= Date: Mon, 6 Feb 2017 17:55:05 +0000 Message-ID: References: <20170206060059.595976-1-ruiyu.ni@intel.com> <20170206060059.595976-4-ruiyu.ni@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDU4NWIxMWEtNTdmZC00MzExLTlkN2QtMDA1NGY5NzU4YjA2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjJOcFk5SjMzTk9NRkVmSVZQMmc1Yys4Y3FoREVjTEhhU2NYbWVScWw2eWs9In0= x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Subject: Re: [PATCH v2 3/6] MdeModulePkg/IncompatiblePciDevice: Do not use deprecated macros 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: Mon, 06 Feb 2017 17:55:06 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ray, As a follow up, I do see the PI Specification using (UINTN)-1 and (UINT64)-= 1. I think the intent is unsigned values with all bits set, which is what the= =20 MAX_UINTx macros provide in the EDK II without depending on type casting a signed value to an unsigned value. Mike > -----Original Message----- > From: Kinney, Michael D > Sent: Monday, February 6, 2017 9:41 AM > To: Ni, Ruiyu ; edk2-devel@lists.01.org; Kinney, Mich= ael D > > Cc: Tian, Feng ; Fan, Jeff > Subject: RE: [edk2] [PATCH v2 3/6] MdeModulePkg/IncompatiblePciDevice: Do= not use > deprecated macros >=20 > Ray, >=20 > Can we use MAX_UINT64 instead of (UINT64)-1? >=20 > Thanks, >=20 > Mike >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of = Ruiyu Ni > > Sent: Sunday, February 5, 2017 10:01 PM > > To: edk2-devel@lists.01.org > > Cc: Tian, Feng ; Fan, Jeff > > Subject: [edk2] [PATCH v2 3/6] MdeModulePkg/IncompatiblePciDevice: Do n= ot use > > deprecated macros > > > > The patch replaces the following macros: > > DEVICE_ID_NOCARE (0xFF) --> (UINT64)-1 > > PCI_ACPI_UNUSED (0) --> 0 > > PCI_BAR_ALL (0xFF) --> (UINT64)-1 > > PCI_BAR_NOCHANGE (0) --> 0 > > PCI_BAR_EVEN_ALIGN --> EVEN_ALIGN (local definition) > > > > Since the PciBus driver was updated to accept Spec defined values > > in previous commit, the above replacements don't impact > > functionality. > > > > Contributed-under: TianoCore Contribution Agreement 1.0 > > Signed-off-by: Ruiyu Ni > > Cc: Jeff Fan > > Cc: Feng Tian > > --- > > .../IncompatiblePciDeviceSupport.c | 108 ++++++++++---= -------- > > 1 file changed, 53 insertions(+), 55 deletions(-) > > > > diff --git > > > a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDev= iceSupport.c > > > b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDev= iceSupport.c > > index 3d581b6..5a6a052 100644 > > --- > > > a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDev= iceSupport.c > > +++ > > > b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDev= iceSupport.c > > @@ -1,11 +1,11 @@ > > /** @file > > This module is one template module for Incompatible PCI Device Suppo= rt protocol. > > - It includes one incompatile pci devices list template. > > + It includes one incompatible pci devices list template. > > > > Incompatible PCI Device Support protocol allows the PCI bus driver t= o support > > resource allocation for some PCI devices that do not comply with the= PCI > > Specification. > > > > -Copyright (c) 2009, Intel Corporation. All rights reserved.
> > +Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> > This program and the accompanying materials > > are licensed and made available under the terms and conditions of the = BSD License > > which accompanies this distribution. The full text of the license may= be found at > > @@ -48,13 +48,11 @@ typedef struct { > > #define PCI_DEVICE_ID(VendorId, DeviceId, Revision, SubVendorId, SubDe= viceId) \ > > VendorId, DeviceId, Revision, SubVendorId, SubDeviceId > > > > -#define PCI_BAR_TYPE_IO ACPI_ADDRESS_SPACE_TYPE_IO > > -#define PCI_BAR_TYPE_MEM ACPI_ADDRESS_SPACE_TYPE_MEM > > - > > #define DEVICE_INF_TAG 0xFFF2 > > #define DEVICE_RES_TAG 0xFFF1 > > #define LIST_END_TAG 0x0000 > > > > +#define EVEN_ALIGN 0xFFFFFFFFFFFFFFFEULL > > > > /** > > Returns a list of ACPI resource descriptors that detail the special > > @@ -114,72 +112,72 @@ GLOBAL_REMOVE_IF_UNREFERENCED UINT64 > > mIncompatiblePciDeviceList[] =3D { > > // Device Adaptec 9004 > > // > > DEVICE_INF_TAG, > > - PCI_DEVICE_ID(0x9004, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_= NOCARE, > > DEVICE_ID_NOCARE), > > + PCI_DEVICE_ID(0x9004, (UINT64)-1, (UINT64)-1, (UINT64)-1, (UINT64)-1= ), > > DEVICE_RES_TAG, > > - PCI_BAR_TYPE_IO, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_BAR_EVEN_ALIGN, > > - PCI_BAR_ALL, > > - PCI_BAR_NOCHANGE, > > + ACPI_ADDRESS_SPACE_TYPE_IO, > > + 0, > > + 0, > > + 0, > > + 0, > > + EVEN_ALIGN, > > + (UINT64)-1, > > + 0, > > // > > // Device Adaptec 9005 > > // > > DEVICE_INF_TAG, > > - PCI_DEVICE_ID(0x9005, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_= NOCARE, > > DEVICE_ID_NOCARE), > > + PCI_DEVICE_ID(0x9005, (UINT64)-1, (UINT64)-1, (UINT64)-1, (UINT64)-1= ), > > DEVICE_RES_TAG, > > - PCI_BAR_TYPE_IO, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_BAR_EVEN_ALIGN, > > - PCI_BAR_ALL, > > - PCI_BAR_NOCHANGE, > > + ACPI_ADDRESS_SPACE_TYPE_IO, > > + 0, > > + 0, > > + 0, > > + 0, > > + EVEN_ALIGN, > > + (UINT64)-1, > > + 0, > > // > > // Device QLogic 1007 > > // > > DEVICE_INF_TAG, > > - PCI_DEVICE_ID(0x1077, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_= NOCARE, > > DEVICE_ID_NOCARE), > > + PCI_DEVICE_ID(0x1077, (UINT64)-1, (UINT64)-1, (UINT64)-1, (UINT64)-1= ), > > DEVICE_RES_TAG, > > - PCI_BAR_TYPE_IO, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_BAR_EVEN_ALIGN, > > - PCI_BAR_ALL, > > - PCI_BAR_NOCHANGE, > > + ACPI_ADDRESS_SPACE_TYPE_IO, > > + 0, > > + 0, > > + 0, > > + 0, > > + EVEN_ALIGN, > > + (UINT64)-1, > > + 0, > > // > > // Device Agilent 103C > > // > > DEVICE_INF_TAG, > > - PCI_DEVICE_ID(0x103C, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_= NOCARE, > > DEVICE_ID_NOCARE), > > + PCI_DEVICE_ID(0x103C, (UINT64)-1, (UINT64)-1, (UINT64)-1, (UINT64)-1= ), > > DEVICE_RES_TAG, > > - PCI_BAR_TYPE_IO, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_BAR_EVEN_ALIGN, > > - PCI_BAR_ALL, > > - PCI_BAR_NOCHANGE, > > + ACPI_ADDRESS_SPACE_TYPE_IO, > > + 0, > > + 0, > > + 0, > > + 0, > > + EVEN_ALIGN, > > + (UINT64)-1, > > + 0, > > // > > // Device Agilent 15BC > > // > > DEVICE_INF_TAG, > > - PCI_DEVICE_ID(0x15BC, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_= NOCARE, > > DEVICE_ID_NOCARE), > > + PCI_DEVICE_ID(0x15BC, (UINT64)-1, (UINT64)-1, (UINT64)-1, (UINT64)-1= ), > > DEVICE_RES_TAG, > > - PCI_BAR_TYPE_IO, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_ACPI_UNUSED, > > - PCI_BAR_EVEN_ALIGN, > > - PCI_BAR_ALL, > > - PCI_BAR_NOCHANGE, > > + ACPI_ADDRESS_SPACE_TYPE_IO, > > + 0, > > + 0, > > + 0, > > + 0, > > + EVEN_ALIGN, > > + (UINT64)-1, > > + 0, > > // > > // The end of the list > > // > > @@ -285,31 +283,31 @@ PCheckDevice ( > > // > > // See if the Header matches the parameters passed in > > // > > - if (Header->VendorId !=3D DEVICE_ID_NOCARE) { > > + if (Header->VendorId !=3D (UINT64)-1) { > > if (Header->VendorId !=3D VendorId) { > > continue; > > } > > } > > > > - if (Header->DeviceId !=3D DEVICE_ID_NOCARE) { > > + if (Header->DeviceId !=3D (UINT64)-1) { > > if (DeviceId !=3D Header->DeviceId) { > > continue; > > } > > } > > > > - if (Header->RevisionId !=3D DEVICE_ID_NOCARE) { > > + if (Header->RevisionId !=3D (UINT64)-1) { > > if (RevisionId !=3D Header->RevisionId) { > > continue; > > } > > } > > > > - if (Header->SubsystemVendorId !=3D DEVICE_ID_NOCARE) { > > + if (Header->SubsystemVendorId !=3D (UINT64)-1) { > > if (SubsystemVendorId !=3D Header->SubsystemVendorId) { > > continue; > > } > > } > > > > - if (Header->SubsystemDeviceId !=3D DEVICE_ID_NOCARE) { > > + if (Header->SubsystemDeviceId !=3D (UINT64)-1) { > > if (SubsystemDeviceId !=3D Header->SubsystemDeviceId) { > > continue; > > } > > -- > > 2.9.0.windows.1 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel