@@ -72,6 +72,13 @@ void isa_bus_irqs(ISABus *bus, qemu_irq *irqs)
bus->irqs = irqs;
}
+qemu_irq isa_bus_get_irq(ISABus *bus, unsigned irqnum)
+{
+ assert(irqnum < ISA_NUM_IRQS);
+ assert(bus && bus->irqs);
+ return bus->irqs[irqnum];
+}
+
/*
* isa_get_irq() returns the corresponding qemu_irq entry for the i8259.
*
@@ -81,14 +88,13 @@ void isa_bus_irqs(ISABus *bus, qemu_irq *irqs)
qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq)
{
assert(!dev || ISA_BUS(qdev_get_parent_bus(DEVICE(dev))) == isabus);
- assert(isairq < ISA_NUM_IRQS);
- return isabus->irqs[isairq];
+ return isa_bus_get_irq(isabus, isairq);
}
void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq)
{
- qemu_irq irq = isa_get_irq(isadev, isairq);
- qdev_connect_gpio_out(DEVICE(isadev), gpioirq, irq);
+ qemu_irq input_irq = isa_get_irq(isadev, isairq);
+ qdev_connect_gpio_out(DEVICE(isadev), gpioirq, input_irq);
}
void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16)
@@ -80,6 +80,14 @@ void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16);
IsaDma *isa_bus_get_dma(ISABus *bus, int nchan);
MemoryRegion *isa_address_space(ISADevice *dev);
MemoryRegion *isa_address_space_io(ISADevice *dev);
+/**
+ * isa_bus_get_irq: Return input IRQ on ISA bus.
+ * @bus: the #ISABus to plug ISA devices on.
+ * @irqnum: the ISA IRQ number.
+ *
+ * Return IRQ @irqnum from the PIC associated on ISA @bus.
+ */
+qemu_irq isa_bus_get_irq(ISABus *bus, unsigned irqnum);
ISADevice *isa_new(const char *name);
ISADevice *isa_try_new(const char *name);
bool isa_realize_and_unref(ISADevice *dev, ISABus *bus, Error **errp);