#[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: MemoryTypeType of memory occupying this range.
phys_start: PhysicalAddressStarting physical address.
virt_start: VirtualAddressStarting virtual address.
page_count: u64Number of 4 KiB pages contained in this range.
att: MemoryAttributeThe 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§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§impl PartialEq for MemoryDescriptor
impl PartialEq for MemoryDescriptor
Source§impl PartialOrd for MemoryDescriptor
impl PartialOrd for MemoryDescriptor
Source§fn partial_cmp(&self, other: &MemoryDescriptor) -> Option<Ordering>
fn partial_cmp(&self, other: &MemoryDescriptor) -> Option<Ordering>
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§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut u8)
unsafe fn clone_to_uninit(&self, dst: *mut u8)
clone_to_uninit)