blob: 27fc9e6f630e7f38b910a94b934d2d436bde57a8 [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 Zickus3e4ff112006-06-26 13:57:01 +020035extern void setup_apic_nmi_watchdog (void);
36extern 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);
40extern void nmi_watchdog_tick (struct pt_regs * regs);
41
42extern unsigned int nmi_watchdog;
43#define NMI_DEFAULT -1
44#define NMI_NONE 0
45#define NMI_IO_APIC 1
46#define NMI_LOCAL_APIC 2
47#define NMI_INVALID 3
48
Linus Torvalds1da177e2005-04-16 15:20:36 -070049#endif /* ASM_NMI_H */