qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/2] hw: irq: Add API to get irq number from qemu_ir


From: Pranavkumar Sawargaonkar
Subject: [Qemu-devel] [PATCH 1/2] hw: irq: Add API to get irq number from qemu_irq
Date: Fri, 17 Apr 2015 14:25:10 +0530

This patch adds a new function to get irq number from qemu irq.

Signed-off-by: Pranavkumar Sawargaonkar <address@hidden>
Signed-off-by: Tushar Jagad <address@hidden>
---
 hw/core/irq.c    | 9 +++++++++
 include/hw/irq.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/hw/core/irq.c b/hw/core/irq.c
index 8a62a36..0eeffdf 100644
--- a/hw/core/irq.c
+++ b/hw/core/irq.c
@@ -35,6 +35,15 @@ struct IRQState {
     int n;
 };
 
+int qemu_get_irq_num(qemu_irq irq)
+{
+    if (!irq) {
+        return -1;
+    }
+
+    return irq->n;
+}
+
 void qemu_set_irq(qemu_irq irq, int level)
 {
     if (!irq)
diff --git a/include/hw/irq.h b/include/hw/irq.h
index 4c4c2ea..dd5220c 100644
--- a/include/hw/irq.h
+++ b/include/hw/irq.h
@@ -9,6 +9,7 @@ typedef struct IRQState *qemu_irq;
 
 typedef void (*qemu_irq_handler)(void *opaque, int n, int level);
 
+int qemu_get_irq_num(qemu_irq irq);
 void qemu_set_irq(qemu_irq irq, int level);
 
 static inline void qemu_irq_raise(qemu_irq irq)
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]