Skip to content

Commit 5dafe25

Browse files
committed
fix critial section implementation
1 parent 9ba9421 commit 5dafe25

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Fix implementation for `SingleHartCriticalSection`
13+
1014
## [v0.10.0] - 2022-11-09
1115

1216
### Added

src/critical_section.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set_impl!(SingleHartCriticalSection);
99
unsafe impl Impl for SingleHartCriticalSection {
1010
unsafe fn acquire() -> RawRestoreState {
1111
let mut mstatus: usize;
12-
core::arch::asm!("csrrci {}, 0x300, 0b100", out(reg) mstatus);
12+
core::arch::asm!("csrrci {}, mstatus, 0b1000", out(reg) mstatus);
1313
core::mem::transmute::<_, mstatus::Mstatus>(mstatus).mie()
1414
}
1515

0 commit comments

Comments
 (0)