Read misa before using it to check for extensions.

Change-Id: I7a172d83055d8bd833e3349a5b22b47dd5f31f5c
This commit is contained in:
Tim Newsome 2017-12-11 14:59:11 -08:00
parent ec1c814017
commit 10c17fdf17
1 changed files with 2 additions and 1 deletions

View File

@ -1219,11 +1219,12 @@ static int examine(struct target *target)
r->xlen[i] = 32;
}
register_read_direct(target, &r->misa, GDB_REGNO_MISA);
// Now init registers based on what we discovered.
if (riscv_init_registers(target) != ERROR_OK)
return ERROR_FAIL;
r->misa = riscv_get_register_on_hart(target, i, GDB_REGNO_MISA);
/* Display this as early as possible to help people who are using
* really slow simulators. */
LOG_DEBUG(" hart %d: XLEN=%d, misa=0x%" PRIx64, i, r->xlen[i],