2005-04-16 15:20:36 -07:00
|
|
|
/*
|
|
|
|
* linux/include/linux/nmi.h
|
|
|
|
*/
|
|
|
|
#ifndef LINUX_NMI_H
|
|
|
|
#define LINUX_NMI_H
|
|
|
|
|
2006-09-29 01:59:03 -07:00
|
|
|
#include <linux/sched.h>
|
2005-04-16 15:20:36 -07:00
|
|
|
#include <asm/irq.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* touch_nmi_watchdog - restart NMI watchdog timeout.
|
|
|
|
*
|
|
|
|
* If the architecture supports the NMI watchdog, touch_nmi_watchdog()
|
|
|
|
* may be used to reset the timeout - for code which intentionally
|
|
|
|
* disables interrupts for a long time. This call is stateless.
|
|
|
|
*/
|
2012-03-23 15:01:51 -07:00
|
|
|
#if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR)
|
2006-12-07 02:14:01 +01:00
|
|
|
#include <asm/nmi.h>
|
2010-11-29 17:07:16 -05:00
|
|
|
extern void touch_nmi_watchdog(void);
|
|
|
|
#else
|
2007-02-13 13:26:24 +01:00
|
|
|
static inline void touch_nmi_watchdog(void)
|
|
|
|
{
|
|
|
|
touch_softlockup_watchdog();
|
|
|
|
}
|
2010-11-29 17:07:16 -05:00
|
|
|
#endif
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-10-13 15:55:35 -07:00
|
|
|
#if defined(CONFIG_HARDLOCKUP_DETECTOR)
|
|
|
|
extern void watchdog_enable_hardlockup_detector(bool val);
|
|
|
|
extern bool watchdog_hardlockup_detector_is_enabled(void);
|
|
|
|
#else
|
|
|
|
static inline void watchdog_enable_hardlockup_detector(bool val)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
static inline bool watchdog_hardlockup_detector_is_enabled(void)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-08-03 09:31:54 +02:00
|
|
|
/*
|
|
|
|
* Create trigger_all_cpu_backtrace() out of the arch-provided
|
|
|
|
* base function. Return whether such support was available,
|
|
|
|
* to allow calling code to fall back to some other mechanism:
|
|
|
|
*/
|
|
|
|
#ifdef arch_trigger_all_cpu_backtrace
|
|
|
|
static inline bool trigger_all_cpu_backtrace(void)
|
|
|
|
{
|
2014-06-23 13:22:05 -07:00
|
|
|
arch_trigger_all_cpu_backtrace(true);
|
2009-08-03 09:31:54 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2014-06-23 13:22:05 -07:00
|
|
|
static inline bool trigger_allbutself_cpu_backtrace(void)
|
|
|
|
{
|
|
|
|
arch_trigger_all_cpu_backtrace(false);
|
|
|
|
return true;
|
|
|
|
}
|
2009-08-03 09:31:54 +02:00
|
|
|
#else
|
|
|
|
static inline bool trigger_all_cpu_backtrace(void)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2014-06-23 13:22:05 -07:00
|
|
|
static inline bool trigger_allbutself_cpu_backtrace(void)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2006-12-07 02:14:01 +01:00
|
|
|
#endif
|
|
|
|
|
2010-05-07 17:11:44 -04:00
|
|
|
#ifdef CONFIG_LOCKUP_DETECTOR
|
2010-02-05 21:47:05 -05:00
|
|
|
int hw_nmi_is_cpu_stuck(struct pt_regs *);
|
2011-05-22 22:10:23 -07:00
|
|
|
u64 hw_nmi_get_sample_period(int watchdog_thresh);
|
2013-05-19 20:45:15 +02:00
|
|
|
extern int watchdog_user_enabled;
|
2011-05-22 22:10:22 -07:00
|
|
|
extern int watchdog_thresh;
|
2014-06-23 13:22:05 -07:00
|
|
|
extern int sysctl_softlockup_all_cpu_backtrace;
|
2010-02-12 17:19:19 -05:00
|
|
|
struct ctl_table;
|
2011-05-22 22:10:22 -07:00
|
|
|
extern int proc_dowatchdog(struct ctl_table *, int ,
|
|
|
|
void __user *, size_t *, loff_t *);
|
2010-02-05 21:47:05 -05:00
|
|
|
#endif
|
|
|
|
|
2014-07-22 11:20:12 +02:00
|
|
|
#ifdef CONFIG_HAVE_ACPI_APEI_NMI
|
|
|
|
#include <asm/nmi.h>
|
|
|
|
#endif
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
#endif
|