aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel/exceptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/microblaze/kernel/exceptions.c')
-rw-r--r--arch/microblaze/kernel/exceptions.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/microblaze/kernel/exceptions.c b/arch/microblaze/kernel/exceptions.c
index 02cbdfe5aa8d..b98ee8d0c1cd 100644
--- a/arch/microblaze/kernel/exceptions.c
+++ b/arch/microblaze/kernel/exceptions.c
@@ -48,12 +48,17 @@ void die(const char *str, struct pt_regs *fp, long err)
48 do_exit(err); 48 do_exit(err);
49} 49}
50 50
51/* for user application debugging */
52void sw_exception(struct pt_regs *regs)
53{
54 _exception(SIGTRAP, regs, TRAP_BRKPT, regs->r16);
55}
56
51void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) 57void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
52{ 58{
53 siginfo_t info; 59 siginfo_t info;
54 60
55 if (kernel_mode(regs)) { 61 if (kernel_mode(regs)) {
56 debugger(regs);
57 die("Exception in kernel mode", regs, signr); 62 die("Exception in kernel mode", regs, signr);
58 } 63 }
59 info.si_signo = signr; 64 info.si_signo = signr;
@@ -143,7 +148,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
143#ifdef CONFIG_MMU 148#ifdef CONFIG_MMU
144 case MICROBLAZE_PRIVILEGED_EXCEPTION: 149 case MICROBLAZE_PRIVILEGED_EXCEPTION:
145 pr_debug(KERN_WARNING "Privileged exception\n"); 150 pr_debug(KERN_WARNING "Privileged exception\n");
146 /* "brk r0,r0" - used as debug breakpoint */ 151 /* "brk r0,r0" - used as debug breakpoint - old toolchain */
147 if (get_user(code, (unsigned long *)regs->pc) == 0 152 if (get_user(code, (unsigned long *)regs->pc) == 0
148 && code == 0x980c0000) { 153 && code == 0x980c0000) {
149 _exception(SIGTRAP, regs, TRAP_BRKPT, addr); 154 _exception(SIGTRAP, regs, TRAP_BRKPT, addr);