[U-Boot] [PATCH v1 03/21] sparc: Added function that checks if IRQ is on or off

Francois Retief fgretief at spaceteq.co.za
Mon Nov 23 16:38:44 CET 2015


From: Daniel Hellstrom <daniel at gaisler.com>

Signed-off-by: Daniel Hellstrom <daniel at gaisler.com>
Signed-off-by: Francois Retief <fgretief at spaceteq.co.za>
---

 arch/sparc/include/asm/irq.h | 3 +++
 arch/sparc/lib/interrupts.c  | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/arch/sparc/include/asm/irq.h b/arch/sparc/include/asm/irq.h
index 2faf7a0..5d0f756 100644
--- a/arch/sparc/include/asm/irq.h
+++ b/arch/sparc/include/asm/irq.h
@@ -32,4 +32,7 @@ extern int intLock(void);
 /* Sets the PIL to oldLevel */
 extern void intUnlock(int oldLevel);
 
+/* Return non-zero if interrupts are currently enabled */
+extern int interrupt_is_enabled(void);
+
 #endif
diff --git a/arch/sparc/lib/interrupts.c b/arch/sparc/lib/interrupts.c
index b7c3993..b8f2efb 100644
--- a/arch/sparc/lib/interrupts.c
+++ b/arch/sparc/lib/interrupts.c
@@ -47,6 +47,13 @@ int disable_interrupts(void)
 	return intLock();
 }
 
+int interrupt_is_enabled(void)
+{
+	if (get_pil() == 15)
+		return 0;
+	return 1;
+}
+
 int interrupt_init(void)
 {
 	int ret;
-- 
2.4.3



More information about the U-Boot mailing list