use crate::cpu_locals::CPULocals; use core::{arch::asm, ptr::NonNull}; pub mod interrupts; pub mod paging; /// Returns a pointer to the per-CPU locals. pub fn get_cpu_locals() -> NonNull { // SAFETY: The entrypoint sets this up, and safe code cannot invalidate it. unsafe { let tp; asm!("mv {out}, tp", out = out(reg) tp); NonNull::new_unchecked(tp) } } /// Halts the hart. pub fn sleep_forever() -> ! { loop { unsafe { asm!("wfi") } } }