limine_protocol/requests/smp.rs
1use core::ptr::NonNull;
2
3use crate::responses::SMPResponse;
4
5limine_request! {
6 #[repr(C)]
7 #[derive(Debug)]
8 /// Request the bootloader bootstrap the secondary processors
9 pub struct SMPRequest: [0x95a6_7b81_9a1b_857e, 0xa0b6_1b72_3b6a_73e0] {
10 /// Response pointer
11 pub response: Option<NonNull<SMPResponse>>,
12 /// Flags for the bootloader
13 /// `Bit 0` - Enable X2APIC if available
14 pub flags: u64,
15 }
16}
17
18impl SMPRequest {
19 /// Get the response as a reference, if it's present.
20 ///
21 /// # Safety
22 /// The backing memory must not have been invalidated by the kernel,
23 /// either by writing to the physical memory, changing where it's mapped, or
24 /// unmapping it.
25 #[must_use]
26 pub unsafe fn get_response(&self) -> Option<&SMPResponse> {
27 Some(self.response?.as_ref())
28 }
29}