set hartid in riscv013_is_halted function

This commit is contained in:
Gleb Gagarin 2017-09-20 17:16:52 -07:00
parent 371fddfc41
commit 030abf5be0
1 changed files with 2 additions and 0 deletions

View File

@ -1810,6 +1810,8 @@ static void riscv013_on_halt(struct target *target)
static bool riscv013_is_halted(struct target *target)
{
riscv_set_current_hartid(target, riscv_current_hartid(target));
uint32_t dmstatus = dmi_read(target, DMI_DMSTATUS);
if (get_field(dmstatus, DMI_DMSTATUS_ANYUNAVAIL))
LOG_ERROR("hart %d is unavailiable", riscv_current_hartid(target));