//! # Architectural boot code //! //! crate::cpu::boot::arch_boot //! //! ## Boot code for ARM //! //! Provides the initial handoff //! function from Assembly to Rust. use core::arch::global_asm; global_asm!(include_str!("boot.s")); /// # Rust entry of the `kernel` binary. /// /// This function is unmangled so that the /// ASM boot code can switch to Rust safely. #[no_mangle] pub unsafe fn _start_rust() -> ! { crate::kernel_init() } /// # Rust entry for other cores of the `kernel` binary. /// /// This function is unmangled so that the /// ASM boot code can switch to Rust safely. #[no_mangle] pub extern "C" fn _start_other_core(_core: u32) -> ! { loop { use crate::INITIALIZED_BOOL; use core::sync::atomic::Ordering; if let Ok(true) = INITIALIZED_BOOL.compare_exchange(true, false, Ordering::Acquire, Ordering::Relaxed) { crate::serial_println!("Ran core {}!", _core); let u = crate::Box::::new(42); crate::serial_println!("{}", u); INITIALIZED_BOOL.store(true, Ordering::Release); break; } } #[allow(unreachable_code)] loop {} } /// # Prefetch #[no_mangle] pub extern "C" fn prefetch() -> ! { crate::serial_println!("Prefetch handler"); loop {} } /// # Data #[no_mangle] pub extern "C" fn data() -> ! { crate::serial_println!("Data handler"); loop {} } /// # IRQ #[no_mangle] pub extern "C" fn irq() -> ! { crate::serial_println!("IRQ handler"); loop {} } /// # FIQ #[no_mangle] pub extern "C" fn fiq() -> ! { crate::serial_println!("FIQ handler"); loop {} }