diff options
Diffstat (limited to 'riscv/insns/mret.h')
-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 be9f247..77847dd 100644 --- a/riscv/insns/mret.h +++ b/riscv/insns/mret.h @@ -7,7 +7,7 @@ if (prev_prv != PRV_M) s = set_field(s, MSTATUS_MPRV, 0); s = set_field(s, MSTATUS_MIE, get_field(s, MSTATUS_MPIE)); s = set_field(s, MSTATUS_MPIE, 1); -s = set_field(s, MSTATUS_MPP, PRV_U); +s = set_field(s, MSTATUS_MPP, p->extension_enabled('U') ? PRV_U : PRV_M); s = set_field(s, MSTATUS_MPV, 0); p->set_csr(CSR_MSTATUS, s); p->set_privilege(prev_prv); |