#[repr(C)]pub struct MemoryDescriptor {
pub ty: MemoryType,
pub phys_start: PhysicalAddress,
pub virt_start: VirtualAddress,
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: PhysicalAddress
Starting physical address.
virt_start: VirtualAddress
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 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§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
)