From 9fca12559e540e72b62cbbbe26fa565770f38cc4 Mon Sep 17 00:00:00 2001 From: Gokturk Yuksek Date: Tue, 24 Nov 2020 00:46:00 -0500 Subject: 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. --- v/vm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'v') diff --git a/v/vm.c b/v/vm.c index 71700f5..d03f3b1 100644 --- a/v/vm.c +++ b/v/vm.c @@ -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. -- cgit v1.1