This is an automated email from Gerrit. "Antonio Borneo <[email protected]>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9760
-- gerrit commit 63ce1ec8b3b226edba2dcf55756d6e358e4b1a73 Author: Zane Leung <[email protected]> Date: Mon Jun 29 15:07:37 2026 +0200 riscv: introduce dtm file Add the files riscv_dtm.c and riscv_dtm.h Populate them with initial helpers. Add the empty struct dtm_private_config to the existing struct riscv_private_config. Change-Id: I812ccdf93cfa1d6947c73838556d4c028302259f Signed-off-by: Zane Leung <[email protected]> Signed-off-by: Antonio Borneo <[email protected]> diff --git a/src/target/riscv/Makefile.am b/src/target/riscv/Makefile.am index 189edb3e6e..af66f54a13 100644 --- a/src/target/riscv/Makefile.am +++ b/src/target/riscv/Makefile.am @@ -11,6 +11,7 @@ noinst_LTLIBRARIES += %D%/libriscv.la %D%/opcodes.h \ %D%/program.h \ %D%/riscv.h \ + %D%/riscv_dtm.h \ %D%/riscv_reg_impl.h \ %D%/riscv_reg.h \ %D%/riscv-011.h \ @@ -24,6 +25,7 @@ noinst_LTLIBRARIES += %D%/libriscv.la %D%/riscv-013.c \ %D%/riscv-013_reg.c \ %D%/riscv.c \ + %D%/riscv_dtm.c \ %D%/riscv_reg.c \ %D%/riscv_semihosting.c \ %D%/debug_defines.c \ diff --git a/src/target/riscv/riscv.h b/src/target/riscv/riscv.h index 2a0a9b95f0..4ae0ba851c 100644 --- a/src/target/riscv/riscv.h +++ b/src/target/riscv/riscv.h @@ -12,6 +12,7 @@ struct riscv_program; #include "target/semihosting_common.h" #include "target/target.h" #include "target/register.h" +#include "riscv_dtm.h" #include <helper/command.h> #include <helper/bits.h> @@ -378,6 +379,7 @@ enum riscv_priv_mode { struct riscv_private_config { bool dcsr_ebreak_fields[N_RISCV_MODE]; + struct dtm_private_config dtm_pc; }; static inline struct riscv_private_config diff --git a/src/target/riscv/riscv_dtm.c b/src/target/riscv/riscv_dtm.c new file mode 100644 index 0000000000..f7400e0f2b --- /dev/null +++ b/src/target/riscv/riscv_dtm.c @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "riscv_dtm.h" +#include "riscv.h" + +struct dtm_private_config *dtm_private_config(const struct target *target) +{ + struct riscv_private_config *config = riscv_private_config(target); + return &config->dtm_pc; +} + +struct riscv_dtm *target_to_dtm(const struct target *target) +{ + struct dtm_private_config *dtm_pc = dtm_private_config(target); + return &dtm_pc->dtm; +} diff --git a/src/target/riscv/riscv_dtm.h b/src/target/riscv/riscv_dtm.h new file mode 100644 index 0000000000..706a608e01 --- /dev/null +++ b/src/target/riscv/riscv_dtm.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef OPENOCD_TARGET_RISCV_DTM_H +#define OPENOCD_TARGET_RISCV_DTM_H + +struct target; + +/* This represents an RISC-V Debug Transport Module (DTM) */ +struct riscv_dtm { +}; + +struct riscv_dtm *target_to_dtm(const struct target *target); + +struct dtm_private_config { + struct riscv_dtm dtm; +}; + +struct dtm_private_config *dtm_private_config(const struct target *target); + +#endif /* OPENOCD_TARGET_RISCV_DTM_H */ --
