[v4,5/8] irq: Add irq information getter functions
diff mbox

Message ID 6fce8937eb65cdfa880d87c3389a550360bdd87f.1469258908.git.alistair@alistair23.me
State New
Headers show

Commit Message

Alistair Francis July 23, 2016, 4:42 p.m. UTC
Add two functions one to get the irq handler function and another to get the
opaque data from a qemu_irq.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
---

 hw/core/irq.c    | 10 ++++++++++
 include/hw/irq.h |  4 ++++
 2 files changed, 14 insertions(+)

Patch
diff mbox

diff --git a/hw/core/irq.c b/hw/core/irq.c
index 49ff2e6..026200e 100644
--- a/hw/core/irq.c
+++ b/hw/core/irq.c
@@ -91,6 +91,16 @@  void qemu_free_irq(qemu_irq irq)
     object_unref(OBJECT(irq));
 }
 
+qemu_irq_handler qemu_irq_get_handler(qemu_irq irq)
+{
+    return irq->handler;
+}
+
+void *qemu_irq_get_opaque(qemu_irq irq)
+{
+    return irq->opaque;
+}
+
 static void qemu_notirq(void *opaque, int line, int level)
 {
     struct IRQState *irq = opaque;
diff --git a/include/hw/irq.h b/include/hw/irq.h
index 4c4c2ea..934a8f5 100644
--- a/include/hw/irq.h
+++ b/include/hw/irq.h
@@ -27,6 +27,10 @@  static inline void qemu_irq_pulse(qemu_irq irq)
     qemu_set_irq(irq, 0);
 }
 
+qemu_irq_handler qemu_irq_get_handler(qemu_irq irq);
+
+void *qemu_irq_get_opaque(qemu_irq irq);
+
 /* Returns an array of N IRQs. Each IRQ is assigned the argument handler and
  * opaque data.
  */