diff options
author | demin.han <demin.han@starfivetech.com> | 2024-01-11 13:30:27 +0800 |
---|---|---|
committer | demin.han <demin.han@starfivetech.com> | 2024-01-11 13:30:27 +0800 |
commit | f8b2e39258d6de74652203a5ca357bb918e3ed53 (patch) | |
tree | fbf9a8940073159702e710c17762f5b4570a347f /riscv/insns | |
parent | 8f045178d0c0319010cc5363ab69181e7ed318b9 (diff) | |
download | riscv-isa-sim-f8b2e39258d6de74652203a5ca357bb918e3ed53.zip riscv-isa-sim-f8b2e39258d6de74652203a5ca357bb918e3ed53.tar.gz riscv-isa-sim-f8b2e39258d6de74652203a5ca357bb918e3ed53.tar.bz2 |
Refactor put_csr to direct write
1. put_csr needs search
2. MSTATUS_MPV not written back for RV32
Signed-off-by: demin.han <demin.han@starfivetech.com>
Diffstat (limited to 'riscv/insns')
-rw-r--r-- | riscv/insns/mret.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/riscv/insns/mret.h b/riscv/insns/mret.h index f5f86a2..a6fcd13 100644 --- a/riscv/insns/mret.h +++ b/riscv/insns/mret.h @@ -9,5 +9,5 @@ s = set_field(s, MSTATUS_MIE, get_field(s, MSTATUS_MPIE)); s = set_field(s, MSTATUS_MPIE, 1); s = set_field(s, MSTATUS_MPP, p->extension_enabled('U') ? PRV_U : PRV_M); s = set_field(s, MSTATUS_MPV, 0); -p->put_csr(CSR_MSTATUS, s); +STATE.mstatus->write(s); p->set_privilege(prev_prv, prev_virt); |