MemoryMapRequest

Struct MemoryMapRequest 

Source
#[repr(C)]
pub struct MemoryMapRequest { /* private fields */ }
Expand description

Request limine’s memory map. This may or may not be the same as the one given by the BIOS/UEFI firmware. Entries are guaranteed to be in order of their base address. Usable and bootloader-reclaimable memory regions will never overlap, and will always be 4096-byte aligned. Other region types have no such guarantees. Some holes may exist. Memory between 0x0-0x1000 is never marked as usable.

§Usage

static BASE_REVISION: BaseRevision = BaseRevision::new();

// Request a memory map
static MEMORY_MAP_REQUEST: MemoryMapRequest = MemoryMapRequest::new();

// ...later, in our code
MEMORY_MAP_REQUEST.get_response() // ...

Implementations§

Source§

impl MemoryMapRequest

Source

pub const fn new() -> Self

Create a new request with the latest revision.

Source

pub const fn with_revision(revision: u64) -> Self

Create a new request with the given revision.

Source

pub fn id(&self) -> &[u64; 4]

Get the ID of this request. This includes the magic number and the request-specific ID.

Source

pub fn revision(&self) -> u64

Get the revision of this request.

Source

pub fn get_response(&self) -> Option<&MemoryMapResponse>

Get the response to this request, if it has been set.

Source

pub fn get_response_mut(&mut self) -> Option<&mut MemoryMapResponse>

Get a mutable reference to the response to this request, if it has been set.

Note that this method takes a mutable reference, so the request will have to be wrapped in a mutex or similar in order to use it.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.