summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2021-04-09 10:48:14 +0000
committerLeo Yu-Chi Liang <ycliang@andestech.com>2021-05-05 16:13:12 +0800
commit91e4b7516d84cefab7324765b3c8d6a909185ce2 (patch)
tree445e39aed11bcfee455d7cd0d1bcd3cae822e7ed /cmd
parent1412b8d48a920f1a4f5eac256814d25c320fb9b6 (diff)
downloadu-boot-91e4b7516d84cefab7324765b3c8d6a909185ce2.tar.gz
u-boot-91e4b7516d84cefab7324765b3c8d6a909185ce2.tar.xz
u-boot-91e4b7516d84cefab7324765b3c8d6a909185ce2.zip
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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/riscv/exception.c b/cmd/riscv/exception.c
index 9687cec812..7a08061d12 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"
;