diff options
author | Gokturk Yuksek <gokturk@binghamton.edu> | 2020-11-24 00:46:00 -0500 |
---|---|---|
committer | Gokturk Yuksek <gokturk@binghamton.edu> | 2020-11-24 00:46:00 -0500 |
commit | 9fca12559e540e72b62cbbbe26fa565770f38cc4 (patch) | |
tree | 1e6f090a096bc6514e11e8d2365f7dbdbc1fefd1 /v | |
parent | 43d3d53809085e2c8f030d72eed1bdf798bfb31a (diff) | |
download | env-9fca12559e540e72b62cbbbe26fa565770f38cc4.zip env-9fca12559e540e72b62cbbbe26fa565770f38cc4.tar.gz env-9fca12559e540e72b62cbbbe26fa565770f38cc4.tar.bz2 |
Replace sptbr with satp throughout
The RISC-V Privileged ISA v1.10 uses satp instead of sptbr. Although
GCC can cope with sptbr, clang cannot. It fails with:
error: operand must be a valid system register name or an integer in
the range [0, 4095]
Modified the variable name in vm.c as well to ensure consistency and
avoid possible confusion.
Diffstat (limited to 'v')
-rw-r--r-- | v/vm.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -253,10 +253,10 @@ void vm_boot(uintptr_t test_addr) # error #endif uintptr_t vm_choice = SATP_MODE_CHOICE; - uintptr_t sptbr_value = ((uintptr_t)l1pt >> PGSHIFT) + uintptr_t satp_value = ((uintptr_t)l1pt >> PGSHIFT) | (vm_choice * (SATP_MODE & ~(SATP_MODE<<1))); - write_csr(sptbr, sptbr_value); - if (read_csr(sptbr) != sptbr_value) + write_csr(satp, satp_value); + if (read_csr(satp) != satp_value) assert(!"unsupported satp mode"); // Set up PMPs if present, ignoring illegal instruction trap if not. |