Skip to content

Commit cb6a264

Browse files
Merge pull request #283 from rust-embedded/simple-mnested
Simplify `riscv::interrupt::machine::nested`
2 parents 665ffdf + acf4098 commit cb6a264

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

riscv/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1212
- CSR helper macro `write_composite_csr` for writing 64-bit CSRs on 32-bit targets.
1313
- Write utilities for `mcycle`, `minstret`
1414

15+
### Changed
16+
17+
- Simplify `riscv::interrupt::machine::nested`
18+
1519
## [v0.13.0] - 2025-02-18
1620

1721
### Added

riscv/src/interrupt/machine.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,10 @@ where
192192
}
193193

194194
// Restore MSTATUS.PIE, MSTATUS.MPP, and SEPC
195-
let mut after_mstatus = mstatus::read();
196195
if mstatus.mpie() {
197-
after_mstatus.set_mpie(mstatus.mpie());
196+
mstatus::set_mpie();
198197
}
199-
after_mstatus.set_mpp(mstatus.mpp());
200-
mstatus::write(after_mstatus);
198+
mstatus::set_mpp(mstatus.mpp());
201199
mepc::write(mepc);
202200

203201
r

0 commit comments

Comments
 (0)