aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2015-04-30 23:58:49 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2015-04-30 23:58:49 -0700
commitd3d746f016ccc2218525f950fc00b96dedd00f54 (patch)
treebebd00f522a2a852be54ea5829f46898584d69c8
parent2d8f51fcca517101c80e9c425058b0171daef22e (diff)
downloadpk-d3d746f016ccc2218525f950fc00b96dedd00f54.zip
pk-d3d746f016ccc2218525f950fc00b96dedd00f54.tar.gz
pk-d3d746f016ccc2218525f950fc00b96dedd00f54.tar.bz2
Assume even less about mstatus reset value
-rw-r--r--pk/minit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pk/minit.c b/pk/minit.c
index 09b89aa..b22fd53 100644
--- a/pk/minit.c
+++ b/pk/minit.c
@@ -6,11 +6,12 @@ uint32_t num_harts;
static void mstatus_init()
{
- uintptr_t ms = read_csr(mstatus);
+ uintptr_t ms = 0;
#ifdef __riscv64
ms = INSERT_FIELD(ms, MSTATUS_SA, UA_RV64);
- ms = INSERT_FIELD(ms, MSTATUS_UA, UA_RV64);
#endif
+ ms = INSERT_FIELD(ms, MSTATUS_PRV, PRV_M);
+ ms = INSERT_FIELD(ms, MSTATUS_IE, 0);
ms = INSERT_FIELD(ms, MSTATUS_PRV1, PRV_S);
ms = INSERT_FIELD(ms, MSTATUS_IE1, 0);
ms = INSERT_FIELD(ms, MSTATUS_PRV2, PRV_U);