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:
Tim Newsome 2023-02-10 11:45:54 -08:00 committed by GitHub
commit 282ac9884e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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)) {