diff options
author | Andrew Waterman <andrew@sifive.com> | 2019-11-12 19:17:12 -0800 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2019-11-12 19:17:12 -0800 |
commit | 86857aa3511d0a3bb1d28f8a6213013382545f77 (patch) | |
tree | 5b80d59e0eb989d491f2c7db46a1a960e8236e67 /riscv/processor.cc | |
parent | 9a8ee5efdc97a44d3509abd616297edaf7e3800e (diff) | |
download | spike-86857aa3511d0a3bb1d28f8a6213013382545f77.zip spike-86857aa3511d0a3bb1d28f8a6213013382545f77.tar.gz spike-86857aa3511d0a3bb1d28f8a6213013382545f77.tar.bz2 |
mstatus.FS only exists if (S || V || F)
Diffstat (limited to 'riscv/processor.cc')
-rw-r--r-- | riscv/processor.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/riscv/processor.cc b/riscv/processor.cc index 3dff83e..9b8050c 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -535,10 +535,14 @@ void processor_t::set_csr(int which, reg_t val) (MSTATUS_MPP | MSTATUS_MPRV | MSTATUS_SUM | MSTATUS_MXR)) mmu->flush_tlb(); + bool has_fs = supports_extension('S') || supports_extension('F') + || supports_extension('V'); + reg_t mask = MSTATUS_SIE | MSTATUS_SPIE | MSTATUS_MIE | MSTATUS_MPIE - | MSTATUS_FS | MSTATUS_MPRV | MSTATUS_SUM + | MSTATUS_MPRV | MSTATUS_SUM | MSTATUS_MXR | MSTATUS_TW | MSTATUS_TVM | MSTATUS_TSR | MSTATUS_UXL | MSTATUS_SXL | + (has_fs ? MSTATUS_FS : 0) | (ext ? MSTATUS_XS : 0); reg_t requested_mpp = legalize_privilege(get_field(val, MSTATUS_MPP)); |