blob: 70a958a8e3816f738558ca33b00a49d3e14cd3a0 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/include/asm-i386/nmi.h
3 */
4#ifndef ASM_NMI_H
5#define ASM_NMI_H
6
7#include <linux/pm.h>
Andrew Mortonbb81a092006-12-07 02:14:01 +01008#include <asm/irq.h>
9
10#ifdef ARCH_HAS_NMI_WATCHDOG
Don Zickus3e4ff112006-06-26 13:57:01 +020011
Don Zickus3e4ff112006-06-26 13:57:01 +020012/**
Don Zickus2fbe7b22006-09-26 10:52:27 +020013 * do_nmi_callback
Linus Torvalds1da177e2005-04-16 15:20:36 -070014 *
Don Zickus2fbe7b22006-09-26 10:52:27 +020015 * Check to see if a callback exists and execute it. Return 1
16 * if the handler exists and was handled successfully.
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 */
Don Zickus2fbe7b22006-09-26 10:52:27 +020018int do_nmi_callback(struct pt_regs *regs, int cpu);
Don Zickus3e4ff112006-06-26 13:57:01 +020019
Don Zickus407984f2006-09-26 10:52:27 +020020extern int nmi_watchdog_enabled;
Don Zickus828f0af2006-09-26 10:52:26 +020021extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
22extern int avail_to_resrv_perfctr_nmi(unsigned int);
23extern int reserve_perfctr_nmi(unsigned int);
24extern void release_perfctr_nmi(unsigned int);
25extern int reserve_evntsel_nmi(unsigned int);
26extern void release_evntsel_nmi(unsigned int);
27
Don Zickusb7471c62006-09-26 10:52:26 +020028extern void setup_apic_nmi_watchdog (void *);
Shaohua Li4038f902006-09-26 10:52:27 +020029extern void stop_apic_nmi_watchdog (void *);
Don Zickus3e4ff112006-06-26 13:57:01 +020030extern void disable_timer_nmi_watchdog(void);
31extern void enable_timer_nmi_watchdog(void);
Don Zickus3adbbcc2006-09-26 10:52:26 +020032extern int nmi_watchdog_tick (struct pt_regs * regs, unsigned reason);
Don Zickus3e4ff112006-06-26 13:57:01 +020033
Don Zickusb7471c62006-09-26 10:52:26 +020034extern atomic_t nmi_active;
Don Zickus3e4ff112006-06-26 13:57:01 +020035extern unsigned int nmi_watchdog;
Daniel Gollub0328ece2007-08-15 02:40:35 +020036#define NMI_DISABLED -1
Don Zickus3e4ff112006-06-26 13:57:01 +020037#define NMI_NONE 0
38#define NMI_IO_APIC 1
39#define NMI_LOCAL_APIC 2
40#define NMI_INVALID 3
Daniel Gollub0328ece2007-08-15 02:40:35 +020041#define NMI_DEFAULT NMI_DISABLED
Don Zickus3e4ff112006-06-26 13:57:01 +020042
Andi Kleen29cbc782006-09-30 01:47:55 +020043struct ctl_table;
44struct file;
45extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
46 void __user *, size_t *, loff_t *);
47extern int unknown_nmi_panic;
48
Andrew Mortonbb81a092006-12-07 02:14:01 +010049void __trigger_all_cpu_backtrace(void);
50#define trigger_all_cpu_backtrace() __trigger_all_cpu_backtrace()
51
52#endif
53
Andi Kleen09198e62007-05-02 19:27:20 +020054void lapic_watchdog_stop(void);
55int lapic_watchdog_init(unsigned nmi_hz);
56int lapic_wd_event(unsigned nmi_hz);
57unsigned lapic_adjust_nmi_hz(unsigned hz);
58int lapic_watchdog_ok(void);
59void disable_lapic_nmi_watchdog(void);
60void enable_lapic_nmi_watchdog(void);
Andi Kleen8f4e9562007-07-22 11:12:32 +020061void stop_nmi(void);
62void restart_nmi(void);
Andi Kleen09198e62007-05-02 19:27:20 +020063
Linus Torvalds1da177e2005-04-16 15:20:36 -070064#endif /* ASM_NMI_H */