From: Andrew Waterman Date: Thu, 2 Feb 2017 06:33:38 +0000 (-0800) Subject: Set xPIE=1 on xRET X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d392463e5c8e47cfa030eb4640585302f800207f;p=riscv-isa-sim.git Set xPIE=1 on xRET Resolves #88. --- diff --git a/riscv/insns/mret.h b/riscv/insns/mret.h index fa97b2c..f3c4414 100644 --- a/riscv/insns/mret.h +++ b/riscv/insns/mret.h @@ -3,7 +3,7 @@ set_pc_and_serialize(p->get_state()->mepc); reg_t s = STATE.mstatus; reg_t prev_prv = get_field(s, MSTATUS_MPP); s = set_field(s, MSTATUS_UIE << prev_prv, get_field(s, MSTATUS_MPIE)); -s = set_field(s, MSTATUS_MPIE, 0); +s = set_field(s, MSTATUS_MPIE, 1); s = set_field(s, MSTATUS_MPP, PRV_U); p->set_privilege(prev_prv); p->set_csr(CSR_MSTATUS, s); diff --git a/riscv/insns/sret.h b/riscv/insns/sret.h index f5e89e4..b593198 100644 --- a/riscv/insns/sret.h +++ b/riscv/insns/sret.h @@ -3,7 +3,7 @@ set_pc_and_serialize(p->get_state()->sepc); reg_t s = STATE.mstatus; reg_t prev_prv = get_field(s, MSTATUS_SPP); s = set_field(s, MSTATUS_UIE << prev_prv, get_field(s, MSTATUS_SPIE)); -s = set_field(s, MSTATUS_SPIE, 0); +s = set_field(s, MSTATUS_SPIE, 1); s = set_field(s, MSTATUS_SPP, PRV_U); p->set_privilege(prev_prv); p->set_csr(CSR_MSTATUS, s);