Select current hart before accessing vector regs. (#574)
I don't know how this worked before. Possibly caused by overzealous removal of `-rtos riscv`. Change-Id: I7259267b861ef45655f469ab39cc463d608fe149 Signed-off-by: Tim Newsome <tim@sifive.com>
This commit is contained in:
parent
6628394c2c
commit
8980c2038a
|
@ -1945,6 +1945,9 @@ static int riscv013_get_register_buf(struct target *target,
|
||||||
{
|
{
|
||||||
assert(regno >= GDB_REGNO_V0 && regno <= GDB_REGNO_V31);
|
assert(regno >= GDB_REGNO_V0 && regno <= GDB_REGNO_V31);
|
||||||
|
|
||||||
|
if (riscv_select_current_hart(target) != ERROR_OK)
|
||||||
|
return ERROR_FAIL;
|
||||||
|
|
||||||
riscv_reg_t s0;
|
riscv_reg_t s0;
|
||||||
if (register_read(target, &s0, GDB_REGNO_S0) != ERROR_OK)
|
if (register_read(target, &s0, GDB_REGNO_S0) != ERROR_OK)
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
|
@ -2001,6 +2004,9 @@ static int riscv013_set_register_buf(struct target *target,
|
||||||
{
|
{
|
||||||
assert(regno >= GDB_REGNO_V0 && regno <= GDB_REGNO_V31);
|
assert(regno >= GDB_REGNO_V0 && regno <= GDB_REGNO_V31);
|
||||||
|
|
||||||
|
if (riscv_select_current_hart(target) != ERROR_OK)
|
||||||
|
return ERROR_FAIL;
|
||||||
|
|
||||||
riscv_reg_t s0;
|
riscv_reg_t s0;
|
||||||
if (register_read(target, &s0, GDB_REGNO_S0) != ERROR_OK)
|
if (register_read(target, &s0, GDB_REGNO_S0) != ERROR_OK)
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
|
@ -4033,7 +4039,8 @@ static int riscv013_get_register(struct target *target,
|
||||||
LOG_DEBUG("[%s] reading register %s", target_name(target),
|
LOG_DEBUG("[%s] reading register %s", target_name(target),
|
||||||
gdb_regno_name(rid));
|
gdb_regno_name(rid));
|
||||||
|
|
||||||
riscv_select_current_hart(target);
|
if (riscv_select_current_hart(target) != ERROR_OK)
|
||||||
|
return ERROR_FAIL;
|
||||||
|
|
||||||
int result = ERROR_OK;
|
int result = ERROR_OK;
|
||||||
if (rid == GDB_REGNO_PC) {
|
if (rid == GDB_REGNO_PC) {
|
||||||
|
|
Loading…
Reference in New Issue