[U-Boot] [PATCH 08/17] SPARC: added function that checks if IRQ is on or off.
Daniel Hellstrom
daniel at gaisler.com
Thu Jan 28 13:16:27 CET 2010
Signed-off-by: Daniel Hellstrom <daniel at gaisler.com>
---
include/asm-sparc/irq.h | 3 +++
lib_sparc/interrupts.c | 7 +++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h
index c5538c0..ce78169 100644
--- a/include/asm-sparc/irq.h
+++ b/include/asm-sparc/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/lib_sparc/interrupts.c b/lib_sparc/interrupts.c
index 4c73b82..4d53e8c 100644
--- a/lib_sparc/interrupts.c
+++ b/lib_sparc/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