aboutsummaryrefslogtreecommitdiff
path: root/src/rtos/rtos.h
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2019-01-17 12:46:20 -0800
committerTim Newsome <tim@sifive.com>2019-01-17 15:01:47 -0800
commitc1ef5f61c3b9b59e1a410badb90e485a98cdedb4 (patch)
treeed07a251ef180897bcf5e2890f212e7fb43f986c /src/rtos/rtos.h
parentc84d56debcc3b7263bc66234164e249b9b1ad737 (diff)
downloadriscv-openocd-c1ef5f61c3b9b59e1a410badb90e485a98cdedb4.zip
riscv-openocd-c1ef5f61c3b9b59e1a410badb90e485a98cdedb4.tar.gz
riscv-openocd-c1ef5f61c3b9b59e1a410badb90e485a98cdedb4.tar.bz2
Fix reading of non-general registers for hwthread
Previously the code made the assumption (which is valid for conventional RTOSs) that special registers (e.g. CSRs) are the same across threads. 26/45 tests pass. Change-Id: Ibb3398790d7354a995d506772375d869f608f1f0
Diffstat (limited to 'src/rtos/rtos.h')
-rw-r--r--src/rtos/rtos.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rtos/rtos.h b/src/rtos/rtos.h
index 8574b4a..e5a7e13 100644
--- a/src/rtos/rtos.h
+++ b/src/rtos/rtos.h
@@ -20,6 +20,7 @@
#define OPENOCD_RTOS_RTOS_H
#include "server/server.h"
+#include "target/target.h"
#include <jim-nvp.h>
typedef int64_t threadid_t;
@@ -71,11 +72,15 @@ struct rtos_type {
int (*create)(struct target *target);
int (*smp_init)(struct target *target);
int (*update_threads)(struct rtos *rtos);
+ /** Return a list of general registers, with their values filled out. */
int (*get_thread_reg_list)(struct rtos *rtos, int64_t thread_id,
struct rtos_reg **reg_list, int *num_regs);
+ int (*get_thread_reg)(struct rtos *rtos, int64_t thread_id,
+ uint32_t reg_num, struct rtos_reg *reg);
int (*get_symbol_list_to_lookup)(symbol_table_elem_t *symbol_list[]);
int (*clean)(struct target *target);
char * (*ps_command)(struct target *target);
+ // TODO: int or uint32_t for reg_num?
int (*set_reg)(struct rtos *rtos, int reg_num, uint8_t *reg_value);
};