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