aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-05-08 03:27:03 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:04 -0400
commit1eeb66a1bb973534dc3d064920a5ca683823372e (patch)
tree19c22d611e6adefb352dbc107b859e4d13ba38c1 /arch
parente3869792990f708c97be5877499cada70d469bd3 (diff)
move die notifier handling to common code
This patch moves the die notifier handling to common code. Previous various architectures had exactly the same code for it. Note that the new code is compiled unconditionally, this should be understood as an appel to the other architecture maintainer to implement support for it aswell (aka sprinkling a notify_die or two in the proper place) arm had a notifiy_die that did something totally different, I renamed it to arm_notify_die as part of the patch and made it static to the file it's declared and used at. avr32 used to pass slightly less information through this interface and I brought it into line with the other architectures. [akpm@linux-foundation.org: build fix] [akpm@linux-foundation.org: fix vmalloc_sync_all bustage] [bryan.wu@analog.com: fix vmalloc_sync_all in nommu] Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: <linux-arch@vger.kernel.org> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/kernel/traps.c14
-rw-r--r--arch/arm/mm/fault.c2
-rw-r--r--arch/avr32/kernel/kprobes.c2
-rw-r--r--arch/avr32/kernel/ptrace.c4
-rw-r--r--arch/avr32/kernel/traps.c14
-rw-r--r--arch/avr32/mm/fault.c2
-rw-r--r--arch/i386/kernel/crash.c2
-rw-r--r--arch/i386/kernel/kprobes.c2
-rw-r--r--arch/i386/kernel/nmi.c2
-rw-r--r--arch/i386/kernel/traps.c16
-rw-r--r--arch/i386/mm/fault.c3
-rw-r--r--arch/i386/oprofile/nmi_int.c2
-rw-r--r--arch/i386/oprofile/nmi_timer_int.c3
-rw-r--r--arch/ia64/kernel/crash.c2
-rw-r--r--arch/ia64/kernel/kprobes.c2
-rw-r--r--arch/ia64/kernel/mca.c2
-rw-r--r--arch/ia64/kernel/process.c2
-rw-r--r--arch/ia64/kernel/traps.c18
-rw-r--r--arch/ia64/mm/fault.c2
-rw-r--r--arch/ia64/sn/kernel/xpc_main.c4
-rw-r--r--arch/powerpc/kernel/kprobes.c2
-rw-r--r--arch/powerpc/kernel/traps.c16
-rw-r--r--arch/powerpc/mm/fault.c2
-rw-r--r--arch/s390/kernel/kprobes.c2
-rw-r--r--arch/s390/kernel/traps.c16
-rw-r--r--arch/s390/mm/fault.c2
-rw-r--r--arch/sparc/kernel/head.S2
-rw-r--r--arch/sparc/kernel/setup.c2
-rw-r--r--arch/sparc/kernel/traps.c2
-rw-r--r--arch/sparc/mm/fault.c2
-rw-r--r--arch/sparc/mm/srmmu.c2
-rw-r--r--arch/sparc64/kernel/kprobes.c2
-rw-r--r--arch/sparc64/kernel/traps.c15
-rw-r--r--arch/sparc64/mm/fault.c2
-rw-r--r--arch/x86_64/kernel/crash.c2
-rw-r--r--arch/x86_64/kernel/kprobes.c2
-rw-r--r--arch/x86_64/kernel/mce.c2
-rw-r--r--arch/x86_64/kernel/nmi.c2
-rw-r--r--arch/x86_64/kernel/pci-gart.c2
-rw-r--r--arch/x86_64/kernel/process.c2
-rw-r--r--arch/x86_64/kernel/reboot.c2
-rw-r--r--arch/x86_64/kernel/smpboot.c2
-rw-r--r--arch/x86_64/kernel/traps.c18
-rw-r--r--arch/x86_64/mm/fault.c3
44 files changed, 53 insertions, 153 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index f05e66b0f868..10ff36e4e414 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -245,8 +245,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
245 do_exit(SIGSEGV); 245 do_exit(SIGSEGV);
246} 246}
247 247
248void notify_die(const char *str, struct pt_regs *regs, struct siginfo *info, 248void arm_notify_die(const char *str, struct pt_regs *regs,
249 unsigned long err, unsigned long trap) 249 struct siginfo *info, unsigned long err, unsigned long trap)
250{ 250{
251 if (user_mode(regs)) { 251 if (user_mode(regs)) {
252 current->thread.error_code = err; 252 current->thread.error_code = err;
@@ -330,7 +330,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
330 info.si_code = ILL_ILLOPC; 330 info.si_code = ILL_ILLOPC;
331 info.si_addr = pc; 331 info.si_addr = pc;
332 332
333 notify_die("Oops - undefined instruction", regs, &info, 0, 6); 333 arm_notify_die("Oops - undefined instruction", regs, &info, 0, 6);
334} 334}
335 335
336asmlinkage void do_unexp_fiq (struct pt_regs *regs) 336asmlinkage void do_unexp_fiq (struct pt_regs *regs)
@@ -384,7 +384,7 @@ static int bad_syscall(int n, struct pt_regs *regs)
384 info.si_addr = (void __user *)instruction_pointer(regs) - 384 info.si_addr = (void __user *)instruction_pointer(regs) -
385 (thumb_mode(regs) ? 2 : 4); 385 (thumb_mode(regs) ? 2 : 4);
386 386
387 notify_die("Oops - bad syscall", regs, &info, n, 0); 387 arm_notify_die("Oops - bad syscall", regs, &info, n, 0);
388 388
389 return regs->ARM_r0; 389 return regs->ARM_r0;
390} 390}
@@ -428,7 +428,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
428 info.si_code = SEGV_MAPERR; 428 info.si_code = SEGV_MAPERR;
429 info.si_addr = NULL; 429 info.si_addr = NULL;
430 430
431 notify_die("branch through zero", regs, &info, 0, 0); 431 arm_notify_die("branch through zero", regs, &info, 0, 0);
432 return 0; 432 return 0;
433 433
434 case NR(breakpoint): /* SWI BREAK_POINT */ 434 case NR(breakpoint): /* SWI BREAK_POINT */
@@ -564,7 +564,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
564 info.si_addr = (void __user *)instruction_pointer(regs) - 564 info.si_addr = (void __user *)instruction_pointer(regs) -
565 (thumb_mode(regs) ? 2 : 4); 565 (thumb_mode(regs) ? 2 : 4);
566 566
567 notify_die("Oops - bad syscall(2)", regs, &info, no, 0); 567 arm_notify_die("Oops - bad syscall(2)", regs, &info, no, 0);
568 return 0; 568 return 0;
569} 569}
570 570
@@ -638,7 +638,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs)
638 info.si_code = ILL_ILLOPC; 638 info.si_code = ILL_ILLOPC;
639 info.si_addr = (void __user *)addr; 639 info.si_addr = (void __user *)addr;
640 640
641 notify_die("unknown data abort code", regs, &info, instr, 0); 641 arm_notify_die("unknown data abort code", regs, &info, instr, 0);
642} 642}
643 643
644void __attribute__((noreturn)) __bug(const char *file, int line) 644void __attribute__((noreturn)) __bug(const char *file, int line)
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 5d9ce7deb4a7..75d491448e45 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -453,7 +453,7 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
453 info.si_errno = 0; 453 info.si_errno = 0;
454 info.si_code = inf->code; 454 info.si_code = inf->code;
455 info.si_addr = (void __user *)addr; 455 info.si_addr = (void __user *)addr;
456 notify_die("", regs, &info, fsr, 0); 456 arm_notify_die("", regs, &info, fsr, 0);
457} 457}
458 458
459asmlinkage void __exception 459asmlinkage void __exception
diff --git a/arch/avr32/kernel/kprobes.c b/arch/avr32/kernel/kprobes.c
index d0abbcaf1c1e..004c94b6fc1d 100644
--- a/arch/avr32/kernel/kprobes.c
+++ b/arch/avr32/kernel/kprobes.c
@@ -15,7 +15,7 @@
15#include <linux/ptrace.h> 15#include <linux/ptrace.h>
16 16
17#include <asm/cacheflush.h> 17#include <asm/cacheflush.h>
18#include <asm/kdebug.h> 18#include <linux/kdebug.h>
19#include <asm/ocd.h> 19#include <asm/ocd.h>
20 20
21DEFINE_PER_CPU(struct kprobe *, current_kprobe); 21DEFINE_PER_CPU(struct kprobe *, current_kprobe);
diff --git a/arch/avr32/kernel/ptrace.c b/arch/avr32/kernel/ptrace.c
index 6f4388f7c20b..e8a3d7f01bae 100644
--- a/arch/avr32/kernel/ptrace.c
+++ b/arch/avr32/kernel/ptrace.c
@@ -21,7 +21,7 @@
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/ocd.h> 22#include <asm/ocd.h>
23#include <asm/mmu_context.h> 23#include <asm/mmu_context.h>
24#include <asm/kdebug.h> 24#include <linux/kdebug.h>
25 25
26static struct pt_regs *get_user_regs(struct task_struct *tsk) 26static struct pt_regs *get_user_regs(struct task_struct *tsk)
27{ 27{
@@ -300,7 +300,7 @@ asmlinkage void do_debug_priv(struct pt_regs *regs)
300 else 300 else
301 die_val = DIE_BREAKPOINT; 301 die_val = DIE_BREAKPOINT;
302 302
303 if (notify_die(die_val, regs, 0, SIGTRAP) == NOTIFY_STOP) 303 if (notify_die(die_val, "ptrace", regs, 0, 0, SIGTRAP) == NOTIFY_STOP)
304 return; 304 return;
305 305
306 if (likely(ds & DS_SSS)) { 306 if (likely(ds & DS_SSS)) {
diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c
index 4f0382d8483f..4de9edf96ed2 100644
--- a/arch/avr32/kernel/traps.c
+++ b/arch/avr32/kernel/traps.c
@@ -20,20 +20,6 @@
20#include <asm/sysreg.h> 20#include <asm/sysreg.h>
21#include <asm/traps.h> 21#include <asm/traps.h>
22 22
23ATOMIC_NOTIFIER_HEAD(avr32_die_chain);
24
25int register_die_notifier(struct notifier_block *nb)
26{
27 return atomic_notifier_chain_register(&avr32_die_chain, nb);
28}
29EXPORT_SYMBOL(register_die_notifier);
30
31int unregister_die_notifier(struct notifier_block *nb)
32{
33 return atomic_notifier_chain_unregister(&avr32_die_chain, nb);
34}
35EXPORT_SYMBOL(unregister_die_notifier);
36
37static DEFINE_SPINLOCK(die_lock); 23static DEFINE_SPINLOCK(die_lock);
38 24
39void NORET_TYPE die(const char *str, struct pt_regs *regs, long err) 25void NORET_TYPE die(const char *str, struct pt_regs *regs, long err)
diff --git a/arch/avr32/mm/fault.c b/arch/avr32/mm/fault.c
index 146ebdbdc302..88b00b15970f 100644
--- a/arch/avr32/mm/fault.c
+++ b/arch/avr32/mm/fault.c
@@ -13,7 +13,7 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/pagemap.h> 14#include <linux/pagemap.h>
15 15
16#include <asm/kdebug.h> 16#include <linux/kdebug.h>
17#include <asm/mmu_context.h> 17#include <asm/mmu_context.h>
18#include <asm/sysreg.h> 18#include <asm/sysreg.h>
19#include <asm/tlb.h> 19#include <asm/tlb.h>
diff --git a/arch/i386/kernel/crash.c b/arch/i386/kernel/crash.c
index a5e0e990ea95..53589d1b1a05 100644
--- a/arch/i386/kernel/crash.c
+++ b/arch/i386/kernel/crash.c
@@ -22,7 +22,7 @@
22#include <asm/nmi.h> 22#include <asm/nmi.h>
23#include <asm/hw_irq.h> 23#include <asm/hw_irq.h>
24#include <asm/apic.h> 24#include <asm/apic.h>
25#include <asm/kdebug.h> 25#include <linux/kdebug.h>
26#include <asm/smp.h> 26#include <asm/smp.h>
27 27
28#include <mach_ipi.h> 28#include <mach_ipi.h>
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index b545bc746fce..e00f75ecf1a8 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -31,8 +31,8 @@
31#include <linux/kprobes.h> 31#include <linux/kprobes.h>
32#include <linux/ptrace.h> 32#include <linux/ptrace.h>
33#include <linux/preempt.h> 33#include <linux/preempt.h>
34#include <linux/kdebug.h>
34#include <asm/cacheflush.h> 35#include <asm/cacheflush.h>
35#include <asm/kdebug.h>
36#include <asm/desc.h> 36#include <asm/desc.h>
37#include <asm/uaccess.h> 37#include <asm/uaccess.h>
38 38
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index 33cf2f3c444f..fba121f7973f 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -23,10 +23,10 @@
23#include <linux/kprobes.h> 23#include <linux/kprobes.h>
24#include <linux/cpumask.h> 24#include <linux/cpumask.h>
25#include <linux/kernel_stat.h> 25#include <linux/kernel_stat.h>
26#include <linux/kdebug.h>
26 27
27#include <asm/smp.h> 28#include <asm/smp.h>
28#include <asm/nmi.h> 29#include <asm/nmi.h>
29#include <asm/kdebug.h>
30 30
31#include "mach_traps.h" 31#include "mach_traps.h"
32 32
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 58c8e015e77e..4bec0cbf407a 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -52,7 +52,7 @@
52#include <asm/unwind.h> 52#include <asm/unwind.h>
53#include <asm/smp.h> 53#include <asm/smp.h>
54#include <asm/arch_hooks.h> 54#include <asm/arch_hooks.h>
55#include <asm/kdebug.h> 55#include <linux/kdebug.h>
56#include <asm/stacktrace.h> 56#include <asm/stacktrace.h>
57 57
58#include <linux/module.h> 58#include <linux/module.h>
@@ -95,20 +95,6 @@ asmlinkage void machine_check(void);
95 95
96int kstack_depth_to_print = 24; 96int kstack_depth_to_print = 24;
97static unsigned int code_bytes = 64; 97static unsigned int code_bytes = 64;
98ATOMIC_NOTIFIER_HEAD(i386die_chain);
99
100int register_die_notifier(struct notifier_block *nb)
101{
102 vmalloc_sync_all();
103 return atomic_notifier_chain_register(&i386die_chain, nb);
104}
105EXPORT_SYMBOL(register_die_notifier); /* used modular by kdb */
106
107int unregister_die_notifier(struct notifier_block *nb)
108{
109 return atomic_notifier_chain_unregister(&i386die_chain, nb);
110}
111EXPORT_SYMBOL(unregister_die_notifier); /* used modular by kdb */
112 98
113static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) 99static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
114{ 100{
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c
index f534c29e80b2..ca0aa0cedc35 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/i386/mm/fault.c
@@ -21,13 +21,14 @@
21#include <linux/vt_kern.h> /* For unblank_screen() */ 21#include <linux/vt_kern.h> /* For unblank_screen() */
22#include <linux/highmem.h> 22#include <linux/highmem.h>
23#include <linux/bootmem.h> /* for max_low_pfn */ 23#include <linux/bootmem.h> /* for max_low_pfn */
24#include <linux/vmalloc.h>
24#include <linux/module.h> 25#include <linux/module.h>
25#include <linux/kprobes.h> 26#include <linux/kprobes.h>
26#include <linux/uaccess.h> 27#include <linux/uaccess.h>
28#include <linux/kdebug.h>
27 29
28#include <asm/system.h> 30#include <asm/system.h>
29#include <asm/desc.h> 31#include <asm/desc.h>
30#include <asm/kdebug.h>
31#include <asm/segment.h> 32#include <asm/segment.h>
32 33
33extern void die(const char *,struct pt_regs *,long); 34extern void die(const char *,struct pt_regs *,long);
diff --git a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c
index 695f737516ae..8e185208dfd4 100644
--- a/arch/i386/oprofile/nmi_int.c
+++ b/arch/i386/oprofile/nmi_int.c
@@ -14,10 +14,10 @@
14#include <linux/sysdev.h> 14#include <linux/sysdev.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/moduleparam.h> 16#include <linux/moduleparam.h>
17#include <linux/kdebug.h>
17#include <asm/nmi.h> 18#include <asm/nmi.h>
18#include <asm/msr.h> 19#include <asm/msr.h>
19#include <asm/apic.h> 20#include <asm/apic.h>
20#include <asm/kdebug.h>
21 21
22#include "op_counter.h" 22#include "op_counter.h"
23#include "op_x86_model.h" 23#include "op_x86_model.h"
diff --git a/arch/i386/oprofile/nmi_timer_int.c b/arch/i386/oprofile/nmi_timer_int.c
index abf0ba52a635..1418e36ae7ab 100644
--- a/arch/i386/oprofile/nmi_timer_int.c
+++ b/arch/i386/oprofile/nmi_timer_int.c
@@ -12,12 +12,11 @@
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/oprofile.h> 13#include <linux/oprofile.h>
14#include <linux/rcupdate.h> 14#include <linux/rcupdate.h>
15 15#include <linux/kdebug.h>
16 16
17#include <asm/nmi.h> 17#include <asm/nmi.h>
18#include <asm/apic.h> 18#include <asm/apic.h>
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/kdebug.h>
21 20
22static int profile_timer_exceptions_notify(struct notifier_block *self, 21static int profile_timer_exceptions_notify(struct notifier_block *self,
23 unsigned long val, void *data) 22 unsigned long val, void *data)
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c
index 80a94e707827..3d51a3f77017 100644
--- a/arch/ia64/kernel/crash.c
+++ b/arch/ia64/kernel/crash.c
@@ -16,8 +16,8 @@
16#include <linux/elfcore.h> 16#include <linux/elfcore.h>
17#include <linux/sysctl.h> 17#include <linux/sysctl.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/kdebug.h>
19 20
20#include <asm/kdebug.h>
21#include <asm/mca.h> 21#include <asm/mca.h>
22 22
23int kdump_status[NR_CPUS]; 23int kdump_status[NR_CPUS];
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 6cb56dd4056d..779fe00c9025 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -29,9 +29,9 @@
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/preempt.h> 30#include <linux/preempt.h>
31#include <linux/moduleloader.h> 31#include <linux/moduleloader.h>
32#include <linux/kdebug.h>
32 33
33#include <asm/pgtable.h> 34#include <asm/pgtable.h>
34#include <asm/kdebug.h>
35#include <asm/sections.h> 35#include <asm/sections.h>
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37 37
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 491687f84fb5..65e3b81a442e 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -72,9 +72,9 @@
72#include <linux/smp.h> 72#include <linux/smp.h>
73#include <linux/workqueue.h> 73#include <linux/workqueue.h>
74#include <linux/cpumask.h> 74#include <linux/cpumask.h>
75#include <linux/kdebug.h>
75 76
76#include <asm/delay.h> 77#include <asm/delay.h>
77#include <asm/kdebug.h>
78#include <asm/machvec.h> 78#include <asm/machvec.h>
79#include <asm/meminit.h> 79#include <asm/meminit.h>
80#include <asm/page.h> 80#include <asm/page.h>
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index ae96d4176995..7ab36c772e21 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -27,13 +27,13 @@
27#include <linux/efi.h> 27#include <linux/efi.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/kdebug.h>
30 31
31#include <asm/cpu.h> 32#include <asm/cpu.h>
32#include <asm/delay.h> 33#include <asm/delay.h>
33#include <asm/elf.h> 34#include <asm/elf.h>
34#include <asm/ia32.h> 35#include <asm/ia32.h>
35#include <asm/irq.h> 36#include <asm/irq.h>
36#include <asm/kdebug.h>
37#include <asm/kexec.h> 37#include <asm/kexec.h>
38#include <asm/pgalloc.h> 38#include <asm/pgalloc.h>
39#include <asm/processor.h> 39#include <asm/processor.h>
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index 765cbe5ba6ae..5bfb8be02b70 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -16,33 +16,17 @@
16#include <linux/hardirq.h> 16#include <linux/hardirq.h>
17#include <linux/kprobes.h> 17#include <linux/kprobes.h>
18#include <linux/delay.h> /* for ssleep() */ 18#include <linux/delay.h> /* for ssleep() */
19#include <linux/kdebug.h>
19 20
20#include <asm/fpswa.h> 21#include <asm/fpswa.h>
21#include <asm/ia32.h> 22#include <asm/ia32.h>
22#include <asm/intrinsics.h> 23#include <asm/intrinsics.h>
23#include <asm/processor.h> 24#include <asm/processor.h>
24#include <asm/uaccess.h> 25#include <asm/uaccess.h>
25#include <asm/kdebug.h>
26 26
27fpswa_interface_t *fpswa_interface; 27fpswa_interface_t *fpswa_interface;
28EXPORT_SYMBOL(fpswa_interface); 28EXPORT_SYMBOL(fpswa_interface);
29 29
30ATOMIC_NOTIFIER_HEAD(ia64die_chain);
31
32int
33register_die_notifier(struct notifier_block *nb)
34{
35 return atomic_notifier_chain_register(&ia64die_chain, nb);
36}
37EXPORT_SYMBOL_GPL(register_die_notifier);
38
39int
40unregister_die_notifier(struct notifier_block *nb)
41{
42 return atomic_notifier_chain_unregister(&ia64die_chain, nb);
43}
44EXPORT_SYMBOL_GPL(unregister_die_notifier);
45
46void __init 30void __init
47trap_init (void) 31trap_init (void)
48{ 32{
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c
index 59f3ab937615..cb4791d17cce 100644
--- a/arch/ia64/mm/fault.c
+++ b/arch/ia64/mm/fault.c
@@ -10,12 +10,12 @@
10#include <linux/smp_lock.h> 10#include <linux/smp_lock.h>
11#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <linux/kprobes.h> 12#include <linux/kprobes.h>
13#include <linux/kdebug.h>
13 14
14#include <asm/pgtable.h> 15#include <asm/pgtable.h>
15#include <asm/processor.h> 16#include <asm/processor.h>
16#include <asm/system.h> 17#include <asm/system.h>
17#include <asm/uaccess.h> 18#include <asm/uaccess.h>
18#include <asm/kdebug.h>
19 19
20extern void die (char *, struct pt_regs *, long); 20extern void die (char *, struct pt_regs *, long);
21 21
diff --git a/arch/ia64/sn/kernel/xpc_main.c b/arch/ia64/sn/kernel/xpc_main.c
index 68355ef6f841..e336e1692a73 100644
--- a/arch/ia64/sn/kernel/xpc_main.c
+++ b/arch/ia64/sn/kernel/xpc_main.c
@@ -55,9 +55,9 @@
55#include <linux/delay.h> 55#include <linux/delay.h>
56#include <linux/reboot.h> 56#include <linux/reboot.h>
57#include <linux/completion.h> 57#include <linux/completion.h>
58#include <linux/kdebug.h>
58#include <asm/sn/intr.h> 59#include <asm/sn/intr.h>
59#include <asm/sn/sn_sal.h> 60#include <asm/sn/sn_sal.h>
60#include <asm/kdebug.h>
61#include <asm/uaccess.h> 61#include <asm/uaccess.h>
62#include <asm/sn/xpc.h> 62#include <asm/sn/xpc.h>
63 63
@@ -1332,7 +1332,7 @@ xpc_init(void)
1332 dev_warn(xpc_part, "can't register reboot notifier\n"); 1332 dev_warn(xpc_part, "can't register reboot notifier\n");
1333 } 1333 }
1334 1334
1335 /* add ourselves to the die_notifier list (i.e., ia64die_chain) */ 1335 /* add ourselves to the die_notifier list */
1336 ret = register_die_notifier(&xpc_die_notifier); 1336 ret = register_die_notifier(&xpc_die_notifier);
1337 if (ret != 0) { 1337 if (ret != 0) {
1338 dev_warn(xpc_part, "can't register die notifier\n"); 1338 dev_warn(xpc_part, "can't register die notifier\n");
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index ef647e7a9dc3..2a2c696dcc7a 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -30,8 +30,8 @@
30#include <linux/ptrace.h> 30#include <linux/ptrace.h>
31#include <linux/preempt.h> 31#include <linux/preempt.h>
32#include <linux/module.h> 32#include <linux/module.h>
33#include <linux/kdebug.h>
33#include <asm/cacheflush.h> 34#include <asm/cacheflush.h>
34#include <asm/kdebug.h>
35#include <asm/sstep.h> 35#include <asm/sstep.h>
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37 37
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index f7862224fe85..bf6445ac9f1c 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -33,8 +33,8 @@
33#include <linux/kexec.h> 33#include <linux/kexec.h>
34#include <linux/backlight.h> 34#include <linux/backlight.h>
35#include <linux/bug.h> 35#include <linux/bug.h>
36#include <linux/kdebug.h>
36 37
37#include <asm/kdebug.h>
38#include <asm/pgtable.h> 38#include <asm/pgtable.h>
39#include <asm/uaccess.h> 39#include <asm/uaccess.h>
40#include <asm/system.h> 40#include <asm/system.h>
@@ -72,20 +72,6 @@ EXPORT_SYMBOL(__debugger_dabr_match);
72EXPORT_SYMBOL(__debugger_fault_handler); 72EXPORT_SYMBOL(__debugger_fault_handler);
73#endif 73#endif
74 74
75ATOMIC_NOTIFIER_HEAD(powerpc_die_chain);
76
77int register_die_notifier(struct notifier_block *nb)
78{
79 return atomic_notifier_chain_register(&powerpc_die_chain, nb);
80}
81EXPORT_SYMBOL(register_die_notifier);
82
83int unregister_die_notifier(struct notifier_block *nb)
84{
85 return atomic_notifier_chain_unregister(&powerpc_die_chain, nb);
86}
87EXPORT_SYMBOL(unregister_die_notifier);
88
89/* 75/*
90 * Trap & Exception support 76 * Trap & Exception support
91 */ 77 */
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 03aeb3a46077..bec0cce79a78 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -28,6 +28,7 @@
28#include <linux/highmem.h> 28#include <linux/highmem.h>
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/kprobes.h> 30#include <linux/kprobes.h>
31#include <linux/kdebug.h>
31 32
32#include <asm/page.h> 33#include <asm/page.h>
33#include <asm/pgtable.h> 34#include <asm/pgtable.h>
@@ -36,7 +37,6 @@
36#include <asm/system.h> 37#include <asm/system.h>
37#include <asm/uaccess.h> 38#include <asm/uaccess.h>
38#include <asm/tlbflush.h> 39#include <asm/tlbflush.h>
39#include <asm/kdebug.h>
40#include <asm/siginfo.h> 40#include <asm/siginfo.h>
41 41
42#ifdef CONFIG_KPROBES 42#ifdef CONFIG_KPROBES
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index 23c61f6d965b..8516a94d8163 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -24,8 +24,8 @@
24#include <linux/ptrace.h> 24#include <linux/ptrace.h>
25#include <linux/preempt.h> 25#include <linux/preempt.h>
26#include <linux/stop_machine.h> 26#include <linux/stop_machine.h>
27#include <linux/kdebug.h>
27#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
28#include <asm/kdebug.h>
29#include <asm/sections.h> 29#include <asm/sections.h>
30#include <asm/uaccess.h> 30#include <asm/uaccess.h>
31#include <linux/module.h> 31#include <linux/module.h>
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 49dec830373a..a750bcc69aaa 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -27,6 +27,7 @@
27#include <linux/interrupt.h> 27#include <linux/interrupt.h>
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/kdebug.h>
30#include <linux/kallsyms.h> 31#include <linux/kallsyms.h>
31#include <linux/reboot.h> 32#include <linux/reboot.h>
32#include <linux/kprobes.h> 33#include <linux/kprobes.h>
@@ -40,7 +41,6 @@
40#include <asm/s390_ext.h> 41#include <asm/s390_ext.h>
41#include <asm/lowcore.h> 42#include <asm/lowcore.h>
42#include <asm/debug.h> 43#include <asm/debug.h>
43#include <asm/kdebug.h>
44 44
45/* Called from entry.S only */ 45/* Called from entry.S only */
46extern void handle_per_exception(struct pt_regs *regs); 46extern void handle_per_exception(struct pt_regs *regs);
@@ -70,20 +70,6 @@ static int kstack_depth_to_print = 12;
70static int kstack_depth_to_print = 20; 70static int kstack_depth_to_print = 20;
71#endif /* CONFIG_64BIT */ 71#endif /* CONFIG_64BIT */
72 72
73ATOMIC_NOTIFIER_HEAD(s390die_chain);
74
75int register_die_notifier(struct notifier_block *nb)
76{
77 return atomic_notifier_chain_register(&s390die_chain, nb);
78}
79EXPORT_SYMBOL(register_die_notifier);
80
81int unregister_die_notifier(struct notifier_block *nb)
82{
83 return atomic_notifier_chain_unregister(&s390die_chain, nb);
84}
85EXPORT_SYMBOL(unregister_die_notifier);
86
87/* 73/*
88 * For show_trace we have tree different stack to consider: 74 * For show_trace we have tree different stack to consider:
89 * - the panic stack which is used if the kernel stack has overflown 75 * - the panic stack which is used if the kernel stack has overflown
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 91f705adc3f9..8b924b359774 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -20,6 +20,7 @@
20#include <linux/mman.h> 20#include <linux/mman.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/kdebug.h>
23#include <linux/smp_lock.h> 24#include <linux/smp_lock.h>
24#include <linux/init.h> 25#include <linux/init.h>
25#include <linux/console.h> 26#include <linux/console.h>
@@ -30,7 +31,6 @@
30 31
31#include <asm/system.h> 32#include <asm/system.h>
32#include <asm/pgtable.h> 33#include <asm/pgtable.h>
33#include <asm/kdebug.h>
34#include <asm/s390_ext.h> 34#include <asm/s390_ext.h>
35 35
36#ifndef CONFIG_64BIT 36#ifndef CONFIG_64BIT
diff --git a/arch/sparc/kernel/head.S b/arch/sparc/kernel/head.S
index 9a219e8b5ddb..97da13c52563 100644
--- a/arch/sparc/kernel/head.S
+++ b/arch/sparc/kernel/head.S
@@ -19,7 +19,7 @@
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/psr.h> 20#include <asm/psr.h>
21#include <asm/page.h> 21#include <asm/page.h>
22#include <asm/kdebug.h> 22#include <linux/kdebug.h>
23#include <asm/winmacro.h> 23#include <asm/winmacro.h>
24#include <asm/thread_info.h> /* TI_UWINMASK */ 24#include <asm/thread_info.h> /* TI_UWINMASK */
25#include <asm/errno.h> 25#include <asm/errno.h>
diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c
index eccd8e87f529..64c0ed98820a 100644
--- a/arch/sparc/kernel/setup.c
+++ b/arch/sparc/kernel/setup.c
@@ -31,6 +31,7 @@
31#include <linux/spinlock.h> 31#include <linux/spinlock.h>
32#include <linux/root_dev.h> 32#include <linux/root_dev.h>
33#include <linux/cpu.h> 33#include <linux/cpu.h>
34#include <linux/kdebug.h>
34 35
35#include <asm/system.h> 36#include <asm/system.h>
36#include <asm/io.h> 37#include <asm/io.h>
@@ -40,7 +41,6 @@
40#include <asm/pgtable.h> 41#include <asm/pgtable.h>
41#include <asm/traps.h> 42#include <asm/traps.h>
42#include <asm/vaddrs.h> 43#include <asm/vaddrs.h>
43#include <asm/kdebug.h>
44#include <asm/mbus.h> 44#include <asm/mbus.h>
45#include <asm/idprom.h> 45#include <asm/idprom.h>
46#include <asm/machines.h> 46#include <asm/machines.h>
diff --git a/arch/sparc/kernel/traps.c b/arch/sparc/kernel/traps.c
index 527687afc1c4..dc9ffea2a4f7 100644
--- a/arch/sparc/kernel/traps.c
+++ b/arch/sparc/kernel/traps.c
@@ -15,6 +15,7 @@
15#include <linux/signal.h> 15#include <linux/signal.h>
16#include <linux/smp.h> 16#include <linux/smp.h>
17#include <linux/smp_lock.h> 17#include <linux/smp_lock.h>
18#include <linux/kdebug.h>
18 19
19#include <asm/delay.h> 20#include <asm/delay.h>
20#include <asm/system.h> 21#include <asm/system.h>
@@ -22,7 +23,6 @@
22#include <asm/oplib.h> 23#include <asm/oplib.h>
23#include <asm/page.h> 24#include <asm/page.h>
24#include <asm/pgtable.h> 25#include <asm/pgtable.h>
25#include <asm/kdebug.h>
26#include <asm/unistd.h> 26#include <asm/unistd.h>
27#include <asm/traps.h> 27#include <asm/traps.h>
28 28
diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c
index 9eeed3347df3..c133f270cf70 100644
--- a/arch/sparc/mm/fault.c
+++ b/arch/sparc/mm/fault.c
@@ -21,6 +21,7 @@
21#include <linux/smp_lock.h> 21#include <linux/smp_lock.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/kdebug.h>
24 25
25#include <asm/system.h> 26#include <asm/system.h>
26#include <asm/page.h> 27#include <asm/page.h>
@@ -30,7 +31,6 @@
30#include <asm/oplib.h> 31#include <asm/oplib.h>
31#include <asm/smp.h> 32#include <asm/smp.h>
32#include <asm/traps.h> 33#include <asm/traps.h>
33#include <asm/kdebug.h>
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35 35
36extern int prom_node_root; 36extern int prom_node_root;
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 0df7121cef07..e5eaa8072ae0 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -18,13 +18,13 @@
18#include <linux/bootmem.h> 18#include <linux/bootmem.h>
19#include <linux/fs.h> 19#include <linux/fs.h>
20#include <linux/seq_file.h> 20#include <linux/seq_file.h>
21#include <linux/kdebug.h>
21 22
22#include <asm/bitext.h> 23#include <asm/bitext.h>
23#include <asm/page.h> 24#include <asm/page.h>
24#include <asm/pgalloc.h> 25#include <asm/pgalloc.h>
25#include <asm/pgtable.h> 26#include <asm/pgtable.h>
26#include <asm/io.h> 27#include <asm/io.h>
27#include <asm/kdebug.h>
28#include <asm/vaddrs.h> 28#include <asm/vaddrs.h>
29#include <asm/traps.h> 29#include <asm/traps.h>
30#include <asm/smp.h> 30#include <asm/smp.h>
diff --git a/arch/sparc64/kernel/kprobes.c b/arch/sparc64/kernel/kprobes.c
index ae221f0d4a6f..a44fe47a3c2b 100644
--- a/arch/sparc64/kernel/kprobes.c
+++ b/arch/sparc64/kernel/kprobes.c
@@ -6,7 +6,7 @@
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/kprobes.h> 7#include <linux/kprobes.h>
8#include <linux/module.h> 8#include <linux/module.h>
9#include <asm/kdebug.h> 9#include <linux/kdebug.h>
10#include <asm/signal.h> 10#include <asm/signal.h>
11#include <asm/cacheflush.h> 11#include <asm/cacheflush.h>
12#include <asm/uaccess.h> 12#include <asm/uaccess.h>
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index ad67784292db..64057fdfc7a8 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -18,6 +18,7 @@
18#include <linux/smp_lock.h> 18#include <linux/smp_lock.h>
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/kdebug.h>
21 22
22#include <asm/delay.h> 23#include <asm/delay.h>
23#include <asm/system.h> 24#include <asm/system.h>
@@ -36,26 +37,12 @@
36#include <asm/psrcompat.h> 37#include <asm/psrcompat.h>
37#include <asm/processor.h> 38#include <asm/processor.h>
38#include <asm/timer.h> 39#include <asm/timer.h>
39#include <asm/kdebug.h>
40#include <asm/head.h> 40#include <asm/head.h>
41#ifdef CONFIG_KMOD 41#ifdef CONFIG_KMOD
42#include <linux/kmod.h> 42#include <linux/kmod.h>
43#endif 43#endif
44#include <asm/prom.h> 44#include <asm/prom.h>
45 45
46ATOMIC_NOTIFIER_HEAD(sparc64die_chain);
47
48int register_die_notifier(struct notifier_block *nb)
49{
50 return atomic_notifier_chain_register(&sparc64die_chain, nb);
51}
52EXPORT_SYMBOL(register_die_notifier);
53
54int unregister_die_notifier(struct notifier_block *nb)
55{
56 return atomic_notifier_chain_unregister(&sparc64die_chain, nb);
57}
58EXPORT_SYMBOL(unregister_die_notifier);
59 46
60/* When an irrecoverable trap occurs at tl > 0, the trap entry 47/* When an irrecoverable trap occurs at tl > 0, the trap entry
61 * code logs the trap state registers at every level in the trap 48 * code logs the trap state registers at every level in the trap
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 55ae802dc0ad..7c36527b7454 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -20,6 +20,7 @@
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/kprobes.h> 21#include <linux/kprobes.h>
22#include <linux/kallsyms.h> 22#include <linux/kallsyms.h>
23#include <linux/kdebug.h>
23 24
24#include <asm/page.h> 25#include <asm/page.h>
25#include <asm/pgtable.h> 26#include <asm/pgtable.h>
@@ -29,7 +30,6 @@
29#include <asm/asi.h> 30#include <asm/asi.h>
30#include <asm/lsu.h> 31#include <asm/lsu.h>
31#include <asm/sections.h> 32#include <asm/sections.h>
32#include <asm/kdebug.h>
33#include <asm/mmu_context.h> 33#include <asm/mmu_context.h>
34 34
35#ifdef CONFIG_KPROBES 35#ifdef CONFIG_KPROBES
diff --git a/arch/x86_64/kernel/crash.c b/arch/x86_64/kernel/crash.c
index 95a7a2c13131..13432a1ae904 100644
--- a/arch/x86_64/kernel/crash.c
+++ b/arch/x86_64/kernel/crash.c
@@ -17,13 +17,13 @@
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/elf.h> 18#include <linux/elf.h>
19#include <linux/elfcore.h> 19#include <linux/elfcore.h>
20#include <linux/kdebug.h>
20 21
21#include <asm/processor.h> 22#include <asm/processor.h>
22#include <asm/hardirq.h> 23#include <asm/hardirq.h>
23#include <asm/nmi.h> 24#include <asm/nmi.h>
24#include <asm/hw_irq.h> 25#include <asm/hw_irq.h>
25#include <asm/mach_apic.h> 26#include <asm/mach_apic.h>
26#include <asm/kdebug.h>
27 27
28/* This keeps a track of which one is crashing cpu. */ 28/* This keeps a track of which one is crashing cpu. */
29static int crashing_cpu; 29static int crashing_cpu;
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c
index 209c8c0bec71..90e7008cd899 100644
--- a/arch/x86_64/kernel/kprobes.c
+++ b/arch/x86_64/kernel/kprobes.c
@@ -37,10 +37,10 @@
37#include <linux/slab.h> 37#include <linux/slab.h>
38#include <linux/preempt.h> 38#include <linux/preempt.h>
39#include <linux/module.h> 39#include <linux/module.h>
40#include <linux/kdebug.h>
40 41
41#include <asm/cacheflush.h> 42#include <asm/cacheflush.h>
42#include <asm/pgtable.h> 43#include <asm/pgtable.h>
43#include <asm/kdebug.h>
44#include <asm/uaccess.h> 44#include <asm/uaccess.h>
45 45
46void jprobe_return_end(void); 46void jprobe_return_end(void);
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index fa2672682477..442169640e45 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -20,10 +20,10 @@
20#include <linux/percpu.h> 20#include <linux/percpu.h>
21#include <linux/ctype.h> 21#include <linux/ctype.h>
22#include <linux/kmod.h> 22#include <linux/kmod.h>
23#include <linux/kdebug.h>
23#include <asm/processor.h> 24#include <asm/processor.h>
24#include <asm/msr.h> 25#include <asm/msr.h>
25#include <asm/mce.h> 26#include <asm/mce.h>
26#include <asm/kdebug.h>
27#include <asm/uaccess.h> 27#include <asm/uaccess.h>
28#include <asm/smp.h> 28#include <asm/smp.h>
29 29
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c
index 6cd2b30e2ffc..931c64bad5e6 100644
--- a/arch/x86_64/kernel/nmi.c
+++ b/arch/x86_64/kernel/nmi.c
@@ -21,11 +21,11 @@
21#include <linux/sysctl.h> 21#include <linux/sysctl.h>
22#include <linux/kprobes.h> 22#include <linux/kprobes.h>
23#include <linux/cpumask.h> 23#include <linux/cpumask.h>
24#include <linux/kdebug.h>
24 25
25#include <asm/smp.h> 26#include <asm/smp.h>
26#include <asm/nmi.h> 27#include <asm/nmi.h>
27#include <asm/proto.h> 28#include <asm/proto.h>
28#include <asm/kdebug.h>
29#include <asm/mce.h> 29#include <asm/mce.h>
30 30
31int unknown_nmi_panic; 31int unknown_nmi_panic;
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
index 0a762e10f2be..373ef66ca1dc 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86_64/kernel/pci-gart.c
@@ -22,13 +22,13 @@
22#include <linux/topology.h> 22#include <linux/topology.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25#include <linux/kdebug.h>
25#include <asm/atomic.h> 26#include <asm/atomic.h>
26#include <asm/io.h> 27#include <asm/io.h>
27#include <asm/mtrr.h> 28#include <asm/mtrr.h>
28#include <asm/pgtable.h> 29#include <asm/pgtable.h>
29#include <asm/proto.h> 30#include <asm/proto.h>
30#include <asm/cacheflush.h> 31#include <asm/cacheflush.h>
31#include <asm/kdebug.h>
32#include <asm/swiotlb.h> 32#include <asm/swiotlb.h>
33#include <asm/dma.h> 33#include <asm/dma.h>
34#include <asm/k8.h> 34#include <asm/k8.h>
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index 4f21765078b7..5909039f37aa 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -36,6 +36,7 @@
36#include <linux/random.h> 36#include <linux/random.h>
37#include <linux/notifier.h> 37#include <linux/notifier.h>
38#include <linux/kprobes.h> 38#include <linux/kprobes.h>
39#include <linux/kdebug.h>
39 40
40#include <asm/uaccess.h> 41#include <asm/uaccess.h>
41#include <asm/pgtable.h> 42#include <asm/pgtable.h>
@@ -46,7 +47,6 @@
46#include <asm/mmu_context.h> 47#include <asm/mmu_context.h>
47#include <asm/pda.h> 48#include <asm/pda.h>
48#include <asm/prctl.h> 49#include <asm/prctl.h>
49#include <asm/kdebug.h>
50#include <asm/desc.h> 50#include <asm/desc.h>
51#include <asm/proto.h> 51#include <asm/proto.h>
52#include <asm/ia32.h> 52#include <asm/ia32.h>
diff --git a/arch/x86_64/kernel/reboot.c b/arch/x86_64/kernel/reboot.c
index 2d6769847456..c116b54d422e 100644
--- a/arch/x86_64/kernel/reboot.c
+++ b/arch/x86_64/kernel/reboot.c
@@ -7,8 +7,8 @@
7#include <linux/ctype.h> 7#include <linux/ctype.h>
8#include <linux/string.h> 8#include <linux/string.h>
9#include <linux/pm.h> 9#include <linux/pm.h>
10#include <linux/kdebug.h>
10#include <asm/io.h> 11#include <asm/io.h>
11#include <asm/kdebug.h>
12#include <asm/delay.h> 12#include <asm/delay.h>
13#include <asm/hw_irq.h> 13#include <asm/hw_irq.h>
14#include <asm/system.h> 14#include <asm/system.h>
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index 4d9dacfae575..193af9922c26 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -49,11 +49,11 @@
49#include <linux/delay.h> 49#include <linux/delay.h>
50#include <linux/mc146818rtc.h> 50#include <linux/mc146818rtc.h>
51#include <linux/smp.h> 51#include <linux/smp.h>
52#include <linux/kdebug.h>
52 53
53#include <asm/mtrr.h> 54#include <asm/mtrr.h>
54#include <asm/pgalloc.h> 55#include <asm/pgalloc.h>
55#include <asm/desc.h> 56#include <asm/desc.h>
56#include <asm/kdebug.h>
57#include <asm/tlbflush.h> 57#include <asm/tlbflush.h>
58#include <asm/proto.h> 58#include <asm/proto.h>
59#include <asm/nmi.h> 59#include <asm/nmi.h>
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 0484a2ceac87..8c2ac41187c1 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -32,6 +32,7 @@
32#include <linux/unwind.h> 32#include <linux/unwind.h>
33#include <linux/uaccess.h> 33#include <linux/uaccess.h>
34#include <linux/bug.h> 34#include <linux/bug.h>
35#include <linux/kdebug.h>
35 36
36#include <asm/system.h> 37#include <asm/system.h>
37#include <asm/io.h> 38#include <asm/io.h>
@@ -39,7 +40,6 @@
39#include <asm/debugreg.h> 40#include <asm/debugreg.h>
40#include <asm/desc.h> 41#include <asm/desc.h>
41#include <asm/i387.h> 42#include <asm/i387.h>
42#include <asm/kdebug.h>
43#include <asm/processor.h> 43#include <asm/processor.h>
44#include <asm/unwind.h> 44#include <asm/unwind.h>
45#include <asm/smp.h> 45#include <asm/smp.h>
@@ -71,22 +71,6 @@ asmlinkage void alignment_check(void);
71asmlinkage void machine_check(void); 71asmlinkage void machine_check(void);
72asmlinkage void spurious_interrupt_bug(void); 72asmlinkage void spurious_interrupt_bug(void);
73 73
74ATOMIC_NOTIFIER_HEAD(die_chain);
75EXPORT_SYMBOL(die_chain);
76
77int register_die_notifier(struct notifier_block *nb)
78{
79 vmalloc_sync_all();
80 return atomic_notifier_chain_register(&die_chain, nb);
81}
82EXPORT_SYMBOL(register_die_notifier); /* used modular by kdb */
83
84int unregister_die_notifier(struct notifier_block *nb)
85{
86 return atomic_notifier_chain_unregister(&die_chain, nb);
87}
88EXPORT_SYMBOL(unregister_die_notifier); /* used modular by kdb */
89
90static inline void conditional_sti(struct pt_regs *regs) 74static inline void conditional_sti(struct pt_regs *regs)
91{ 75{
92 if (regs->eflags & X86_EFLAGS_IF) 76 if (regs->eflags & X86_EFLAGS_IF)
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index de99dba2c515..fd6ecc2cee38 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -21,16 +21,17 @@
21#include <linux/tty.h> 21#include <linux/tty.h>
22#include <linux/vt_kern.h> /* For unblank_screen() */ 22#include <linux/vt_kern.h> /* For unblank_screen() */
23#include <linux/compiler.h> 23#include <linux/compiler.h>
24#include <linux/vmalloc.h>
24#include <linux/module.h> 25#include <linux/module.h>
25#include <linux/kprobes.h> 26#include <linux/kprobes.h>
26#include <linux/uaccess.h> 27#include <linux/uaccess.h>
28#include <linux/kdebug.h>
27 29
28#include <asm/system.h> 30#include <asm/system.h>
29#include <asm/pgalloc.h> 31#include <asm/pgalloc.h>
30#include <asm/smp.h> 32#include <asm/smp.h>
31#include <asm/tlbflush.h> 33#include <asm/tlbflush.h>
32#include <asm/proto.h> 34#include <asm/proto.h>
33#include <asm/kdebug.h>
34#include <asm-generic/sections.h> 35#include <asm-generic/sections.h>
35 36
36/* Page fault error code bits */ 37/* Page fault error code bits */