diff options
author | Vincent Chen <vincent.chen@sifive.com> | 2020-04-16 05:38:05 +0300 |
---|---|---|
committer | Palmer Dabbelt <palmerdabbelt@google.com> | 2020-05-18 21:38:10 +0300 |
commit | fe89bd2be8667d4d876329dd534dd59158e33b1f (patch) | |
tree | 10a9128ca4f1c4772ce114d88160b499f018a11a /arch/riscv/kernel/traps.c | |
parent | f83b04d36e52cc3d941120ec859374fcda36eb31 (diff) | |
download | linux-fe89bd2be8667d4d876329dd534dd59158e33b1f.tar.xz |
riscv: Add KGDB support
The skeleton of RISC-V KGDB port.
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/kernel/traps.c')
-rw-r--r-- | arch/riscv/kernel/traps.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index 7f58fa53033f..5080fdf8c296 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -147,6 +147,11 @@ asmlinkage __visible void do_trap_break(struct pt_regs *regs) { if (user_mode(regs)) force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->epc); +#ifdef CONFIG_KGDB + else if (notify_die(DIE_TRAP, "EBREAK", regs, 0, regs->cause, SIGTRAP) + == NOTIFY_STOP) + return; +#endif else if (report_bug(regs->epc, regs) == BUG_TRAP_TYPE_WARN) regs->epc += get_break_insn_length(regs->epc); else |