Don't immediately segfault with -rtos on v0.11.

This commit is contained in:
Tim Newsome
2017-06-19 12:23:38 -07:00
parent ccdd26e3ef
commit 10518351bb
+3
View File
@@ -1012,6 +1012,9 @@ bool riscv_rtos_enabled(const struct target *target)
void riscv_set_current_hartid(struct target *target, int hartid)
{
RISCV_INFO(r);
if (!r->select_current_hart)
return;
int previous_hartid = riscv_current_hartid(target);
r->current_hartid = hartid;
assert(riscv_rtos_enabled(target) || target->coreid == hartid);