]> git.sur5r.net Git - u-boot/commitdiff
sparc: Added function that checks if IRQ is on or off
authorDaniel Hellstrom <daniel@gaisler.com>
Fri, 22 Jan 2010 10:57:49 +0000 (11:57 +0100)
committerFrancois Retief <fgretief@spaceteq.co.za>
Thu, 3 Dec 2015 11:15:48 +0000 (13:15 +0200)
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
arch/sparc/include/asm/irq.h
arch/sparc/lib/interrupts.c

index 2faf7a074e14000cf7c49990fedae34ff1285e8c..5d0f7564e9b8e8656b7b9c2ebb07ee89e28a1a9d 100644 (file)
@@ -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
index b7c39936196f6b0650bf49113cf94cb25f0466e9..b8f2efb303bd148ae1b75b0600f93253ccde9fa3 100644 (file)
@@ -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;