aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2017-03-16 12:35:12 -0700
committerAndrew Waterman <andrew@sifive.com>2017-03-16 12:35:12 -0700
commitf2ed45b1791bb602657adc2ea9ab5fc409c62542 (patch)
tree23126411a55f3cb8b5cc9d99ef5e4ec62bbf8c79
parent8bb62be82d1301e7fc17edde0f4efec12dfb5001 (diff)
downloadriscv-isa-manual-f2ed45b1791bb602657adc2ea9ab5fc409c62542.zip
riscv-isa-manual-f2ed45b1791bb602657adc2ea9ab5fc409c62542.tar.gz
riscv-isa-manual-f2ed45b1791bb602657adc2ea9ab5fc409c62542.tar.bz2
Simplify interrupt-stack discipline
h/t @jhauser-ucberkeley
-rw-r--r--src/machine.tex4
-rw-r--r--src/priv-preface.tex1
-rw-r--r--src/supervisor.tex11
3 files changed, 7 insertions, 9 deletions
diff --git a/src/machine.tex b/src/machine.tex
index 6e25f98..f272b2b 100644
--- a/src/machine.tex
+++ b/src/machine.tex
@@ -487,7 +487,7 @@ and {\em x}\,PP holds the previous privilege mode. The {\em x}\,PP
fields can only hold privilege modes up to {\em x}, so MPP and HPP are
two bits wide, SPP is one bit wide, and UPP is implicitly zero. When
a trap is taken from privilege mode {\em y} into privilege mode {\em
- x}, {\em x}\,PIE is set to the value of {\em y}\,IE; {\em x}\,IE is set to
+ x}, {\em x}\,PIE is set to the value of {\em x}\,IE; {\em x}\,IE is set to
0; and {\em x}\,PP is set to {\em y}.
\begin{commentary}
@@ -502,7 +502,7 @@ interrupts, so only one entry per stack is required.
The MRET, HRET, SRET, or URET instructions are used to return from
traps in M-mode, H-mode, S-mode, or U-mode respectively. When
executing an {\em x}RET instruction, supposing {\em x}\,PP holds the
-value {\em y}, {\em y}\,IE is set to {\em x}\,PIE; the privilege mode
+value {\em y}, {\em x}\,IE is set to {\em x}\,PIE; the privilege mode
is changed to {\em y}; {\em x}\,PIE is set to 1; and {\em x}\,PP is
set to U (or M if user-mode is not supported).
diff --git a/src/priv-preface.tex b/src/priv-preface.tex
index 0fdcde1..8d63770 100644
--- a/src/priv-preface.tex
+++ b/src/priv-preface.tex
@@ -19,6 +19,7 @@ proposal. Changes from version 1.9.1 include:
set them.
\item The counter-enable scheme has changed, so that H-mode and S-mode can
control availability of counters to S-mode and U-mode, respectively.
+\item The interrupt-enable stack discipline has been simplified.
\end{itemize}
\section*{Preface to Version 1.9.1}
diff --git a/src/supervisor.tex b/src/supervisor.tex
index 300fd59..e3fd603 100644
--- a/src/supervisor.tex
+++ b/src/supervisor.tex
@@ -163,13 +163,10 @@ When the hart is running in user-mode, the value in SIE is ignored, and
supervisor-level interrupts are enabled. The supervisor can disable
indivdual interrupt sources using the {\tt sie} register.
-The SPIE bit indicates whether interrupts were enabled before entering
-supervisor mode. When a trap is taken into supervisor mode, SPIE is
-set to either SIE or UIE depending on whether the trap was taken in
-supervisor or user mode respectively, and SIE is set to 0. When an
-SRET instruction is executed, if SPP=S, then SIE is set to SPIE; or
-if SPP=U, then UIE is set to SPIE. In either case, SPIE is then set
-to 1.
+The SPIE bit indicates whether supervisor interrupts were enabled prior to
+trapping into supervisor mode. When a trap is taken into supervisor
+mode, SPIE is set to SIE, and SIE is set to 0. When an SRET instruction is
+executed, SIE is set to SPIE, then SPIE is set to 1.
The UIE bit enables or disables user-mode interrupts. User-level interrupts
are enabled only if UIE is set and the hart is running in user-mode. The UPIE