From 751f1605e03533a6279ccf456e938e9595c7d888 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 3 Aug 2010 11:26:51 +0200 Subject: microblaze: Support brki rX, 0x18 for user application debugging This is the first patch which add support for user application debugging through brki rX, 0x18 vector. This patch has side effect which also remove security issue to use brki rX, 0x18 to freeze kernel. Support for old gdb support via priviledged exception (brk r0, r0) is still there. It will be remove in future. Signed-off-by: Michal Simek --- arch/microblaze/kernel/exceptions.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'arch/microblaze/kernel/exceptions.c') diff --git a/arch/microblaze/kernel/exceptions.c b/arch/microblaze/kernel/exceptions.c index 02cbdfe5aa8d..e0c6f8c2bd9d 100644 --- a/arch/microblaze/kernel/exceptions.c +++ b/arch/microblaze/kernel/exceptions.c @@ -48,6 +48,12 @@ void die(const char *str, struct pt_regs *fp, long err) do_exit(err); } +/* for user application debugging */ +void sw_exception(struct pt_regs *regs) +{ + _exception(SIGTRAP, regs, TRAP_BRKPT, regs->r16); +} + void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) { siginfo_t info; @@ -143,7 +149,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, #ifdef CONFIG_MMU case MICROBLAZE_PRIVILEGED_EXCEPTION: pr_debug(KERN_WARNING "Privileged exception\n"); - /* "brk r0,r0" - used as debug breakpoint */ + /* "brk r0,r0" - used as debug breakpoint - old toolchain */ if (get_user(code, (unsigned long *)regs->pc) == 0 && code == 0x980c0000) { _exception(SIGTRAP, regs, TRAP_BRKPT, addr); -- cgit v1.2.3