limine_protocol/requests/
entry_point.rs

1use core::ptr::NonNull;
2
3use crate::responses::EntryPointResponse;
4
5limine_request! {
6    #[repr(C)]
7    #[derive(Debug)]
8    /// Request the bootloader use the specified entry point instead of the default one
9    pub struct EntryPointRequest: [0x13d8_6c03_5a1c_d3e1, 0x2b0c_aa89_d8f3_026a] {
10        /// Response pointer
11        pub response: Option<NonNull<EntryPointResponse>>,
12        /// Function to the entry point
13        pub entry: Option<*mut ()>,
14    }
15}
16
17impl EntryPointRequest {
18    /// Get the response as a reference, if it's present.
19    ///
20    /// # Safety
21    /// The backing memory must not have been invalidated by the kernel,
22    /// either by writing to the physical memory, changing where it's mapped, or
23    /// unmapping it.
24    #[must_use]
25    pub unsafe fn get_response(&self) -> Option<&EntryPointResponse> {
26        Some(self.response?.as_ref())
27    }
28}