aboutsummaryrefslogtreecommitdiff
path: root/src/rtos/rtos.h
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2021-10-05 10:03:53 -0700
committerGitHub <noreply@github.com>2021-10-05 10:03:53 -0700
commitef3e61bebc53f619f42bb06cfd194cd547cceb69 (patch)
treed703017d0a516d5118c860f0b4c4d54948764ff4 /src/rtos/rtos.h
parentf139080376f5e16fa6666efe6bda4422e462dee0 (diff)
downloadriscv-openocd-ef3e61bebc53f619f42bb06cfd194cd547cceb69.zip
riscv-openocd-ef3e61bebc53f619f42bb06cfd194cd547cceb69.tar.gz
riscv-openocd-ef3e61bebc53f619f42bb06cfd194cd547cceb69.tar.bz2
Dynamically allocate memory for RTOS registers. (#647)
This makes things work on RISC-V cores with large vector registers (which can be up to kilobytes in size). Change-Id: Ie53cb43a88e2a475f695cd5c1e28605569926817 Signed-off-by: Tim Newsome <tim@sifive.com>
Diffstat (limited to 'src/rtos/rtos.h')
-rw-r--r--src/rtos/rtos.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rtos/rtos.h b/src/rtos/rtos.h
index bf0cdc5..641bdf2 100644
--- a/src/rtos/rtos.h
+++ b/src/rtos/rtos.h
@@ -68,6 +68,8 @@ struct rtos_reg {
uint32_t number;
uint32_t size;
uint8_t value[16];
+ /* WARNING: rtos_get_gdb_reg() relies on the fact that value is the last
+ * element of this struct. Any new fields should be added *before* value. */
};
struct rtos_type {
@@ -79,8 +81,10 @@ struct rtos_type {
/** Return a list of general registers, with their values filled out. */
int (*get_thread_reg_list)(struct rtos *rtos, threadid_t thread_id,
struct rtos_reg **reg_list, int *num_regs);
- int (*get_thread_reg)(struct rtos *rtos, threadid_t thread_id,
- uint32_t reg_num, struct rtos_reg *reg);
+ /** Return the size and value of the specified reg_num. The value is
+ * allocated by the callee and freed by the caller. */
+ int (*get_thread_reg_value)(struct rtos *rtos, threadid_t thread_id,
+ uint32_t reg_num, uint32_t *size, uint8_t **value);
int (*get_symbol_list_to_lookup)(struct symbol_table_elem *symbol_list[]);
int (*clean)(struct target *target);
char * (*ps_command)(struct target *target);