]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/IncompatiblePciDevice: Do not use deprecated macros
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 25 Jan 2017 08:06:49 +0000 (16:06 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Fri, 10 Feb 2017 08:52:00 +0000 (16:52 +0800)
The patch replaces the following macros:
DEVICE_ID_NOCARE (0xFF) --> MAX_UINT64
PCI_ACPI_UNUSED (0) --> 0
PCI_BAR_ALL (0xFF) --> MAX_UINT64
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 <ruiyu.ni@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c

index 3d581b69fd16cbab25feb64e11aacfc537b497a0..bf0d47a22496bd61c33305ca8b3d663ee5dd8c9f 100644 (file)
@@ -1,11 +1,11 @@
 /** @file\r
   This module is one template module for Incompatible PCI Device Support protocol.\r
 /** @file\r
   This module is one template module for Incompatible PCI Device Support protocol.\r
-  It includes one incompatile pci devices list template.\r
+  It includes one incompatible pci devices list template.\r
   \r
   Incompatible PCI Device Support protocol allows the PCI bus driver to support\r
   resource allocation for some PCI devices that do not comply with the PCI Specification.\r
 \r
   \r
   Incompatible PCI Device Support protocol allows the PCI bus driver to support\r
   resource allocation for some PCI devices that do not comply with the PCI Specification.\r
 \r
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -48,13 +48,11 @@ typedef struct {
 #define PCI_DEVICE_ID(VendorId, DeviceId, Revision, SubVendorId, SubDeviceId) \\r
     VendorId, DeviceId, Revision, SubVendorId, SubDeviceId\r
 \r
 #define PCI_DEVICE_ID(VendorId, DeviceId, Revision, SubVendorId, SubDeviceId) \\r
     VendorId, DeviceId, Revision, SubVendorId, SubDeviceId\r
 \r
-#define PCI_BAR_TYPE_IO   ACPI_ADDRESS_SPACE_TYPE_IO\r
-#define PCI_BAR_TYPE_MEM  ACPI_ADDRESS_SPACE_TYPE_MEM\r
-\r
 #define DEVICE_INF_TAG    0xFFF2\r
 #define DEVICE_RES_TAG    0xFFF1\r
 #define LIST_END_TAG      0x0000\r
 \r
 #define DEVICE_INF_TAG    0xFFF2\r
 #define DEVICE_RES_TAG    0xFFF1\r
 #define LIST_END_TAG      0x0000\r
 \r
+#define EVEN_ALIGN        0xFFFFFFFFFFFFFFFEULL\r
 \r
 /**\r
   Returns a list of ACPI resource descriptors that detail the special\r
 \r
 /**\r
   Returns a list of ACPI resource descriptors that detail the special\r
@@ -114,72 +112,72 @@ GLOBAL_REMOVE_IF_UNREFERENCED UINT64 mIncompatiblePciDeviceList[] = {
   // Device Adaptec 9004\r
   //\r
   DEVICE_INF_TAG,\r
   // Device Adaptec 9004\r
   //\r
   DEVICE_INF_TAG,\r
-  PCI_DEVICE_ID(0x9004, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE),\r
+  PCI_DEVICE_ID(0x9004, MAX_UINT64, MAX_UINT64, MAX_UINT64, MAX_UINT64),\r
   DEVICE_RES_TAG,\r
   DEVICE_RES_TAG,\r
-  PCI_BAR_TYPE_IO,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_BAR_EVEN_ALIGN,\r
-  PCI_BAR_ALL,\r
-  PCI_BAR_NOCHANGE,\r
+  ACPI_ADDRESS_SPACE_TYPE_IO,\r
+  0,\r
+  0,\r
+  0,\r
+  0,\r
+  EVEN_ALIGN,\r
+  MAX_UINT64,\r
+  0,\r
   //\r
   // Device Adaptec 9005\r
   //\r
   DEVICE_INF_TAG,\r
   //\r
   // Device Adaptec 9005\r
   //\r
   DEVICE_INF_TAG,\r
-  PCI_DEVICE_ID(0x9005, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE),\r
+  PCI_DEVICE_ID(0x9005, MAX_UINT64, MAX_UINT64, MAX_UINT64, MAX_UINT64),\r
   DEVICE_RES_TAG,\r
   DEVICE_RES_TAG,\r
-  PCI_BAR_TYPE_IO,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_BAR_EVEN_ALIGN,\r
-  PCI_BAR_ALL,\r
-  PCI_BAR_NOCHANGE,\r
+  ACPI_ADDRESS_SPACE_TYPE_IO,\r
+  0,\r
+  0,\r
+  0,\r
+  0,\r
+  EVEN_ALIGN,\r
+  MAX_UINT64,\r
+  0,\r
   //\r
   // Device QLogic  1007\r
   //\r
   DEVICE_INF_TAG,\r
   //\r
   // Device QLogic  1007\r
   //\r
   DEVICE_INF_TAG,\r
-  PCI_DEVICE_ID(0x1077, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE),\r
+  PCI_DEVICE_ID(0x1077, MAX_UINT64, MAX_UINT64, MAX_UINT64, MAX_UINT64),\r
   DEVICE_RES_TAG,\r
   DEVICE_RES_TAG,\r
-  PCI_BAR_TYPE_IO,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_BAR_EVEN_ALIGN,\r
-  PCI_BAR_ALL,\r
-  PCI_BAR_NOCHANGE,\r
+  ACPI_ADDRESS_SPACE_TYPE_IO,\r
+  0,\r
+  0,\r
+  0,\r
+  0,\r
+  EVEN_ALIGN,\r
+  MAX_UINT64,\r
+  0,\r
   //\r
   // Device Agilent 103C\r
   //\r
   DEVICE_INF_TAG,\r
   //\r
   // Device Agilent 103C\r
   //\r
   DEVICE_INF_TAG,\r
-  PCI_DEVICE_ID(0x103C, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE),\r
+  PCI_DEVICE_ID(0x103C, MAX_UINT64, MAX_UINT64, MAX_UINT64, MAX_UINT64),\r
   DEVICE_RES_TAG,\r
   DEVICE_RES_TAG,\r
-  PCI_BAR_TYPE_IO,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_BAR_EVEN_ALIGN,\r
-  PCI_BAR_ALL,\r
-  PCI_BAR_NOCHANGE,\r
+  ACPI_ADDRESS_SPACE_TYPE_IO,\r
+  0,\r
+  0,\r
+  0,\r
+  0,\r
+  EVEN_ALIGN,\r
+  MAX_UINT64,\r
+  0,\r
   //\r
   // Device Agilent 15BC\r
   //\r
   DEVICE_INF_TAG,\r
   //\r
   // Device Agilent 15BC\r
   //\r
   DEVICE_INF_TAG,\r
-  PCI_DEVICE_ID(0x15BC, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE, DEVICE_ID_NOCARE),\r
+  PCI_DEVICE_ID(0x15BC, MAX_UINT64, MAX_UINT64, MAX_UINT64, MAX_UINT64),\r
   DEVICE_RES_TAG,\r
   DEVICE_RES_TAG,\r
-  PCI_BAR_TYPE_IO,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_ACPI_UNUSED,\r
-  PCI_BAR_EVEN_ALIGN,\r
-  PCI_BAR_ALL,\r
-  PCI_BAR_NOCHANGE,\r
+  ACPI_ADDRESS_SPACE_TYPE_IO,\r
+  0,\r
+  0,\r
+  0,\r
+  0,\r
+  EVEN_ALIGN,\r
+  MAX_UINT64,\r
+  0,\r
   //\r
   // The end of the list\r
   //\r
   //\r
   // The end of the list\r
   //\r
@@ -285,31 +283,31 @@ PCheckDevice (
       //\r
       // See if the Header matches the parameters passed in\r
       //\r
       //\r
       // See if the Header matches the parameters passed in\r
       //\r
-      if (Header->VendorId != DEVICE_ID_NOCARE) {\r
+      if (Header->VendorId != MAX_UINT64) {\r
         if (Header->VendorId != VendorId) {\r
           continue;\r
         }\r
       }\r
 \r
         if (Header->VendorId != VendorId) {\r
           continue;\r
         }\r
       }\r
 \r
-      if (Header->DeviceId != DEVICE_ID_NOCARE) {\r
+      if (Header->DeviceId != MAX_UINT64) {\r
         if (DeviceId != Header->DeviceId) {\r
           continue;\r
         }\r
       }\r
 \r
         if (DeviceId != Header->DeviceId) {\r
           continue;\r
         }\r
       }\r
 \r
-      if (Header->RevisionId != DEVICE_ID_NOCARE) {\r
+      if (Header->RevisionId != MAX_UINT64) {\r
         if (RevisionId != Header->RevisionId) {\r
           continue;\r
         }\r
       }\r
 \r
         if (RevisionId != Header->RevisionId) {\r
           continue;\r
         }\r
       }\r
 \r
-      if (Header->SubsystemVendorId != DEVICE_ID_NOCARE) {\r
+      if (Header->SubsystemVendorId != MAX_UINT64) {\r
         if (SubsystemVendorId != Header->SubsystemVendorId) {\r
           continue;\r
         }\r
       }\r
 \r
         if (SubsystemVendorId != Header->SubsystemVendorId) {\r
           continue;\r
         }\r
       }\r
 \r
-      if (Header->SubsystemDeviceId != DEVICE_ID_NOCARE) {\r
+      if (Header->SubsystemDeviceId != MAX_UINT64) {\r
         if (SubsystemDeviceId != Header->SubsystemDeviceId) {\r
           continue;\r
         }\r
         if (SubsystemDeviceId != Header->SubsystemDeviceId) {\r
           continue;\r
         }\r