aboutsummaryrefslogtreecommitdiff
path: root/riscv
diff options
context:
space:
mode:
authorUdit Khanna <udit.khanna@sifive.com>2020-05-12 00:37:50 -0700
committerChih-Min Chao <chihmin.chao@sifive.com>2020-05-19 19:57:13 -0700
commit4061ee6e184dab1e39c7448c248aa8f74b3f150b (patch)
tree1835e1bdcd7756e539eb60c25e6e0083e50aaa24 /riscv
parent01df03c1fc536926f41d6f061e85672b8dc7d99f (diff)
downloadspike-4061ee6e184dab1e39c7448c248aa8f74b3f150b.zip
spike-4061ee6e184dab1e39c7448c248aa8f74b3f150b.tar.gz
spike-4061ee6e184dab1e39c7448c248aa8f74b3f150b.tar.bz2
Hardwire mstatus.[sie,spie] to zero if 'S' mode absent
Diffstat (limited to 'riscv')
-rw-r--r--riscv/processor.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/riscv/processor.cc b/riscv/processor.cc
index b5ee590..0edf193 100644
--- a/riscv/processor.cc
+++ b/riscv/processor.cc
@@ -742,9 +742,8 @@ void processor_t::set_csr(int which, reg_t val)
|| supports_extension('V');
bool has_vs = supports_extension('V');
- reg_t mask = MSTATUS_SIE | MSTATUS_SPIE | MSTATUS_MIE | MSTATUS_MPIE
- | MSTATUS_MPRV
- | (supports_extension('S') ? MSTATUS_SUM : 0)
+ reg_t mask = MSTATUS_MIE | MSTATUS_MPIE | MSTATUS_MPRV
+ | (supports_extension('S') ? (MSTATUS_SUM | MSTATUS_SIE | MSTATUS_SPIE) : 0)
| MSTATUS_MXR | MSTATUS_TW | MSTATUS_TVM | MSTATUS_TSR
| (has_fs ? MSTATUS_FS : 0)
| (has_vs ? MSTATUS_VS : 0)