From: Daniel Hellstrom Date: Fri, 22 Jan 2010 10:57:49 +0000 (+0100) Subject: sparc: Added function that checks if IRQ is on or off X-Git-Tag: v2016.01-rc2~41^2~18 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f33f888d0e6c5c3f8eb880219bbc87b938832607;p=u-boot sparc: Added function that checks if IRQ is on or off Signed-off-by: Daniel Hellstrom --- diff --git a/arch/sparc/include/asm/irq.h b/arch/sparc/include/asm/irq.h index 2faf7a074e..5d0f7564e9 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 b7c3993619..b8f2efb303 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;