projects
/
riscv-isa-sim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
72b4e74
)
Fix ERET bug
author
Andrew Waterman
<waterman@cs.berkeley.edu>
Fri, 12 Feb 2016 18:58:43 +0000
(10:58 -0800)
committer
Andrew Waterman
<waterman@cs.berkeley.edu>
Wed, 2 Mar 2016 20:15:25 +0000
(12:15 -0800)
riscv/insns/sret.h
patch
|
blob
|
history
diff --git
a/riscv/insns/sret.h
b/riscv/insns/sret.h
index c3561d38e45a8f6cfce93df9ccca339e89b5eb72..f317d14f13e1e91c7afca59b25ff9d06db5a1cef 100644
(file)
--- a/
riscv/insns/sret.h
+++ b/
riscv/insns/sret.h
@@
-11,6
+11,6
@@
reg_t pie = get_field(s, MSTATUS_UPIE << STATE.prv);
reg_t prev_prv = get_field(s, STATE.prv == PRV_S ? MSTATUS_SPP : MSTATUS_MPP);
s = set_field(s, MSTATUS_UIE << prev_prv, pie); // [[prv]PP]IE = [prv]PIE
s = set_field(s, MSTATUS_UPIE << STATE.prv, 0); // [prv]PIE <- 0
-p->set_privilege(prev_prv); // prv <- [prv]PP
s = set_field(s, STATE.prv == PRV_S ? MSTATUS_SPP : MSTATUS_MPP, PRV_U); // [prv]PP = U
+p->set_privilege(prev_prv); // prv <- [prv]PP
p->set_csr(CSR_MSTATUS, s);