From 8022a315a60d883a12126b6ee2848261ed74f4df Mon Sep 17 00:00:00 2001 From: Liviu Ionescu Date: Tue, 12 Jun 2018 23:54:41 +0300 Subject: [PATCH] target/riscv: explain why `arm` commands are used --- src/target/riscv/riscv.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 98ddc0416..576a4c738 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -1529,6 +1529,19 @@ extern __COMMAND_HANDLER(handle_common_semihosting_fileio_command); extern __COMMAND_HANDLER(handle_common_semihosting_resumable_exit_command); extern __COMMAND_HANDLER(handle_common_semihosting_cmdline); +/* + * To be noted that RISC-V targets use the same semihosting commands as + * ARM targets. + * + * The main reason is compatibility with existing tools. For example the + * Eclipse OpenOCD/SEGGER J-Link/QEMU plug-ins have several widgets to + * configure semihosting, which generate commands like `arm semihosting + * enable`. + * A secondary reason is the fact that the protocol used is exactly the + * one specified by ARM. If RISC-V will ever define its own semihosting + * protocol, then a command like `riscv semihosting enable` will make + * sense, but for now all semihosting commands are prefixed with `arm`. + */ static const struct command_registration arm_exec_command_handlers[] = { { "semihosting",