No longer hard-code the non-RTOS hart to 0

I was just being lazy here.
autoconf
Palmer Dabbelt 2017-06-20 17:17:54 -07:00
parent 4bdb042224
commit 689d0fcaf6
1 changed files with 4 additions and 3 deletions

View File

@ -448,11 +448,12 @@ static int riscv_get_gdb_reg_list(struct target *target,
{ {
RISCV_INFO(r); RISCV_INFO(r);
LOG_DEBUG("reg_class=%d", reg_class); LOG_DEBUG("reg_class=%d", reg_class);
LOG_DEBUG("riscv_get_gdb_reg_list: rtos_hartid=%d current_hartid=%d", r->rtos_hartid, r->current_hartid); LOG_DEBUG("rtos_hartid=%d current_hartid=%d", r->rtos_hartid, r->current_hartid);
if (r->rtos_hartid != -1)
if (r->rtos_hartid != -1 && riscv_rtos_enabled(target))
riscv_set_current_hartid(target, r->rtos_hartid); riscv_set_current_hartid(target, r->rtos_hartid);
else else
riscv_set_current_hartid(target, 0); riscv_set_current_hartid(target, target->coreid);
switch (reg_class) { switch (reg_class) {
case REG_CLASS_GENERAL: case REG_CLASS_GENERAL: