diff options
author | Michal Simek <monstr@monstr.eu> | 2010-08-03 13:26:51 +0400 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2010-08-04 12:45:16 +0400 |
commit | 751f1605e03533a6279ccf456e938e9595c7d888 (patch) | |
tree | 1bff483f2d0f1151c5794d409c00e1c5293656b4 /arch/microblaze/kernel/exceptions.c | |
parent | 958063e67b775bc1be85eb3761c85202597a87aa (diff) | |
download | linux-751f1605e03533a6279ccf456e938e9595c7d888.tar.xz |
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 <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/kernel/exceptions.c')
-rw-r--r-- | arch/microblaze/kernel/exceptions.c | 8 |
1 files changed, 7 insertions, 1 deletions
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); |