Skip to content

Commit 795a594

Browse files
authored
Merge pull request #2015 from hermit-os/qemu-exit-comment
docs(x86_64): add explantory comment to `qemu_exit`
2 parents 0a574f1 + 95da0e0 commit 795a594

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/arch/x86_64/kernel/processor.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,9 @@ fn triple_fault() -> ! {
10881088
unreachable!()
10891089
}
10901090

1091+
/// Writes an exit code into the isa-debug-exit port.
1092+
///
1093+
/// For a value `e` written into the port, QEMU will exit with `(e << 1) | 1`.
10911094
fn qemu_exit(success: bool) {
10921095
let code = if success { 3 >> 1 } else { 0 };
10931096
unsafe {

0 commit comments

Comments
 (0)