diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-09-24 00:16:34 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-09-24 00:16:34 +0000 |
commit | d2b5931756fdb9f839180e33898cd1e3e4fbdc90 (patch) | |
tree | e8e31fd9d7497dce68c6be46136a8bbfc37528d3 /hw/unin_pci.c | |
parent | e69954b9fc698996c8416a2fb26c6b50ad9f49a9 (diff) |
PCI shared IRQ fix (original patch by andrzej zaborowski).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2165 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/unin_pci.c')
-rw-r--r-- | hw/unin_pci.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/hw/unin_pci.c b/hw/unin_pci.c index a7e3600047..d132d6ec2e 100644 --- a/hw/unin_pci.c +++ b/hw/unin_pci.c @@ -140,9 +140,15 @@ static CPUReadMemoryFunc *pci_unin_read[] = { }; #endif -static void pci_unin_set_irq(PCIDevice *d, void *pic, int irq_num, int level) +/* Don't know if this matches real hardware, but it agrees with OHW. */ +static int pci_unin_map_irq(PCIDevice *pci_dev, int irq_num) { - openpic_set_irq(pic, d->config[PCI_INTERRUPT_LINE], level); + return (irq_num + (pci_dev->devfn >> 3)) & 3; +} + +static void pci_unin_set_irq(void *pic, int irq_num, int level) +{ + openpic_set_irq(pic, irq_num + 8, level); } PCIBus *pci_pmac_init(void *pic) @@ -154,7 +160,8 @@ PCIBus *pci_pmac_init(void *pic) /* Use values found on a real PowerMac */ /* Uninorth main bus */ s = qemu_mallocz(sizeof(UNINState)); - s->bus = pci_register_bus(pci_unin_set_irq, NULL, 11 << 3); + s->bus = pci_register_bus(pci_unin_set_irq, pci_unin_map_irq, + pic, 11 << 3); pci_mem_config = cpu_register_io_memory(0, pci_unin_main_config_read, pci_unin_main_config_write, s); |