diff options
author | Heinrich Schuchardt | 2021-04-09 10:48:14 +0000 |
---|---|---|
committer | Leo Yu-Chi Liang | 2021-05-05 16:13:12 +0800 |
commit | 91e4b7516d84cefab7324765b3c8d6a909185ce2 (patch) | |
tree | 445e39aed11bcfee455d7cd0d1bcd3cae822e7ed /cmd | |
parent | 1412b8d48a920f1a4f5eac256814d25c320fb9b6 (diff) |
cmd/exception: support ebreak exception on RISC-V
The ebreak instruction should generate a breakpoint exception.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/riscv/exception.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/riscv/exception.c b/cmd/riscv/exception.c index 9687cec8120..7a08061d120 100644 --- a/cmd/riscv/exception.c +++ b/cmd/riscv/exception.c @@ -8,6 +8,13 @@ #include <common.h> #include <command.h> +static int do_ebreak(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + asm volatile ("ebreak\n"); + return CMD_RET_FAILURE; +} + static int do_unaligned(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { @@ -28,6 +35,8 @@ static int do_undefined(struct cmd_tbl *cmdtp, int flag, int argc, } static struct cmd_tbl cmd_sub[] = { + U_BOOT_CMD_MKENT(ebreak, CONFIG_SYS_MAXARGS, 1, do_ebreak, + "", ""), U_BOOT_CMD_MKENT(unaligned, CONFIG_SYS_MAXARGS, 1, do_unaligned, "", ""), U_BOOT_CMD_MKENT(undefined, CONFIG_SYS_MAXARGS, 1, do_undefined, @@ -37,6 +46,7 @@ static struct cmd_tbl cmd_sub[] = { static char exception_help_text[] = "<ex>\n" " The following exceptions are available:\n" + " ebreak - breakpoint\n" " undefined - illegal instruction\n" " unaligned - load address misaligned\n" ; |