summaryrefslogtreecommitdiffstats
path: root/arch/openrisc/kernel
diff options
context:
space:
mode:
authorStafford Horne <shorne@gmail.com>2020-10-17 23:37:01 +0200
committerStafford Horne <shorne@gmail.com>2020-11-11 22:32:20 +0100
commit28b852b1dc351efc6525234c5adfd5bc2ad6d6e1 (patch)
tree31cdaed08f97454cf958da7b8335e9bb9426a240 /arch/openrisc/kernel
parentopenrisc: add support for LiteX (diff)
downloadlinux-28b852b1dc351efc6525234c5adfd5bc2ad6d6e1.tar.xz
linux-28b852b1dc351efc6525234c5adfd5bc2ad6d6e1.zip
openrisc: fix trap for debugger breakpoint signalling
I have been working on getting native Linux GDB support working for the OpenRISC port. The trap signal handler here was wrong in a few ways. During trap handling address (from the EEAR register) is not set by the CPU, so it is not correct to use here. We want to use trap as a break-point so use TRAP_BRKPT. Adding 4 to the pc was incorrect and causing GDB to think the breakpoint was not hit. Fixing these allows GDB to work now. Signed-off-by: Stafford Horne <shorne@gmail.com>
Diffstat (limited to 'arch/openrisc/kernel')
-rw-r--r--arch/openrisc/kernel/traps.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/openrisc/kernel/traps.c b/arch/openrisc/kernel/traps.c
index 206e5325e61b..4d61333c2623 100644
--- a/arch/openrisc/kernel/traps.c
+++ b/arch/openrisc/kernel/traps.c
@@ -238,9 +238,7 @@ void __init trap_init(void)
asmlinkage void do_trap(struct pt_regs *regs, unsigned long address)
{
- force_sig_fault(SIGTRAP, TRAP_TRACE, (void __user *)address);
-
- regs->pc += 4;
+ force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc);
}
asmlinkage void do_unaligned_access(struct pt_regs *regs, unsigned long address)