Luna/moon/src/init.rs

16 lines
385 B
Rust
Raw Normal View History

2022-10-31 14:34:32 +01:00
use crate::bootboot::{BOOTBOOT, BOOTBOOT_MAGIC};
use crate::util::get_bootboot;
use crate::arch::cpu;
pub fn halt_other_cores() -> () {
let boot: &BOOTBOOT = get_bootboot();
if cpu::get_processor_id() != boot.bspid as u32 {
cpu::halt();
}
}
2022-10-31 14:34:32 +01:00
pub fn check_magic() -> () {
let boot: &BOOTBOOT = get_bootboot();
2022-10-31 14:34:32 +01:00
assert_eq!(boot.magic, BOOTBOOT_MAGIC[..4]);
}