]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/linux-26-headers/include/asm-x86/nmi.h
update
[l4.git] / l4 / pkg / linux-26-headers / include / asm-x86 / nmi.h
1 #ifndef _ASM_X86_NMI_H_
2 #define _ASM_X86_NMI_H_
3
4 #include <linux/pm.h>
5 #include <asm/irq.h>
6 #include <asm/io.h>
7
8 #ifdef ARCH_HAS_NMI_WATCHDOG
9
10 /**
11  * do_nmi_callback
12  *
13  * Check to see if a callback exists and execute it.  Return 1
14  * if the handler exists and was handled successfully.
15  */
16 int do_nmi_callback(struct pt_regs *regs, int cpu);
17
18 #ifdef CONFIG_X86_64
19 extern void default_do_nmi(struct pt_regs *);
20 #endif
21
22 extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
23 extern int check_nmi_watchdog(void);
24 extern int nmi_watchdog_enabled;
25 extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
26 extern int avail_to_resrv_perfctr_nmi(unsigned int);
27 extern int reserve_perfctr_nmi(unsigned int);
28 extern void release_perfctr_nmi(unsigned int);
29 extern int reserve_evntsel_nmi(unsigned int);
30 extern void release_evntsel_nmi(unsigned int);
31
32 extern void setup_apic_nmi_watchdog(void *);
33 extern void stop_apic_nmi_watchdog(void *);
34 extern void disable_timer_nmi_watchdog(void);
35 extern void enable_timer_nmi_watchdog(void);
36 extern int nmi_watchdog_tick(struct pt_regs *regs, unsigned reason);
37
38 extern atomic_t nmi_active;
39 extern unsigned int nmi_watchdog;
40 #define NMI_NONE        0
41 #define NMI_IO_APIC     1
42 #define NMI_LOCAL_APIC  2
43 #define NMI_INVALID     3
44
45 struct ctl_table;
46 struct file;
47 extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
48                         void __user *, size_t *, loff_t *);
49 extern int unknown_nmi_panic;
50
51 void __trigger_all_cpu_backtrace(void);
52 #define trigger_all_cpu_backtrace() __trigger_all_cpu_backtrace()
53
54 static inline void localise_nmi_watchdog(void)
55 {
56         if (nmi_watchdog == NMI_IO_APIC)
57                 nmi_watchdog = NMI_LOCAL_APIC;
58 }
59
60 /* check if nmi_watchdog is active (ie was specified at boot) */
61 static inline int nmi_watchdog_active(void)
62 {
63         /*
64          * actually it should be:
65          *      return (nmi_watchdog == NMI_LOCAL_APIC ||
66          *              nmi_watchdog == NMI_IO_APIC)
67          * but since they are power of two we could use a
68          * cheaper way --cvg
69          */
70         return nmi_watchdog & 0x3;
71 }
72 #endif
73
74 void lapic_watchdog_stop(void);
75 int lapic_watchdog_init(unsigned nmi_hz);
76 int lapic_wd_event(unsigned nmi_hz);
77 unsigned lapic_adjust_nmi_hz(unsigned hz);
78 int lapic_watchdog_ok(void);
79 void disable_lapic_nmi_watchdog(void);
80 void enable_lapic_nmi_watchdog(void);
81 void stop_nmi(void);
82 void restart_nmi(void);
83
84 #endif