25 lines
517 B
Rust
25 lines
517 B
Rust
// Architecture-specific entry points.
|
|
// To add a new architecture: add a cfg block with the appropriate global_asm.
|
|
|
|
#[cfg(all(target_arch = "riscv64", target_os = "none"))]
|
|
core::arch::global_asm!(
|
|
r#"
|
|
.section .text.entry
|
|
.globl _start
|
|
_start:
|
|
lla t0, LIBKOS_START_ARG
|
|
sd a0, 0(t0)
|
|
call main
|
|
li a7, 16
|
|
ecall
|
|
j _start
|
|
"#
|
|
);
|
|
|
|
#[cfg(target_os = "none")]
|
|
#[panic_handler]
|
|
fn panic(info: &core::panic::PanicInfo) -> ! {
|
|
crate::println!("panic: {}", info);
|
|
crate::syscall::exit();
|
|
}
|