limine_protocol/requests/stack_size.rs
1use core::ptr::NonNull;
2
3use crate::responses::StackSizeResponse;
4
5limine_request! {
6 #[repr(C)]
7 #[derive(Debug)]
8 /// Specify how much stack you desire the bootloader to give you
9 pub struct StackSizeRequest: [0x224e_f046_0a8e_8926, 0xe1cb_0fc2_5f46_ea3d] {
10 /// Response pointer
11 pub response: Option<NonNull<StackSizeResponse>>,
12 /// The amount of stack to request
13 pub stack_size: u64,
14 }
15}
16
17impl StackSizeRequest {
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<&StackSizeResponse> {
26 Some(self.response?.as_ref())
27 }
28}