Skip to content

Commit c884f7e

Browse files
authored
Merge pull request #138 from orangecms/master
scause: add missing LoadMisaligned
2 parents 259f001 + 349d73e commit c884f7e

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1717

1818
- CI actions updated. They now use `checkout@v3` and `dtolnay/rust-toolchain`.
1919

20+
### Fixed
21+
22+
- Fix `scause::Exception` missing `LoadMisaligned`
23+
2024
## [v0.10.1] - 2023-01-18
2125

2226
### Fixed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
pub mod asm;
3232
pub mod delay;
3333
pub mod interrupt;
34-
#[cfg(any(feature = "plic"))]
34+
#[cfg(feature = "plic")]
3535
pub mod peripheral;
3636
pub mod register;
3737

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)