aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2008-05-24 11:36:33 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-25 16:32:50 -0400
commitc6425b9f143a75bbcd0a7684b4df40e20d0b2f32 (patch)
tree35f999e730579c9b2e783a28b66bd5c6a39bce51 /arch/x86/kernel
parente56b3a12c45e439169f2d1f7194be397667320a6 (diff)
x86: move do_nmi(), stop_nmi() and restart_nmi() to traps_64.c
traps_32.c already holds these functions so do the same for traps_64.c Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Cc: hpa@zytor.com Cc: mingo@redhat.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/nmi_64.c25
-rw-r--r--arch/x86/kernel/traps_64.c24
2 files changed, 24 insertions, 25 deletions
diff --git a/arch/x86/kernel/nmi_64.c b/arch/x86/kernel/nmi_64.c
index 1a98705270a2..c1ea671525e5 100644
--- a/arch/x86/kernel/nmi_64.c
+++ b/arch/x86/kernel/nmi_64.c
@@ -30,7 +30,6 @@
30 30
31int unknown_nmi_panic; 31int unknown_nmi_panic;
32int nmi_watchdog_enabled; 32int nmi_watchdog_enabled;
33int panic_on_unrecovered_nmi;
34 33
35static cpumask_t backtrace_mask = CPU_MASK_NONE; 34static cpumask_t backtrace_mask = CPU_MASK_NONE;
36 35
@@ -383,30 +382,6 @@ nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
383 return rc; 382 return rc;
384} 383}
385 384
386static unsigned ignore_nmis;
387
388asmlinkage notrace __kprobes void
389do_nmi(struct pt_regs *regs, long error_code)
390{
391 nmi_enter();
392 add_pda(__nmi_count,1);
393 if (!ignore_nmis)
394 default_do_nmi(regs);
395 nmi_exit();
396}
397
398void stop_nmi(void)
399{
400 acpi_nmi_disable();
401 ignore_nmis++;
402}
403
404void restart_nmi(void)
405{
406 ignore_nmis--;
407 acpi_nmi_enable();
408}
409
410#ifdef CONFIG_SYSCTL 385#ifdef CONFIG_SYSCTL
411 386
412static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu) 387static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu)
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index 6a048ce3c787..e4a380797dc1 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -76,7 +76,9 @@ asmlinkage void alignment_check(void);
76asmlinkage void machine_check(void); 76asmlinkage void machine_check(void);
77asmlinkage void spurious_interrupt_bug(void); 77asmlinkage void spurious_interrupt_bug(void);
78 78
79int panic_on_unrecovered_nmi;
79static unsigned int code_bytes = 64; 80static unsigned int code_bytes = 64;
81static unsigned ignore_nmis;
80 82
81static inline void conditional_sti(struct pt_regs *regs) 83static inline void conditional_sti(struct pt_regs *regs)
82{ 84{
@@ -867,6 +869,28 @@ asmlinkage notrace __kprobes void default_do_nmi(struct pt_regs *regs)
867 io_check_error(reason, regs); 869 io_check_error(reason, regs);
868} 870}
869 871
872asmlinkage notrace __kprobes void
873do_nmi(struct pt_regs *regs, long error_code)
874{
875 nmi_enter();
876 add_pda(__nmi_count, 1);
877 if (!ignore_nmis)
878 default_do_nmi(regs);
879 nmi_exit();
880}
881
882void stop_nmi(void)
883{
884 acpi_nmi_disable();
885 ignore_nmis++;
886}
887
888void restart_nmi(void)
889{
890 ignore_nmis--;
891 acpi_nmi_enable();
892}
893
870/* runs on IST stack. */ 894/* runs on IST stack. */
871asmlinkage void __kprobes do_int3(struct pt_regs * regs, long error_code) 895asmlinkage void __kprobes do_int3(struct pt_regs * regs, long error_code)
872{ 896{