aboutsummaryrefslogtreecommitdiff
path: root/src/rtos/rtos.h
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2020-03-26 09:46:32 -0700
committerGitHub <noreply@github.com>2020-03-26 09:46:32 -0700
commit60eccb29677560e58a3133ec43c7185892024316 (patch)
tree3cb43c9e88fc5f380899c03db5138b0f6816cd8b /src/rtos/rtos.h
parent5b2426a4b2c3d0eb244bb8ec276ef24228e9e31d (diff)
downloadriscv-openocd-60eccb29677560e58a3133ec43c7185892024316.zip
riscv-openocd-60eccb29677560e58a3133ec43c7185892024316.tar.gz
riscv-openocd-60eccb29677560e58a3133ec43c7185892024316.tar.bz2
Use the correct thread for memory accesses. (#459)
* Deal with vlenb being unreadable. Instead of exiting during examine(), spit out a warning, and don't expose the vector data registers. We do provide access to the vector CSRs, because maybe they do work? It's just that we have no idea what the size of the data registers is. Change-Id: I6e9ffeb242e2e22fc62cb1b50782c2efb4ace0bd * WIP Change-Id: I46292eefe537aeaf72bdd44e4aa58298b5120b00 * Use the correct thread for memory accesses. Previously, OpenOCD would perform RTOS memory accesses through the first thread in the RTOS. This doesn't work if different threads have a different memory view. For instance if `-rtos hwthread` is used, each configured core could have address translation configured differently. Change-Id: I61328c8f50065ecba5ce1797dbeaee482812f799
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 d0c2050..ee9d4d4 100644
--- a/src/rtos/rtos.h
+++ b/src/rtos/rtos.h
@@ -90,6 +90,13 @@ struct rtos_type {
* target running a multi-threading OS. If an RTOS can do this, override
* needs_fake_step(). */
bool (*needs_fake_step)(struct target *target, int64_t thread_id);
+ /* 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 {
@@ -136,5 +143,9 @@ int rtos_smp_init(struct target *target);
/* function for handling symbol access */
int rtos_qsymbol(struct connection *connection, char const *packet, int packet_size);
bool rtos_needs_fake_step(struct target *target, int64_t thread_id);
+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 */