Skip to content

Commit c7cc943

Browse files
committed
scause: add missing LoadMisaligned
See table 4.2 in privileged spec version 20211203 as found today at https://riscv.org/technical/specifications/
1 parent 7c0f486 commit c7cc943

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/register/scause.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub enum Exception {
3434
InstructionFault,
3535
IllegalInstruction,
3636
Breakpoint,
37+
LoadMisaligned,
3738
LoadFault,
3839
StoreMisaligned,
3940
StoreFault,
@@ -67,6 +68,7 @@ impl Exception {
6768
1 => Exception::InstructionFault,
6869
2 => Exception::IllegalInstruction,
6970
3 => Exception::Breakpoint,
71+
4 => Exception::LoadMisaligned,
7072
5 => Exception::LoadFault,
7173
6 => Exception::StoreMisaligned,
7274
7 => Exception::StoreFault,
@@ -145,6 +147,7 @@ pub unsafe fn set(cause: Trap) {
145147
Exception::InstructionFault => 1,
146148
Exception::IllegalInstruction => 2,
147149
Exception::Breakpoint => 3,
150+
Exception::LoadMisaligned => 4,
148151
Exception::LoadFault => 5,
149152
Exception::StoreMisaligned => 6,
150153
Exception::StoreFault => 7,

0 commit comments

Comments
 (0)