diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/x86/include/asm/nmi.h | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'arch/x86/include/asm/nmi.h')
-rw-r--r-- | arch/x86/include/asm/nmi.h | 72 |
1 files changed, 20 insertions, 52 deletions
diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h index 932f0f86b4b7..4886a68f267e 100644 --- a/arch/x86/include/asm/nmi.h +++ b/arch/x86/include/asm/nmi.h | |||
@@ -5,41 +5,14 @@ | |||
5 | #include <asm/irq.h> | 5 | #include <asm/irq.h> |
6 | #include <asm/io.h> | 6 | #include <asm/io.h> |
7 | 7 | ||
8 | #ifdef ARCH_HAS_NMI_WATCHDOG | 8 | #ifdef CONFIG_X86_LOCAL_APIC |
9 | 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 | 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); | 10 | extern int avail_to_resrv_perfctr_nmi_bit(unsigned int); |
24 | extern int reserve_perfctr_nmi(unsigned int); | 11 | extern int reserve_perfctr_nmi(unsigned int); |
25 | extern void release_perfctr_nmi(unsigned int); | 12 | extern void release_perfctr_nmi(unsigned int); |
26 | extern int reserve_evntsel_nmi(unsigned int); | 13 | extern int reserve_evntsel_nmi(unsigned int); |
27 | extern void release_evntsel_nmi(unsigned int); | 14 | extern void release_evntsel_nmi(unsigned int); |
28 | 15 | ||
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); | ||
35 | |||
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 | ||
42 | |||
43 | struct ctl_table; | 16 | struct ctl_table; |
44 | extern int proc_nmi_enabled(struct ctl_table *, int , | 17 | extern int proc_nmi_enabled(struct ctl_table *, int , |
45 | void __user *, size_t *, loff_t *); | 18 | void __user *, size_t *, loff_t *); |
@@ -47,33 +20,28 @@ extern int unknown_nmi_panic; | |||
47 | 20 | ||
48 | void arch_trigger_all_cpu_backtrace(void); | 21 | void arch_trigger_all_cpu_backtrace(void); |
49 | #define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace | 22 | #define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace |
23 | #endif | ||
50 | 24 | ||
51 | static inline void localise_nmi_watchdog(void) | 25 | /* |
52 | { | 26 | * Define some priorities for the nmi notifier call chain. |
53 | if (nmi_watchdog == NMI_IO_APIC) | 27 | * |
54 | nmi_watchdog = NMI_LOCAL_APIC; | 28 | * Create a local nmi bit that has a higher priority than |
55 | } | 29 | * external nmis, because the local ones are more frequent. |
30 | * | ||
31 | * Also setup some default high/normal/low settings for | ||
32 | * subsystems to registers with. Using 4 bits to separate | ||
33 | * the priorities. This can go a lot higher if needed be. | ||
34 | */ | ||
56 | 35 | ||
57 | /* check if nmi_watchdog is active (ie was specified at boot) */ | 36 | #define NMI_LOCAL_SHIFT 16 /* randomly picked */ |
58 | static inline int nmi_watchdog_active(void) | 37 | #define NMI_LOCAL_BIT (1ULL << NMI_LOCAL_SHIFT) |
59 | { | 38 | #define NMI_HIGH_PRIOR (1ULL << 8) |
60 | /* | 39 | #define NMI_NORMAL_PRIOR (1ULL << 4) |
61 | * actually it should be: | 40 | #define NMI_LOW_PRIOR (1ULL << 0) |
62 | * return (nmi_watchdog == NMI_LOCAL_APIC || | 41 | #define NMI_LOCAL_HIGH_PRIOR (NMI_LOCAL_BIT | NMI_HIGH_PRIOR) |
63 | * nmi_watchdog == NMI_IO_APIC) | 42 | #define NMI_LOCAL_NORMAL_PRIOR (NMI_LOCAL_BIT | NMI_NORMAL_PRIOR) |
64 | * but since they are power of two we could use a | 43 | #define NMI_LOCAL_LOW_PRIOR (NMI_LOCAL_BIT | NMI_LOW_PRIOR) |
65 | * cheaper way --cvg | ||
66 | */ | ||
67 | return nmi_watchdog & (NMI_LOCAL_APIC | NMI_IO_APIC); | ||
68 | } | ||
69 | #endif | ||
70 | 44 | ||
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); | 45 | void stop_nmi(void); |
78 | void restart_nmi(void); | 46 | void restart_nmi(void); |
79 | 47 | ||