aboutsummaryrefslogtreecommitdiff
path: root/src/target/target.c
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2019-02-07 13:24:44 -0800
committerGitHub <noreply@github.com>2019-02-07 13:24:44 -0800
commit80ef54dba2411f9354b3793d5832c5d8ad871b4b (patch)
treefe87df92901717b29c556b09d1bbacbdb2ce8bf4 /src/target/target.c
parentc554246177bb8b2b03ca584847c4ffc2b2f7bb4b (diff)
downloadriscv-openocd-80ef54dba2411f9354b3793d5832c5d8ad871b4b.zip
riscv-openocd-80ef54dba2411f9354b3793d5832c5d8ad871b4b.tar.gz
riscv-openocd-80ef54dba2411f9354b3793d5832c5d8ad871b4b.tar.bz2
Rtos riscv (#350)
* Implement riscv_get_thread_reg(). This is necessary because riscv_get_gdb_reg_list() now reads all registers, which ended up causing `-rtos riscv` to read all registers whenever one was requested (because the register cache is wiped every time we switch to a different hart). CustomRegisterTest went from 1329s to 106s. Change-Id: I8e9918b7a532d44bca927f67aae5ac34954a8d32 * Also implement riscv_set_reg(). Now all the `-rtos riscv` tests pass again, at regular speed. Change-Id: I55164224672d9dcc9eb4d1184b47258ff3c2cff1 * Better error messages. Change-Id: I4125f9a54750d9d0ee22c4fa84b9dd3f5af203f5 * Add target_get_gdb_reg_list_noread(). Being explicit about what's expected gets `-rtos riscv` back to `-rtos hwthread` time. Change-Id: I6e57390c2fe79b5e6799bfda980d89697e2e29f7 * Revert a change I made that has no effect. I don't understand exactly what all this test protects against, and I shouldn't change it unless I do. Change-Id: Ib329d4e34d65d2b38559b89b7afb3678f439ad2c
Diffstat (limited to 'src/target/target.c')
-rw-r--r--src/target/target.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/target/target.c b/src/target/target.c
index ffd82fb..bc7cba6 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -1223,6 +1223,17 @@ int target_get_gdb_reg_list(struct target *target,
return target->type->get_gdb_reg_list(target, reg_list, reg_list_size, reg_class);
}
+int target_get_gdb_reg_list_noread(struct target *target,
+ struct reg **reg_list[], int *reg_list_size,
+ enum target_register_class reg_class)
+{
+ if (target->type->get_gdb_reg_list_noread &&
+ target->type->get_gdb_reg_list_noread(target, reg_list,
+ reg_list_size, reg_class) == ERROR_OK)
+ return ERROR_OK;
+ return target_get_gdb_reg_list(target, reg_list, reg_list_size, reg_class);
+}
+
bool target_supports_gdb_connection(struct target *target)
{
/*