aboutsummaryrefslogtreecommitdiff
path: root/src/target/semihosting_common.h
diff options
context:
space:
mode:
authorZoltán Dudás <zedudi@gmail.com>2021-11-24 17:13:50 +0100
committerAntonio Borneo <borneo.antonio@gmail.com>2022-02-05 21:40:17 +0000
commit5ab74bde06541ce199390ead348a3e107ee9c0f4 (patch)
tree416f5c7be1369187ab65d16bd6ce0342bc13b102 /src/target/semihosting_common.h
parentdbbac5f11d662ab0827a997aa5d173fd62c51708 (diff)
downloadriscv-openocd-5ab74bde06541ce199390ead348a3e107ee9c0f4.zip
riscv-openocd-5ab74bde06541ce199390ead348a3e107ee9c0f4.tar.gz
riscv-openocd-5ab74bde06541ce199390ead348a3e107ee9c0f4.tar.bz2
semihosting: User defined operation, Tcl command exec on host
Enabling a portion (0x100 - 0x107) of the user defined semihosting operation number range (0x100 - 0x1FF) to be processed with the help of the existing target event mechanism, to implement a general-purpose Tcl interface for the target available on the host, via semihosting interface. Example usage: - The user configures a Tcl command as a callback for one of the newly defined events (semihosting-user-cmd-0x10X) in the configuration file. - The target can make a semihosting call with <opnum>, passing optional parameters for the call. If there is no callback registered to the user defined operation number, nothing happens. Example usage: Configure RTT automatically with the exact, linked control block location from target. Signed-off-by: Zoltán Dudás <zedudi@gmail.com> Change-Id: I10e1784b1fecd4e630d78df81cb44bf1aa2fc247 Reviewed-on: https://review.openocd.org/c/openocd/+/6748 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/target/semihosting_common.h')
-rw-r--r--src/target/semihosting_common.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/target/semihosting_common.h b/src/target/semihosting_common.h
index b83464e..6eb9ca2 100644
--- a/src/target/semihosting_common.h
+++ b/src/target/semihosting_common.h
@@ -75,8 +75,14 @@ enum semihosting_operation_numbers {
SEMIHOSTING_SYS_WRITE = 0x05,
SEMIHOSTING_SYS_WRITEC = 0x03,
SEMIHOSTING_SYS_WRITE0 = 0x04,
+ SEMIHOSTING_USER_CMD_0x100 = 0x100, /* First user cmd op code */
+ SEMIHOSTING_USER_CMD_0x107 = 0x107, /* Last supported user cmd op code */
+ SEMIHOSTING_USER_CMD_0x1FF = 0x1FF, /* Last user cmd op code */
};
+/** Maximum allowed Tcl command segment length in bytes*/
+#define SEMIHOSTING_MAX_TCL_COMMAND_FIELD_LENGTH (1024 * 1024)
+
/*
* Codes used by SEMIHOSTING_SYS_EXIT (formerly
* SEMIHOSTING_REPORT_EXCEPTION).