x86-32, memblock: Make add_highpages honor early reserved ranges
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / x86 / include / asm / nmi.h
blob932f0f86b4b76252e6e6434ab9c15d81c3b17004
1 #ifndef _ASM_X86_NMI_H
2 #define _ASM_X86_NMI_H
4 #include <linux/pm.h>
5 #include <asm/irq.h>
6 #include <asm/io.h>
8 #ifdef ARCH_HAS_NMI_WATCHDOG
10 /**
11 * do_nmi_callback
13 * Check to see if a callback exists and execute it. Return 1
14 * if the handler exists and was handled successfully.
16 int do_nmi_callback(struct pt_regs *regs, int cpu);
18 extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
19 extern int check_nmi_watchdog(void);
20 #if !defined(CONFIG_LOCKUP_DETECTOR)
21 extern int nmi_watchdog_enabled;
22 #endif
23 extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
24 extern int reserve_perfctr_nmi(unsigned int);
25 extern void release_perfctr_nmi(unsigned int);
26 extern int reserve_evntsel_nmi(unsigned int);
27 extern void release_evntsel_nmi(unsigned int);
29 extern void setup_apic_nmi_watchdog(void *);
30 extern void stop_apic_nmi_watchdog(void *);
31 extern void disable_timer_nmi_watchdog(void);
32 extern void enable_timer_nmi_watchdog(void);
33 extern int nmi_watchdog_tick(struct pt_regs *regs, unsigned reason);
34 extern void cpu_nmi_set_wd_enabled(void);
36 extern atomic_t nmi_active;
37 extern unsigned int nmi_watchdog;
38 #define NMI_NONE 0
39 #define NMI_IO_APIC 1
40 #define NMI_LOCAL_APIC 2
41 #define NMI_INVALID 3
43 struct ctl_table;
44 extern int proc_nmi_enabled(struct ctl_table *, int ,
45 void __user *, size_t *, loff_t *);
46 extern int unknown_nmi_panic;
48 void arch_trigger_all_cpu_backtrace(void);
49 #define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
51 static inline void localise_nmi_watchdog(void)
53 if (nmi_watchdog == NMI_IO_APIC)
54 nmi_watchdog = NMI_LOCAL_APIC;
57 /* check if nmi_watchdog is active (ie was specified at boot) */
58 static inline int nmi_watchdog_active(void)
61 * actually it should be:
62 * return (nmi_watchdog == NMI_LOCAL_APIC ||
63 * nmi_watchdog == NMI_IO_APIC)
64 * but since they are power of two we could use a
65 * cheaper way --cvg
67 return nmi_watchdog & (NMI_LOCAL_APIC | NMI_IO_APIC);
69 #endif
71 void lapic_watchdog_stop(void);
72 int lapic_watchdog_init(unsigned nmi_hz);
73 int lapic_wd_event(unsigned nmi_hz);
74 unsigned lapic_adjust_nmi_hz(unsigned hz);
75 void disable_lapic_nmi_watchdog(void);
76 void enable_lapic_nmi_watchdog(void);
77 void stop_nmi(void);
78 void restart_nmi(void);
80 #endif /* _ASM_X86_NMI_H */