diff options
author | Don Zickus <dzickus@redhat.com> | 2010-02-12 17:19:19 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-02-14 03:19:43 -0500 |
commit | 504d7cf10ee42bb76b9556859f23d4121dee0a77 (patch) | |
tree | edaa43a7c221f0926d150dbbeb38abc5fe0f1cc6 /arch/x86/kernel/apic/hw_nmi.c | |
parent | c3128fb6ad39b0edda6675d20585a64846cf89ea (diff) |
nmi_watchdog: Compile and portability fixes
The original patch was x86_64 centric. Changed the code to make
it less so.
ested by building and running on a powerpc.
Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: peterz@infradead.org
Cc: gorcunov@gmail.com
Cc: aris@redhat.com
LKML-Reference: <1266013161-31197-2-git-send-email-dzickus@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic/hw_nmi.c')
-rw-r--r-- | arch/x86/kernel/apic/hw_nmi.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/arch/x86/kernel/apic/hw_nmi.c b/arch/x86/kernel/apic/hw_nmi.c index 8c0e6a410d05..312d772c5c35 100644 --- a/arch/x86/kernel/apic/hw_nmi.c +++ b/arch/x86/kernel/apic/hw_nmi.c | |||
@@ -32,8 +32,13 @@ static DEFINE_PER_CPU(unsigned, last_irq_sum); | |||
32 | */ | 32 | */ |
33 | static inline unsigned int get_timer_irqs(int cpu) | 33 | static inline unsigned int get_timer_irqs(int cpu) |
34 | { | 34 | { |
35 | return per_cpu(irq_stat, cpu).apic_timer_irqs + | 35 | unsigned int irqs = per_cpu(irq_stat, cpu).irq0_irqs; |
36 | per_cpu(irq_stat, cpu).irq0_irqs; | 36 | |
37 | #if defined(CONFIG_X86_LOCAL_APIC) | ||
38 | irqs += per_cpu(irq_stat, cpu).apic_timer_irqs; | ||
39 | #endif | ||
40 | |||
41 | return irqs; | ||
37 | } | 42 | } |
38 | 43 | ||
39 | static inline int mce_in_progress(void) | 44 | static inline int mce_in_progress(void) |
@@ -82,6 +87,11 @@ int hw_nmi_is_cpu_stuck(struct pt_regs *regs) | |||
82 | } | 87 | } |
83 | } | 88 | } |
84 | 89 | ||
90 | u64 hw_nmi_get_sample_period(void) | ||
91 | { | ||
92 | return cpu_khz * 1000; | ||
93 | } | ||
94 | |||
85 | void arch_trigger_all_cpu_backtrace(void) | 95 | void arch_trigger_all_cpu_backtrace(void) |
86 | { | 96 | { |
87 | int i; | 97 | int i; |
@@ -100,15 +110,16 @@ void arch_trigger_all_cpu_backtrace(void) | |||
100 | } | 110 | } |
101 | 111 | ||
102 | /* STUB calls to mimic old nmi_watchdog behaviour */ | 112 | /* STUB calls to mimic old nmi_watchdog behaviour */ |
113 | #if defined(CONFIG_X86_LOCAL_APIC) | ||
103 | unsigned int nmi_watchdog = NMI_NONE; | 114 | unsigned int nmi_watchdog = NMI_NONE; |
104 | EXPORT_SYMBOL(nmi_watchdog); | 115 | EXPORT_SYMBOL(nmi_watchdog); |
116 | void acpi_nmi_enable(void) { return; } | ||
117 | void acpi_nmi_disable(void) { return; } | ||
118 | #endif | ||
105 | atomic_t nmi_active = ATOMIC_INIT(0); /* oprofile uses this */ | 119 | atomic_t nmi_active = ATOMIC_INIT(0); /* oprofile uses this */ |
106 | EXPORT_SYMBOL(nmi_active); | 120 | EXPORT_SYMBOL(nmi_active); |
107 | int nmi_watchdog_enabled; | ||
108 | int unknown_nmi_panic; | 121 | int unknown_nmi_panic; |
109 | void cpu_nmi_set_wd_enabled(void) { return; } | 122 | void cpu_nmi_set_wd_enabled(void) { return; } |
110 | void acpi_nmi_enable(void) { return; } | ||
111 | void acpi_nmi_disable(void) { return; } | ||
112 | void stop_apic_nmi_watchdog(void *unused) { return; } | 123 | void stop_apic_nmi_watchdog(void *unused) { return; } |
113 | void setup_apic_nmi_watchdog(void *unused) { return; } | 124 | void setup_apic_nmi_watchdog(void *unused) { return; } |
114 | int __init check_nmi_watchdog(void) { return 0; } | 125 | int __init check_nmi_watchdog(void) { return 0; } |