[U-Boot] [PATCH 08/17] SPARC: added function that checks if IRQ is on or off.
Daniel Hellstrom
daniel at gaisler.com
Tue May 18 16:48:54 CEST 2010
Signed-off-by: Daniel Hellstrom <daniel at gaisler.com>
---
arch/sparc/include/asm/irq.h | 3 +++
arch/sparc/lib/interrupts.c | 7 +++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/arch/sparc/include/asm/irq.h b/arch/sparc/include/asm/irq.h
index c5538c0..ce78169 100644
--- a/arch/sparc/include/asm/irq.h
+++ b/arch/sparc/include/asm/irq.h
@@ -46,4 +46,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 4c73b82..4d53e8c 100644
--- a/arch/sparc/lib/interrupts.c
+++ b/arch/sparc/lib/interrupts.c
@@ -63,6 +63,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;
--
1.5.4
More information about the U-Boot
mailing list