diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-04-30 23:58:49 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-04-30 23:58:49 -0700 |
commit | d3d746f016ccc2218525f950fc00b96dedd00f54 (patch) | |
tree | bebd00f522a2a852be54ea5829f46898584d69c8 | |
parent | 2d8f51fcca517101c80e9c425058b0171daef22e (diff) | |
download | pk-d3d746f016ccc2218525f950fc00b96dedd00f54.zip pk-d3d746f016ccc2218525f950fc00b96dedd00f54.tar.gz pk-d3d746f016ccc2218525f950fc00b96dedd00f54.tar.bz2 |
Assume even less about mstatus reset value
-rw-r--r-- | pk/minit.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |