#[cfg(target_arch = "x86_64")]
include!("x86_64.rs");
#[cfg(target_arch = "aarch64")]
include!("aarch64.rs");
#[cfg(target_arch = "riscv64")]
include!("riscv64.rs");
#[cfg(target_arch = "loongarch64")]
include!("loongarch64.rs");
#[cfg(not(any(
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "riscv64",
target_arch = "loongarch64"
)))]
compile_error!("The current target architecture is not supported by the Limine boot protocol");
pub type MpGotoFunction = unsafe extern "C" fn(&MpInfo) -> !;
impl MpInfo {
pub fn bootstrap(&self, address: MpGotoFunction, extra_arg: u64) {
use core::sync::atomic::Ordering;
self.extra_argument.store(extra_arg, Ordering::Relaxed);
self.goto_addr.store(address as *mut (), Ordering::Release);
}
pub fn extra_argument(&self) -> u64 {
use core::sync::atomic::Ordering;
self.extra_argument.load(Ordering::Acquire)
}
}
impl MpRespData {
pub const fn cpus(&self) -> &[&MpInfo] {
unsafe { &*core::ptr::slice_from_raw_parts(self.cpus as _, self.cpu_count as usize) }
}
}