Commit 3b9803b
committed
Fix mret and mnret instructions to support correctly Smdbltrp (MDT bit) and MPRV bit
Before his fix IDL code reset mstatus.MPRV bit only in case if S mode
is implemented for both mret and mnret. This seems wrong, since spec
states that MPRV should be reset by both mret and mnret for case when
mode processor is returning is different from Machine mode (2b'11).
As well, Smdbltrp spec requires that such case (returning to non-machine
mode), the mnret instruction should reset MDT bit.
According to the spec mnret instruction should set mnstatus.NMIE=1.
Also, mnret should use mnstatus.MNPP bit field for previous mode
storage.
Signed-off-by: Albert Yosher <[email protected]>1 parent d51cb12 commit 3b9803b
2 files changed
+19
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
23 | 30 | | |
| 31 | + | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
| |||
0 commit comments