Skip to content

Commit ee84d85

Browse files
Merge pull request #216 from kevin-vigor/master
Fix semihosting::debug::exit() on riscv64 QEMU targets.
2 parents 2fc23fe + ff4dc30 commit ee84d85

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

riscv-semihosting/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
88
### Changed
99

1010
- Made `cfg` variable selection more robust for custom targets
11+
- Fixed debug::exit() on riscv64 QEMU simulation
1112

1213
## [v0.1.0] - 2023-01-18
1314

riscv-semihosting/src/debug.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ pub fn exit(status: ExitStatus) {
8989
pub fn report_exception(reason: Exception) {
9090
let code = reason as usize;
9191
unsafe {
92+
#[cfg(target_arch = "riscv64")]
93+
syscall!(REPORT_EXCEPTION, code, 0);
94+
95+
#[cfg(not(target_arch = "riscv64"))]
9296
syscall1!(REPORT_EXCEPTION, code);
9397
}
9498
}

0 commit comments

Comments
 (0)