aboutsummaryrefslogtreecommitdiff
path: root/pk/minit.c
diff options
context:
space:
mode:
Diffstat (limited to 'pk/minit.c')
-rw-r--r--pk/minit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pk/minit.c b/pk/minit.c
index 01625bd..09b89aa 100644
--- a/pk/minit.c
+++ b/pk/minit.c
@@ -7,14 +7,16 @@ uint32_t num_harts;
static void mstatus_init()
{
uintptr_t ms = read_csr(mstatus);
+#ifdef __riscv64
ms = INSERT_FIELD(ms, MSTATUS_SA, UA_RV64);
ms = INSERT_FIELD(ms, MSTATUS_UA, UA_RV64);
+#endif
ms = INSERT_FIELD(ms, MSTATUS_PRV1, PRV_S);
ms = INSERT_FIELD(ms, MSTATUS_IE1, 0);
ms = INSERT_FIELD(ms, MSTATUS_PRV2, PRV_U);
ms = INSERT_FIELD(ms, MSTATUS_IE2, 1);
ms = INSERT_FIELD(ms, MSTATUS_MPRV, PRV_M);
- ms = INSERT_FIELD(ms, MSTATUS_VM, VM_SV43);
+ ms = INSERT_FIELD(ms, MSTATUS_VM, VM_CHOICE);
ms = INSERT_FIELD(ms, MSTATUS_FS, 3);
ms = INSERT_FIELD(ms, MSTATUS_XS, 3);
write_csr(mstatus, ms);
@@ -28,7 +30,7 @@ static void mstatus_init()
panic("supervisor support is required");
}
- if (EXTRACT_FIELD(ms, MSTATUS_VM) != VM_SV43)
+ if (EXTRACT_FIELD(ms, MSTATUS_VM) != VM_CHOICE)
have_vm = 0;
}