diff options
author | Tim Newsome <tim@sifive.com> | 2021-06-21 14:37:41 -0700 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2021-07-02 17:13:52 +0100 |
commit | 6ad89d61af681e11960082a906357d8e8c3396a1 (patch) | |
tree | a1416e9908ab54f5c510000846d06bd2340f4adc /src/rtos/rtos.h | |
parent | c8e643fd9f09849b341942d11866ab45bc7c99a3 (diff) | |
download | riscv-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.h | 11 |
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 */ |