From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 8F5F381FA8 for ; Wed, 25 Jan 2017 22:09:34 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP; 25 Jan 2017 22:09:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,287,1477983600"; d="scan'208";a="57682424" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by fmsmga005.fm.intel.com with ESMTP; 25 Jan 2017 22:09:33 -0800 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Jeff Fan , Feng Tian Date: Thu, 26 Jan 2017 14:09:26 +0800 Message-Id: <20170126060927.352436-5-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 In-Reply-To: <20170126060927.352436-1-ruiyu.ni@intel.com> References: <20170126060927.352436-1-ruiyu.ni@intel.com> Subject: [PATCH 4/5] 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: Thu, 26 Jan 2017 06:09:34 -0000 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 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 | 97 +++++++++++----------- 1 file changed, 47 insertions(+), 50 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c index 3d581b6..dfb7a59 100644 --- a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c @@ -1,11 +1,11 @@ /** @file This module is one template module for Incompatible PCI Device Support 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 to 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,9 +48,6 @@ typedef struct { #define PCI_DEVICE_ID(VendorId, DeviceId, Revision, SubVendorId, SubDeviceId) \ 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 @@ -114,72 +111,72 @@ GLOBAL_REMOVE_IF_UNREFERENCED UINT64 mIncompatiblePciDeviceList[] = { // 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, + ACPI_ADDRESS_SPACE_TYPE_IO, + 0, + 0, + 0, + 0, PCI_BAR_EVEN_ALIGN, - PCI_BAR_ALL, - PCI_BAR_NOCHANGE, + (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, + ACPI_ADDRESS_SPACE_TYPE_IO, + 0, + 0, + 0, + 0, PCI_BAR_EVEN_ALIGN, - PCI_BAR_ALL, - PCI_BAR_NOCHANGE, + (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, + ACPI_ADDRESS_SPACE_TYPE_IO, + 0, + 0, + 0, + 0, PCI_BAR_EVEN_ALIGN, - PCI_BAR_ALL, - PCI_BAR_NOCHANGE, + (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, + ACPI_ADDRESS_SPACE_TYPE_IO, + 0, + 0, + 0, + 0, PCI_BAR_EVEN_ALIGN, - PCI_BAR_ALL, - PCI_BAR_NOCHANGE, + (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, + ACPI_ADDRESS_SPACE_TYPE_IO, + 0, + 0, + 0, + 0, PCI_BAR_EVEN_ALIGN, - PCI_BAR_ALL, - PCI_BAR_NOCHANGE, + (UINT64)-1, + 0, // // The end of the list // @@ -285,31 +282,31 @@ PCheckDevice ( // // See if the Header matches the parameters passed in // - if (Header->VendorId != DEVICE_ID_NOCARE) { + if (Header->VendorId != (UINT64)-1) { if (Header->VendorId != VendorId) { continue; } } - if (Header->DeviceId != DEVICE_ID_NOCARE) { + if (Header->DeviceId != (UINT64)-1) { if (DeviceId != Header->DeviceId) { continue; } } - if (Header->RevisionId != DEVICE_ID_NOCARE) { + if (Header->RevisionId != (UINT64)-1) { if (RevisionId != Header->RevisionId) { continue; } } - if (Header->SubsystemVendorId != DEVICE_ID_NOCARE) { + if (Header->SubsystemVendorId != (UINT64)-1) { if (SubsystemVendorId != Header->SubsystemVendorId) { continue; } } - if (Header->SubsystemDeviceId != DEVICE_ID_NOCARE) { + if (Header->SubsystemDeviceId != (UINT64)-1) { if (SubsystemDeviceId != Header->SubsystemDeviceId) { continue; } -- 2.9.0.windows.1