[SeaBIOS] [PATCH] pci: log irq mapping

Gerd Hoffmann kraxel at redhat.com
Wed Dec 4 11:09:26 CET 2013


Found this useful at times, so lets share it for others to enjoy.
Applied log level 3 so this isn't printed by default.

Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
---
 src/fw/pciinit.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c
index a24b8ff..6791b45 100644
--- a/src/fw/pciinit.c
+++ b/src/fw/pciinit.c
@@ -109,13 +109,20 @@ static int (*pci_slot_get_irq)(struct pci_device *pci, int pin) =
 static int piix_pci_slot_get_irq(struct pci_device *pci, int pin)
 {
     int slot_addend = 0;
+    int line;
 
     while (pci->parent != NULL) {
         slot_addend += pci_bdf_to_dev(pci->bdf);
         pci = pci->parent;
     }
     slot_addend += pci_bdf_to_dev(pci->bdf) - 1;
-    return pci_irqs[(pin - 1 + slot_addend) & 3];
+    line = pci_irqs[(pin - 1 + slot_addend) & 3];
+    dprintf(3, "PCI IRQ [piix]: bdf=%02x:%02x.%x pin=%d line=%d\n"
+            , pci_bdf_to_bus(pci->bdf)
+            , pci_bdf_to_dev(pci->bdf)
+            , pci_bdf_to_fn(pci->bdf)
+            , pin, line);
+    return line;
 }
 
 static int mch_pci_slot_get_irq(struct pci_device *pci, int pin)
@@ -140,6 +147,11 @@ static int mch_pci_slot_get_irq(struct pci_device *pci, int pin)
         break;
     }
 
+    dprintf(3, "PCI IRQ [q35]: bdf=%02x:%02x.%x pin=%d line=%d\n"
+            , pci_bdf_to_bus(pci->bdf)
+            , pci_bdf_to_dev(pci->bdf)
+            , pci_bdf_to_fn(pci->bdf)
+            , pin, irq);
     return irq;
 }
 
-- 
1.8.3.1




More information about the SeaBIOS mailing list