Skip to content

Commit 689d0fc

Browse files
No longer hard-code the non-RTOS hart to 0
I was just being lazy here.
1 parent 4bdb042 commit 689d0fc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/target/riscv/riscv.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,11 +448,12 @@ static int riscv_get_gdb_reg_list(struct target *target,
448448
{
449449
RISCV_INFO(r);
450450
LOG_DEBUG("reg_class=%d", reg_class);
451-
LOG_DEBUG("riscv_get_gdb_reg_list: rtos_hartid=%d current_hartid=%d", r->rtos_hartid, r->current_hartid);
452-
if (r->rtos_hartid != -1)
451+
LOG_DEBUG("rtos_hartid=%d current_hartid=%d", r->rtos_hartid, r->current_hartid);
452+
453+
if (r->rtos_hartid != -1 && riscv_rtos_enabled(target))
453454
riscv_set_current_hartid(target, r->rtos_hartid);
454455
else
455-
riscv_set_current_hartid(target, 0);
456+
riscv_set_current_hartid(target, target->coreid);
456457

457458
switch (reg_class) {
458459
case REG_CLASS_GENERAL:

0 commit comments

Comments
 (0)