@@ -134,6 +134,15 @@ void sysbus_pass_irq(SysBusDevice *dev, SysBusDevice *target)
}
}
+void sysbus_pass_one_irq(SysBusDevice *dev, SysBusDevice *target, int tn)
+{
+ int n;
+
+ assert(dev->num_irq < QDEV_MAX_IRQ);
+ n = dev->num_irq++;
+ dev->irqp[n] = target->irqp[tn];
+}
+
void sysbus_init_mmio(SysBusDevice *dev, target_phys_addr_t size,
ram_addr_t iofunc)
{
@@ -51,6 +51,7 @@ void sysbus_init_mmio_cb(SysBusDevice *dev, target_phys_addr_t size,
void sysbus_pass_mmio(SysBusDevice *dev, SysBusDevice *target, int target_mmio);
void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p);
void sysbus_pass_irq(SysBusDevice *dev, SysBusDevice *target);
+void sysbus_pass_one_irq(SysBusDevice *dev, SysBusDevice *target, int tn);
void sysbus_init_ioports(SysBusDevice *dev, pio_addr_t ioport, pio_addr_t size);
Add a sysbus_pass_one_irq() function to allow one sysbus device to pass a single IRQ through to another. (It is already possible to delegate all your IRQs to another device with sysbus_pass_irq().) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> --- hw/sysbus.c | 9 +++++++++ hw/sysbus.h | 1 + 2 files changed, 10 insertions(+), 0 deletions(-)