2 * linux/include/linux/nmi.h
7 #include <linux/sched.h>
11 * touch_nmi_watchdog - restart NMI watchdog timeout.
13 * If the architecture supports the NMI watchdog, touch_nmi_watchdog()
14 * may be used to reset the timeout - for code which intentionally
15 * disables interrupts for a long time. This call is stateless.
17 #if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR_NMI)
21 #if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR)
22 extern void touch_nmi_watchdog(void);
24 static inline void touch_nmi_watchdog(void)
26 touch_softlockup_watchdog();
30 #if defined(CONFIG_HARDLOCKUP_DETECTOR)
31 extern void hardlockup_detector_disable(void);
33 static inline void hardlockup_detector_disable(void) {}
37 * Create trigger_all_cpu_backtrace() out of the arch-provided
38 * base function. Return whether such support was available,
39 * to allow calling code to fall back to some other mechanism:
41 #ifdef arch_trigger_all_cpu_backtrace
42 static inline bool trigger_all_cpu_backtrace(void)
44 arch_trigger_all_cpu_backtrace(true);
48 static inline bool trigger_allbutself_cpu_backtrace(void)
50 arch_trigger_all_cpu_backtrace(false);
54 /* generic implementation */
55 void nmi_trigger_all_cpu_backtrace(bool include_self,
56 void (*raise)(cpumask_t *mask));
57 bool nmi_cpu_backtrace(struct pt_regs *regs);
60 static inline bool trigger_all_cpu_backtrace(void)
64 static inline bool trigger_allbutself_cpu_backtrace(void)
70 #ifdef CONFIG_LOCKUP_DETECTOR
71 int hw_nmi_is_cpu_stuck(struct pt_regs *);
72 u64 hw_nmi_get_sample_period(int watchdog_thresh);
73 extern int nmi_watchdog_enabled;
74 extern int soft_watchdog_enabled;
75 extern int watchdog_user_enabled;
76 extern int watchdog_thresh;
77 extern unsigned long *watchdog_cpumask_bits;
78 extern int sysctl_softlockup_all_cpu_backtrace;
79 extern int sysctl_hardlockup_all_cpu_backtrace;
81 extern int proc_watchdog(struct ctl_table *, int ,
82 void __user *, size_t *, loff_t *);
83 extern int proc_nmi_watchdog(struct ctl_table *, int ,
84 void __user *, size_t *, loff_t *);
85 extern int proc_soft_watchdog(struct ctl_table *, int ,
86 void __user *, size_t *, loff_t *);
87 extern int proc_watchdog_thresh(struct ctl_table *, int ,
88 void __user *, size_t *, loff_t *);
89 extern int proc_watchdog_cpumask(struct ctl_table *, int,
90 void __user *, size_t *, loff_t *);
91 extern int lockup_detector_suspend(void);
92 extern void lockup_detector_resume(void);
94 static inline int lockup_detector_suspend(void)
99 static inline void lockup_detector_resume(void)
104 #ifdef CONFIG_HAVE_ACPI_APEI_NMI