aboutsummaryrefslogtreecommitdiff
path: root/hw/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/irq.c')
-rw-r--r--hw/irq.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/irq.c b/hw/irq.c
index 7703f62c6c..4035a8cbff 100644
--- a/hw/irq.c
+++ b/hw/irq.c
@@ -75,3 +75,18 @@ qemu_irq qemu_irq_invert(qemu_irq irq)
qemu_irq_raise(irq);
return qemu_allocate_irqs(qemu_notirq, irq, 1)[0];
}
+
+static void qemu_splitirq(void *opaque, int line, int level)
+{
+ struct IRQState **irq = opaque;
+ irq[0]->handler(irq[0]->opaque, irq[0]->n, level);
+ irq[1]->handler(irq[1]->opaque, irq[1]->n, level);
+}
+
+qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2)
+{
+ qemu_irq *s = qemu_mallocz(2 * sizeof(qemu_irq));
+ s[0] = irq1;
+ s[1] = irq2;
+ return qemu_allocate_irqs(qemu_splitirq, s, 1)[0];
+}