sparc64: use direct interrupt mapping for PCI devices
authorArtyom Tarasenko <atar4qemu@gmail.com>
Sat, 27 Apr 2013 05:55:13 +0000 (07:55 +0200)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 27 Apr 2013 11:13:08 +0000 (11:13 +0000)
Every PCI Slot in PBM has 4 directly mapped IRQ lines.
Use the IRQ routing schema 0bssnn (Bus, Slot, interrupt Number)
described in Section 19.3.3 of UltraSPARCâ„¢-IIi User's Manual.

Please note that this patch requires the OpenBIOS counterpart patch.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/pci-host/apb.c

index ccd38d0a5382787e0cc6b5aa7d7ace3c8d8a6036..e0996556e581fb2f0a5ea63928b1727937925b7c 100644 (file)
@@ -365,7 +365,7 @@ static int pci_pbm_map_irq(PCIDevice *pci_dev, int irq_num)
         bus_offset = 16;
     else
         bus_offset = 0;
-    return bus_offset + irq_num;
+    return (bus_offset + (PCI_SLOT(pci_dev->devfn) << 2) + irq_num) & 0x1f;
 }
 
 static void pci_apb_set_irq(void *opaque, int irq_num, int level)