]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: PlatformBdsLib: refine PCI host bridge assertion
authorLaszlo Ersek <lersek@redhat.com>
Tue, 14 Jul 2015 12:01:48 +0000 (12:01 +0000)
committerlersek <lersek@Edk2>
Tue, 14 Jul 2015 12:01:48 +0000 (12:01 +0000)
The ASSERT() in SetPciIntLine() assumes that Device 0 on "the" root bus
corresponds to the PCI host bridge (00:00). This used to be true, but
because we're going to have extra root buses (with nonzero bus numbers),
soon this assumption may no longer hold. Check for the zero root bus
number explicitly.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Gabriel Somlo <somlo@cmu.edu>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Gabriel Somlo <somlo@cmu.edu>
Regression-tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17953 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c

index fdae6b1cdcec9b36dcb5630dae734798cd2c1b7e..243db44de79e08f0fb9c624959a26680a5afb42b 100644 (file)
@@ -754,6 +754,7 @@ SetPciIntLine (
   UINTN                     Idx;\r
   UINT8                     IrqLine;\r
   EFI_STATUS                Status;\r
+  UINT32                    RootBusNumber;\r
 \r
   Status = EFI_SUCCESS;\r
 \r
@@ -763,6 +764,13 @@ SetPciIntLine (
     ASSERT (DevPathNode != NULL);\r
     DevPath = DevPathNode;\r
 \r
+    RootBusNumber = 0;\r
+    if (DevicePathType (DevPathNode) == ACPI_DEVICE_PATH &&\r
+        DevicePathSubType (DevPathNode) == ACPI_DP &&\r
+        ((ACPI_HID_DEVICE_PATH *)DevPathNode)->HID == EISA_PNP_ID(0x0A03)) {\r
+      RootBusNumber = ((ACPI_HID_DEVICE_PATH *)DevPathNode)->UID;\r
+    }\r
+\r
     //\r
     // Compute index into PciHostIrqs[] table by walking\r
     // the device path and adding up all device numbers\r
@@ -794,7 +802,7 @@ SetPciIntLine (
     if (EFI_ERROR (Status)) {\r
       return Status;\r
     }\r
-    if (RootSlot == 0) {\r
+    if (RootBusNumber == 0 && RootSlot == 0) {\r
       DEBUG((\r
         EFI_D_ERROR,\r
         "%a: PCI host bridge (00:00.0) should have no interrupts!\n",\r