Merge pull request #798 from aap-sc/aap-sc/mcounteren_fixup
CSR_MCOUNTEREN should not exist if U-mode is not supported
This commit is contained in:
commit
282ac9884e
|
@ -5193,6 +5193,9 @@ int riscv_init_registers(struct target *target)
|
|||
case CSR_VLENB:
|
||||
r->exist = (info->vlenb > 0);
|
||||
break;
|
||||
case CSR_MCOUNTEREN:
|
||||
r->exist = riscv_supports_extension(target, 'U');
|
||||
break;
|
||||
}
|
||||
|
||||
if (!r->exist && !list_empty(&info->expose_csr)) {
|
||||
|
|
Loading…
Reference in New Issue