#[repr(C, align(8))]pub struct MemoryMapTag { /* private fields */ }
Expand description
This tag provides an initial host memory map (legacy boot, not UEFI).
The map provided is guaranteed to list all standard RAM that should be available for normal use. This type however includes the regions occupied by kernel, mbi, segments and modules. Kernel must take care not to overwrite these regions.
This tag may not be provided by some boot loaders on EFI platforms if EFI boot services are enabled and available for the loaded image (The EFI boot services tag may exist in the Multiboot2 boot information structure).
Implementations§
Source§impl MemoryMapTag
impl MemoryMapTag
Sourcepub fn new(areas: &[MemoryArea]) -> Box<Self>
pub fn new(areas: &[MemoryArea]) -> Box<Self>
Constructs a new tag.
Sourcepub const fn entry_size(&self) -> u32
pub const fn entry_size(&self) -> u32
Returns the entry size.
Sourcepub const fn entry_version(&self) -> u32
pub const fn entry_version(&self) -> u32
Returns the entry version.
Sourcepub fn memory_areas(&self) -> &[MemoryArea]
pub fn memory_areas(&self) -> &[MemoryArea]
Return the slice of the provided MemoryArea
s.
Usually, this should already reflect the memory consumed by the code running this.
Trait Implementations§
Source§impl Debug for MemoryMapTag
impl Debug for MemoryMapTag
Source§impl MaybeDynSized for MemoryMapTag
impl MaybeDynSized for MemoryMapTag
Source§const BASE_SIZE: usize = 16usize
const BASE_SIZE: usize = 16usize
The true base size of the struct without any implicit or additional
padding. Note that
size_of::<T>()
isn’t sufficient, as for example
the type could have three u32
fields, which would add an implicit
u32
padding. However, this constant must always fulfill
BASE_SIZE >= size_of::<Self::Header>()
. Read moreSource§fn dst_len(header: &TagHeader) -> usize
fn dst_len(header: &TagHeader) -> usize
Returns the amount of items in the dynamically sized portion of the
DST. Note that this is not the amount of bytes. So if the dynamically
sized portion is 16 bytes in size and each element is 4 bytes big, then
this function must return 4. Read more
Source§fn payload(&self) -> &[u8]
fn payload(&self) -> &[u8]
Returns the payload, i.e., all memory that is not occupied by the
Header
of the type.