blob: 7206c7e8a38813a858540742ee57e54d1a54b3e5 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef ASM_NMI_H
2#define ASM_NMI_H
3
4#include <linux/pm.h>
Andrew Mortonbb81a092006-12-07 02:14:01 +01005#include <asm/irq.h>
6
7#ifdef ARCH_HAS_NMI_WATCHDOG
Don Zickus3e4ff112006-06-26 13:57:01 +02008
Don Zickus3e4ff112006-06-26 13:57:01 +02009/**
Don Zickus2fbe7b22006-09-26 10:52:27 +020010 * do_nmi_callback
Linus Torvalds1da177e2005-04-16 15:20:36 -070011 *
Don Zickus2fbe7b22006-09-26 10:52:27 +020012 * Check to see if a callback exists and execute it. Return 1
13 * if the handler exists and was handled successfully.
Linus Torvalds1da177e2005-04-16 15:20:36 -070014 */
Don Zickus2fbe7b22006-09-26 10:52:27 +020015int do_nmi_callback(struct pt_regs *regs, int cpu);
Don Zickus3e4ff112006-06-26 13:57:01 +020016
Don Zickus407984f2006-09-26 10:52:27 +020017extern int nmi_watchdog_enabled;
Don Zickus828f0af2006-09-26 10:52:26 +020018extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
19extern int avail_to_resrv_perfctr_nmi(unsigned int);
20extern int reserve_perfctr_nmi(unsigned int);
21extern void release_perfctr_nmi(unsigned int);
22extern int reserve_evntsel_nmi(unsigned int);
23extern void release_evntsel_nmi(unsigned int);
24
Don Zickusb7471c62006-09-26 10:52:26 +020025extern void setup_apic_nmi_watchdog (void *);
Shaohua Li4038f902006-09-26 10:52:27 +020026extern void stop_apic_nmi_watchdog (void *);
Don Zickus3e4ff112006-06-26 13:57:01 +020027extern void disable_timer_nmi_watchdog(void);
28extern void enable_timer_nmi_watchdog(void);
Don Zickus3adbbcc2006-09-26 10:52:26 +020029extern int nmi_watchdog_tick (struct pt_regs * regs, unsigned reason);
Don Zickus3e4ff112006-06-26 13:57:01 +020030
Don Zickusb7471c62006-09-26 10:52:26 +020031extern atomic_t nmi_active;
Don Zickus3e4ff112006-06-26 13:57:01 +020032extern unsigned int nmi_watchdog;
Daniel Gollub0328ece2007-08-15 02:40:35 +020033#define NMI_DISABLED -1
Don Zickus3e4ff112006-06-26 13:57:01 +020034#define NMI_NONE 0
35#define NMI_IO_APIC 1
36#define NMI_LOCAL_APIC 2
37#define NMI_INVALID 3
Daniel Gollub0328ece2007-08-15 02:40:35 +020038#define NMI_DEFAULT NMI_DISABLED
Don Zickus3e4ff112006-06-26 13:57:01 +020039
Andi Kleen29cbc782006-09-30 01:47:55 +020040struct ctl_table;
41struct file;
42extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
43 void __user *, size_t *, loff_t *);
44extern int unknown_nmi_panic;
45
Andrew Mortonbb81a092006-12-07 02:14:01 +010046void __trigger_all_cpu_backtrace(void);
47#define trigger_all_cpu_backtrace() __trigger_all_cpu_backtrace()
48
49#endif
50
Andi Kleen09198e62007-05-02 19:27:20 +020051void lapic_watchdog_stop(void);
52int lapic_watchdog_init(unsigned nmi_hz);
53int lapic_wd_event(unsigned nmi_hz);
54unsigned lapic_adjust_nmi_hz(unsigned hz);
55int lapic_watchdog_ok(void);
56void disable_lapic_nmi_watchdog(void);
57void enable_lapic_nmi_watchdog(void);
Andi Kleen8f4e9562007-07-22 11:12:32 +020058void stop_nmi(void);
59void restart_nmi(void);
Andi Kleen09198e62007-05-02 19:27:20 +020060
Linus Torvalds1da177e2005-04-16 15:20:36 -070061#endif /* ASM_NMI_H */