limine_protocol/responses/
smp.rs1use crate::structures::smpinfo::SMPInfo;
2
3#[repr(C)]
4#[derive(Debug)]
5pub struct SMPResponse {
7 pub revision: u64,
9 pub flags: u32,
12 pub bsp_lapic_id: u32,
14 pub cpu_count: u64,
16 pub cpus: *const *const SMPInfo,
18}
19
20impl SMPResponse {
21 #[must_use]
26 pub unsafe fn get_cpu_info(&self) -> Option<&[&SMPInfo]> {
27 if self.cpus.is_null() {
28 return None;
29 }
30
31 Some(core::slice::from_raw_parts(
32 self.cpus.cast::<&SMPInfo>(),
33 self.cpu_count.try_into().ok()?,
34 ))
35 }
36}