aboutsummaryrefslogtreecommitdiff
path: root/src/rtos/rtos.h
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2021-06-21 14:37:41 -0700
committerAntonio Borneo <borneo.antonio@gmail.com>2021-07-02 17:13:52 +0100
commit6ad89d61af681e11960082a906357d8e8c3396a1 (patch)
treea1416e9908ab54f5c510000846d06bd2340f4adc /src/rtos/rtos.h
parentc8e643fd9f09849b341942d11866ab45bc7c99a3 (diff)
downloadriscv-openocd-6ad89d61af681e11960082a906357d8e8c3396a1.zip
riscv-openocd-6ad89d61af681e11960082a906357d8e8c3396a1.tar.gz
riscv-openocd-6ad89d61af681e11960082a906357d8e8c3396a1.tar.bz2
Add RTOS memory read/write functions.
If not implemented, these specify to regular target read/write. However, if individual threads in an RTOS can have different address translation configured then the RTOS support can use this to do the right thing. Use this in hwthread, where of course address translation can be set up differently for different real cores. Change-Id: I62c501cff1f863d855ee197dee7b73204ea8885a Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: http://openocd.zylin.com/6327 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de> Reviewed-by: Jan Matyas <matyas@codasip.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/rtos/rtos.h')
-rw-r--r--src/rtos/rtos.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rtos/rtos.h b/src/rtos/rtos.h
index 20f7de7..81751fe 100644
--- a/src/rtos/rtos.h
+++ b/src/rtos/rtos.h
@@ -82,6 +82,13 @@ struct rtos_type {
int (*clean)(struct target *target);
char * (*ps_command)(struct target *target);
int (*set_reg)(struct rtos *rtos, uint32_t reg_num, uint8_t *reg_value);
+ /* Implement these if different threads in the RTOS can see memory
+ * differently (for instance because address translation might be different
+ * for each thread). */
+ int (*read_buffer)(struct rtos *rtos, target_addr_t address, uint32_t size,
+ uint8_t *buffer);
+ int (*write_buffer)(struct rtos *rtos, target_addr_t address, uint32_t size,
+ const uint8_t *buffer);
};
struct stack_register_offset {
@@ -127,5 +134,9 @@ void rtos_free_threadlist(struct rtos *rtos);
int rtos_smp_init(struct target *target);
/* function for handling symbol access */
int rtos_qsymbol(struct connection *connection, char const *packet, int packet_size);
+int rtos_read_buffer(struct target *target, target_addr_t address,
+ uint32_t size, uint8_t *buffer);
+int rtos_write_buffer(struct target *target, target_addr_t address,
+ uint32_t size, const uint8_t *buffer);
#endif /* OPENOCD_RTOS_RTOS_H */