To avoid abusing isa_get_irq(NULL) using a hidden ISA bridge
under the hood, let the IDE function expose 2 output IRQs,
and connect them to the ISA function inputs when creating
the south bridge chipset model in vt82c686b_southbridge_init.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/ide/via.c | 19 +++++++++++++++++--
hw/mips/fuloong2e.c | 9 ++++++++-
2 files changed, 25 insertions(+), 3 deletions(-)
@@ -112,7 +124,7 @@ static void via_ide_set_irq(void *opaque, int n, int level)
d->config[0x70 + n * 8] &= ~0x80;
}
- qemu_set_irq(isa_get_irq(NULL, 14 + n), level);
+ qemu_set_irq(s->irq[n], level);
}
static void via_ide_reset(DeviceState *dev)
diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index 931385c760f..f1c5db13b78 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -203,12 +203,19 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus,
int slot, qemu_irq intc,
I2CBus **i2c_bus)
{
PCIDevice *dev;
+ DeviceState *isa;
dev = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(slot, 0), true,
TYPE_VT82C686B_ISA);
- qdev_connect_gpio_out_named(DEVICE(dev), "intr", 0, intc);
+ isa = DEVICE(dev);
+ qdev_connect_gpio_out_named(isa, "intr", 0, intc);
dev = pci_create_simple(pci_bus, PCI_DEVFN(slot, 1), "via-ide");
+ for (unsigned i = 0; i < 2; i++) {
+ qdev_connect_gpio_out_named(DEVICE(dev), "ide-irq", i,