diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 74f1c7eca..1d83badf0 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -1755,8 +1755,7 @@ int riscv_set_current_hartid(struct target *target, int hartid) /* Avoid invalidating the register cache all the time. */ if (r->registers_initialized && (!riscv_rtos_enabled(target) || (previous_hartid == hartid)) - && target->reg_cache->reg_list[GDB_REGNO_ZERO].size == (unsigned)riscv_xlen(target) - && (!riscv_rtos_enabled(target) || (r->rtos_hartid != -1))) { + && target->reg_cache->reg_list[GDB_REGNO_ZERO].size == (unsigned)riscv_xlen(target)) { return ERROR_OK; } else LOG_DEBUG("Initializing registers: xlen=%d", riscv_xlen(target));