diff options
| -rw-r--r-- | arch/sh/kernel/process.c | 6 | ||||
| -rw-r--r-- | arch/sh/kernel/traps.c | 16 | ||||
| -rw-r--r-- | arch/sh/mm/fault.c | 2 | ||||
| -rw-r--r-- | include/asm-sh/kdebug.h | 25 |
4 files changed, 7 insertions, 42 deletions
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index 9005b2f12aaa..d755589ba8b1 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #include <linux/pm.h> | 15 | #include <linux/pm.h> |
| 16 | #include <linux/kallsyms.h> | 16 | #include <linux/kallsyms.h> |
| 17 | #include <linux/kexec.h> | 17 | #include <linux/kexec.h> |
| 18 | #include <asm/kdebug.h> | 18 | #include <linux/kdebug.h> |
| 19 | #include <asm/uaccess.h> | 19 | #include <asm/uaccess.h> |
| 20 | #include <asm/mmu_context.h> | 20 | #include <asm/mmu_context.h> |
| 21 | #include <asm/pgalloc.h> | 21 | #include <asm/pgalloc.h> |
| @@ -500,7 +500,7 @@ asmlinkage void debug_trap_handler(unsigned long r4, unsigned long r5, | |||
| 500 | /* Rewind */ | 500 | /* Rewind */ |
| 501 | regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); | 501 | regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); |
| 502 | 502 | ||
| 503 | if (notify_die(DIE_TRAP, regs, regs->tra & 0xff, | 503 | if (notify_die(DIE_TRAP, "debug trap", regs, 0, regs->tra & 0xff, |
| 504 | SIGTRAP) == NOTIFY_STOP) | 504 | SIGTRAP) == NOTIFY_STOP) |
| 505 | return; | 505 | return; |
| 506 | 506 | ||
| @@ -519,7 +519,7 @@ asmlinkage void bug_trap_handler(unsigned long r4, unsigned long r5, | |||
| 519 | /* Rewind */ | 519 | /* Rewind */ |
| 520 | regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); | 520 | regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); |
| 521 | 521 | ||
| 522 | if (notify_die(DIE_TRAP, regs, TRAPA_BUG_OPCODE & 0xff, | 522 | if (notify_die(DIE_TRAP, "bug trap", regs, 0, TRAPA_BUG_OPCODE & 0xff, |
| 523 | SIGTRAP) == NOTIFY_STOP) | 523 | SIGTRAP) == NOTIFY_STOP) |
| 524 | return; | 524 | return; |
| 525 | 525 | ||
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c index 1446d12ba220..3a197649cd83 100644 --- a/arch/sh/kernel/traps.c +++ b/arch/sh/kernel/traps.c | |||
| @@ -20,10 +20,10 @@ | |||
| 20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
| 21 | #include <linux/bug.h> | 21 | #include <linux/bug.h> |
| 22 | #include <linux/debug_locks.h> | 22 | #include <linux/debug_locks.h> |
| 23 | #include <linux/kdebug.h> | ||
| 23 | #include <linux/limits.h> | 24 | #include <linux/limits.h> |
| 24 | #include <asm/system.h> | 25 | #include <asm/system.h> |
| 25 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> |
| 26 | #include <asm/kdebug.h> | ||
| 27 | 27 | ||
| 28 | #ifdef CONFIG_SH_KGDB | 28 | #ifdef CONFIG_SH_KGDB |
| 29 | #include <asm/kgdb.h> | 29 | #include <asm/kgdb.h> |
| @@ -76,20 +76,6 @@ static void dump_mem(const char *str, unsigned long bottom, unsigned long top) | |||
| 76 | } | 76 | } |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | ATOMIC_NOTIFIER_HEAD(shdie_chain); | ||
| 80 | |||
| 81 | int register_die_notifier(struct notifier_block *nb) | ||
| 82 | { | ||
| 83 | return atomic_notifier_chain_register(&shdie_chain, nb); | ||
| 84 | } | ||
| 85 | EXPORT_SYMBOL(register_die_notifier); | ||
| 86 | |||
| 87 | int unregister_die_notifier(struct notifier_block *nb) | ||
| 88 | { | ||
| 89 | return atomic_notifier_chain_unregister(&shdie_chain, nb); | ||
| 90 | } | ||
| 91 | EXPORT_SYMBOL(unregister_die_notifier); | ||
| 92 | |||
| 93 | static DEFINE_SPINLOCK(die_lock); | 79 | static DEFINE_SPINLOCK(die_lock); |
| 94 | 80 | ||
| 95 | void die(const char * str, struct pt_regs * regs, long err) | 81 | void die(const char * str, struct pt_regs * regs, long err) |
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index 0ecc117cade4..9207da67ff8a 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
| 16 | #include <linux/hardirq.h> | 16 | #include <linux/hardirq.h> |
| 17 | #include <linux/kprobes.h> | 17 | #include <linux/kprobes.h> |
| 18 | #include <asm/kdebug.h> | 18 | #include <linux/kdebug.h> |
| 19 | #include <asm/system.h> | 19 | #include <asm/system.h> |
| 20 | #include <asm/mmu_context.h> | 20 | #include <asm/mmu_context.h> |
| 21 | #include <asm/tlbflush.h> | 21 | #include <asm/tlbflush.h> |
diff --git a/include/asm-sh/kdebug.h b/include/asm-sh/kdebug.h index 493c20629747..16578b7c9da1 100644 --- a/include/asm-sh/kdebug.h +++ b/include/asm-sh/kdebug.h | |||
| @@ -2,20 +2,6 @@ | |||
| 2 | #define __ASM_SH_KDEBUG_H | 2 | #define __ASM_SH_KDEBUG_H |
| 3 | 3 | ||
| 4 | #include <linux/notifier.h> | 4 | #include <linux/notifier.h> |
| 5 | #include <asm-generic/kdebug.h> | ||
| 6 | |||
| 7 | struct pt_regs; | ||
| 8 | |||
| 9 | struct die_args { | ||
| 10 | struct pt_regs *regs; | ||
| 11 | int trapnr; | ||
| 12 | }; | ||
| 13 | |||
| 14 | int register_die_notifier(struct notifier_block *nb); | ||
| 15 | int unregister_die_notifier(struct notifier_block *nb); | ||
| 16 | int register_page_fault_notifier(struct notifier_block *nb); | ||
| 17 | int unregister_page_fault_notifier(struct notifier_block *nb); | ||
| 18 | extern struct atomic_notifier_head shdie_chain; | ||
| 19 | 5 | ||
| 20 | /* Grossly misnamed. */ | 6 | /* Grossly misnamed. */ |
| 21 | enum die_val { | 7 | enum die_val { |
| @@ -23,14 +9,7 @@ enum die_val { | |||
| 23 | DIE_PAGE_FAULT, | 9 | DIE_PAGE_FAULT, |
| 24 | }; | 10 | }; |
| 25 | 11 | ||
| 26 | static inline int notify_die(enum die_val val, struct pt_regs *regs, | 12 | int register_page_fault_notifier(struct notifier_block *nb); |
| 27 | int trap, int sig) | 13 | int unregister_page_fault_notifier(struct notifier_block *nb); |
| 28 | { | ||
| 29 | struct die_args args = { | ||
| 30 | .regs = regs, | ||
| 31 | .trapnr = trap, | ||
| 32 | }; | ||
| 33 | 14 | ||
| 34 | return atomic_notifier_call_chain(&shdie_chain, val, &args); | ||
| 35 | } | ||
| 36 | #endif /* __ASM_SH_KDEBUG_H */ | 15 | #endif /* __ASM_SH_KDEBUG_H */ |
