Struct uefi::table::boot::MemoryDescriptor
source · #[repr(C)]pub struct MemoryDescriptor {
pub ty: MemoryType,
pub phys_start: u64,
pub virt_start: u64,
pub page_count: u64,
pub att: MemoryAttribute,
}
Expand description
A structure describing a region of memory. This type corresponds to version of this struct in the UEFI spec and is always bound to a corresponding UEFI memory map.
§UEFI pitfalls
As of May 2024:
The memory descriptor struct might be extended in the future by a new UEFI
spec revision, which will be reflected in another version
of that
descriptor. The version is reported when using get_memory_map
of
BootServices
.
Also note that you must never work with size_of::<MemoryDescriptor>
but always with desc_size
, which is reported when using get_memory_map
as well [0]. For example, although the actual size is of version 1
descriptors is 40
, the reported desc_size
is 48
.
Fields§
§ty: MemoryType
Type of memory occupying this range.
phys_start: u64
Starting physical address.
virt_start: u64
Starting virtual address.
page_count: u64
Number of 4 KiB pages contained in this range.
att: MemoryAttribute
The capability attributes of this memory range.
Implementations§
Trait Implementations§
source§impl Align for MemoryDescriptor
impl Align for MemoryDescriptor
source§fn offset_up_to_alignment(val: usize) -> usize
fn offset_up_to_alignment(val: usize) -> usize
val
necessary to make it aligned,
rounding up. For example, if val
is 1 and the alignment is 8,
this will return 7. Returns 0 if val == 0
.source§fn round_up_to_alignment(val: usize) -> usize
fn round_up_to_alignment(val: usize) -> usize
val
up so that it is aligned.source§fn align_buf(buf: &mut [u8]) -> Option<&mut [u8]>
fn align_buf(buf: &mut [u8]) -> Option<&mut [u8]>
buf
where the address of the first element
is aligned. Returns None
if no element of the buffer is
aligned.source§fn assert_aligned(storage: &mut [u8])
fn assert_aligned(storage: &mut [u8])
source§impl Clone for MemoryDescriptor
impl Clone for MemoryDescriptor
source§fn clone(&self) -> MemoryDescriptor
fn clone(&self) -> MemoryDescriptor
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MemoryDescriptor
impl Debug for MemoryDescriptor
source§impl Default for MemoryDescriptor
impl Default for MemoryDescriptor
source§fn default() -> MemoryDescriptor
fn default() -> MemoryDescriptor
source§impl Hash for MemoryDescriptor
impl Hash for MemoryDescriptor
source§impl Ord for MemoryDescriptor
impl Ord for MemoryDescriptor
source§fn cmp(&self, other: &MemoryDescriptor) -> Ordering
fn cmp(&self, other: &MemoryDescriptor) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for MemoryDescriptor
impl PartialEq for MemoryDescriptor
source§impl PartialOrd for MemoryDescriptor
impl PartialOrd for MemoryDescriptor
impl Copy for MemoryDescriptor
impl Eq for MemoryDescriptor
impl StructuralPartialEq for MemoryDescriptor
Auto Trait Implementations§
impl Freeze for MemoryDescriptor
impl RefUnwindSafe for MemoryDescriptor
impl Send for MemoryDescriptor
impl Sync for MemoryDescriptor
impl Unpin for MemoryDescriptor
impl UnwindSafe for MemoryDescriptor
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)