blob: da0e0b4e9139d1c41fae7be5d92db38409078f57 [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>
Don Zickus3e4ff112006-06-26 13:57:01 +02008
Linus Torvalds1da177e2005-04-16 15:20:36 -07009struct pt_regs;
Don Zickus3e4ff112006-06-26 13:57:01 +020010
Linus Torvalds1da177e2005-04-16 15:20:36 -070011typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu);
Don Zickus3e4ff112006-06-26 13:57:01 +020012
13/**
Linus Torvalds1da177e2005-04-16 15:20:36 -070014 * set_nmi_callback
15 *
16 * Set a handler for an NMI. Only one handler may be
17 * set. Return 1 if the NMI was handled.
18 */
19void set_nmi_callback(nmi_callback_t callback);
Don Zickus3e4ff112006-06-26 13:57:01 +020020
21/**
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 * unset_nmi_callback
23 *
24 * Remove the handler previously set.
25 */
26void unset_nmi_callback(void);
Don Zickus3e4ff112006-06-26 13:57:01 +020027
Don Zickus828f0af2006-09-26 10:52:26 +020028extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
29extern int avail_to_resrv_perfctr_nmi(unsigned int);
30extern int reserve_perfctr_nmi(unsigned int);
31extern void release_perfctr_nmi(unsigned int);
32extern int reserve_evntsel_nmi(unsigned int);
33extern void release_evntsel_nmi(unsigned int);
34
Don Zickusb7471c62006-09-26 10:52:26 +020035extern void setup_apic_nmi_watchdog (void *);
Don Zickus3e4ff112006-06-26 13:57:01 +020036extern int reserve_lapic_nmi(void);
37extern void release_lapic_nmi(void);
38extern void disable_timer_nmi_watchdog(void);
39extern void enable_timer_nmi_watchdog(void);
Don Zickus3adbbcc2006-09-26 10:52:26 +020040extern int nmi_watchdog_tick (struct pt_regs * regs, unsigned reason);
Don Zickus3e4ff112006-06-26 13:57:01 +020041
Don Zickusb7471c62006-09-26 10:52:26 +020042extern atomic_t nmi_active;
Don Zickus3e4ff112006-06-26 13:57:01 +020043extern unsigned int nmi_watchdog;
44#define NMI_DEFAULT -1
45#define NMI_NONE 0
46#define NMI_IO_APIC 1
47#define NMI_LOCAL_APIC 2
48#define NMI_INVALID 3
49
Linus Torvalds1da177e2005-04-16 15:20:36 -070050#endif /* ASM_NMI_H */