nmi.h 1.6 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6
/*
 *  linux/include/linux/nmi.h
 */
#ifndef LINUX_NMI_H
#define LINUX_NMI_H

7
#include <linux/sched.h>
L
Linus Torvalds 已提交
8 9 10 11 12 13 14 15 16
#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.
 */
17
#if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR)
A
Andrew Morton 已提交
18
#include <asm/nmi.h>
19 20
extern void touch_nmi_watchdog(void);
#else
21 22 23 24
static inline void touch_nmi_watchdog(void)
{
	touch_softlockup_watchdog();
}
25
#endif
L
Linus Torvalds 已提交
26

27 28 29 30 31 32 33 34
/*
 * 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)
{
35
	arch_trigger_all_cpu_backtrace(true);
36 37 38

	return true;
}
39 40 41 42 43
static inline bool trigger_allbutself_cpu_backtrace(void)
{
	arch_trigger_all_cpu_backtrace(false);
	return true;
}
44 45 46 47 48
#else
static inline bool trigger_all_cpu_backtrace(void)
{
	return false;
}
49 50 51 52
static inline bool trigger_allbutself_cpu_backtrace(void)
{
	return false;
}
A
Andrew Morton 已提交
53 54
#endif

55
#ifdef CONFIG_LOCKUP_DETECTOR
56
int hw_nmi_is_cpu_stuck(struct pt_regs *);
57
u64 hw_nmi_get_sample_period(int watchdog_thresh);
58
extern int watchdog_user_enabled;
59
extern int watchdog_thresh;
60
extern int sysctl_softlockup_all_cpu_backtrace;
61
struct ctl_table;
62 63
extern int proc_dowatchdog(struct ctl_table *, int ,
			   void __user *, size_t *, loff_t *);
64 65
#endif

66 67 68 69
#ifdef CONFIG_HAVE_ACPI_APEI_NMI
#include <asm/nmi.h>
#endif

L
Linus Torvalds 已提交
70
#endif