summaryrefslogtreecommitdiff
path: root/arch/sparc
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2010-01-22 11:57:49 +0100
committerFrancois Retief <fgretief@spaceteq.co.za>2015-12-03 13:15:48 +0200
commitf33f888d0e6c5c3f8eb880219bbc87b938832607 (patch)
tree0bff8d2daee15a5d1219d0269d3570c379500af4 /arch/sparc
parentbe7357a6cc16dec39be2043911ced4ac19d36044 (diff)
downloadu-boot-imx-f33f888d0e6c5c3f8eb880219bbc87b938832607.zip
u-boot-imx-f33f888d0e6c5c3f8eb880219bbc87b938832607.tar.gz
u-boot-imx-f33f888d0e6c5c3f8eb880219bbc87b938832607.tar.bz2
sparc: Added function that checks if IRQ is on or off
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/include/asm/irq.h3
-rw-r--r--arch/sparc/lib/interrupts.c7
2 files changed, 10 insertions, 0 deletions
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;