]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c
Sync EDKII BaseTools to BaseTools project r2065.
[mirror_edk2.git] / PcAtChipsetPkg / IsaAcpiDxe / PcatIsaAcpi.c
index e8789e5d11a4609c99ec111c9b6f062113ec99bd..8e6d8b7f828f03ed8553b9d1bfe531d4602a5dfe 100644 (file)
@@ -73,6 +73,10 @@ PcatIsaAcpiDriverBindingSupported (
   EFI_STATUS           Status;\r
   EFI_PCI_IO_PROTOCOL  *PciIo;\r
   PCI_TYPE00           Pci;\r
+  UINTN                SegmentNumber;\r
+  UINTN                BusNumber;\r
+  UINTN                DeviceNumber;\r
+  UINTN                FunctionNumber;\r
 \r
   //\r
   // Get PciIo protocol instance\r
@@ -110,10 +114,25 @@ PcatIsaAcpiDriverBindingSupported (
         //\r
         // See if this is an Intel PCI to ISA bridge in Positive Decode Mode\r
         //\r
-        if (Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA_PDECODE &&\r
-            Pci.Hdr.VendorId == 0x8086 && \r
-            (Pci.Hdr.DeviceId & 0xF000) == 0x7000) {\r
-          Status = EFI_SUCCESS;\r
+        if (Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA_PDECODE && \r
+            Pci.Hdr.VendorId     == 0x8086                          ) {\r
+          //\r
+          // See if this is on Function #0 to avoid false positives on \r
+          // PCI_CLASS_BRIDGE_OTHER that has the same value as \r
+          // PCI_CLASS_BRIDGE_ISA_PDECODE\r
+          //\r
+          Status = PciIo->GetLocation (\r
+                            PciIo, \r
+                            &SegmentNumber, \r
+                            &BusNumber, \r
+                            &DeviceNumber, \r
+                            &FunctionNumber\r
+                            );\r
+          if (!EFI_ERROR (Status) && FunctionNumber == 0) {\r
+            Status = EFI_SUCCESS;\r
+          } else {\r
+            Status = EFI_UNSUPPORTED;\r
+          }\r
         }\r
       } \r
     }\r
@@ -223,7 +242,7 @@ PcatIsaAcpiDriverBindingStart (
 \r
 Done:\r
   if (EFI_ERROR (Status)) {\r
-    if (PciIo) {\r
+    if (PciIo != NULL) {\r
       PciIo->Attributes (\r
                PciIo, \r
                EfiPciIoAttributeOperationDisable, \r