]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/asm-x86/nmi.h
Merge branch 'x86/core' into x86/apic
[karo-tx-linux.git] / include / asm-x86 / nmi.h
index 1348e542360f54aed60d954cfdcb0d42f91d23b8..f8b76f38390407bbe1b159e2c8b71175201fc5e1 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_NMI_H_
-#define _ASM_X86_NMI_H_
+#ifndef ASM_X86__NMI_H
+#define ASM_X86__NMI_H
 
 #include <linux/pm.h>
 #include <asm/irq.h>
@@ -56,6 +56,19 @@ static inline void localise_nmi_watchdog(void)
        if (nmi_watchdog == NMI_IO_APIC)
                nmi_watchdog = NMI_LOCAL_APIC;
 }
+
+/* check if nmi_watchdog is active (ie was specified at boot) */
+static inline int nmi_watchdog_active(void)
+{
+       /*
+        * actually it should be:
+        *      return (nmi_watchdog == NMI_LOCAL_APIC ||
+        *              nmi_watchdog == NMI_IO_APIC)
+        * but since they are power of two we could use a
+        * cheaper way --cvg
+        */
+       return nmi_watchdog & 0x3;
+}
 #endif
 
 void lapic_watchdog_stop(void);
@@ -68,4 +81,4 @@ void enable_lapic_nmi_watchdog(void);
 void stop_nmi(void);
 void restart_nmi(void);
 
-#endif
+#endif /* ASM_X86__NMI_H */