Skip to content

Commit

Permalink
using crate semihosting on aarch64
Browse files Browse the repository at this point in the history
This crate provides access to semihosting, a mechanism for
programs running on the real or virtual (e.g., QEMU) target
to communicate with I/O facilities on the host system.
  • Loading branch information
stlankes committed Jan 23, 2024
1 parent 6f5fa0e commit 4eb9784
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ num-traits = { version = "0.2", default-features = false }
pci-ids = { version = "0.2", optional = true }
pci_types = { version = "0.6" }
pflock = "0.2"
qemu-exit = "3.0"
rand_chacha = { version = "0.3", default-features = false }
shell-words = { version = "1.1", default-features = false }
smallvec = { version = "1", features = ["const_new"] }
Expand Down Expand Up @@ -122,17 +121,20 @@ multiboot = "0.8"
uart_16550 = "0.3"
x86 = { version = "0.52", default-features = false }
x86_64 = "0.14"
qemu-exit = "3.0"

[target.'cfg(target_arch = "aarch64")'.dependencies]
aarch64 = { version = "0.0", default-features = false }
arm-gic = { version = "0.1" }
hermit-dtb = { version = "0.1" }
semihosting = { version = "0.1", default-features = false }

[target.'cfg(target_arch = "riscv64")'.dependencies]
fdt = "0.1"
riscv = "0.11"
sbi = "0.2"
trapframe = "0.9"
semihosting = { version = "0.1", default-features = false }

[dev-dependencies]
float-cmp = "0.9"
Expand Down
5 changes: 1 addition & 4 deletions src/arch/aarch64/kernel/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use core::{fmt, str};
use aarch64::regs::{Readable, CNTFRQ_EL0};
use hermit_dtb::Dtb;
use hermit_sync::{without_interrupts, Lazy};
use qemu_exit::QEMUExit;

use crate::arch::aarch64::kernel::boot_info;
use crate::env;
Expand Down Expand Up @@ -118,9 +117,7 @@ pub fn halt() {
/// Shutdown the system
pub fn shutdown() -> ! {
info!("Shutting down system");

let exit_handler = qemu_exit::AArch64::new();
exit_handler.exit_success();
semihosting::process::exit(0);
}

#[inline]
Expand Down

0 comments on commit 4eb9784

Please sign in to comment.