#[repr(C)]pub struct MemoryDescriptor {
pub ty: MemoryType,
pub phys_start: u64,
pub virt_start: u64,
pub page_count: u64,
pub att: MemoryAttribute,
/* private fields */
}
Expand description
A structure describing a region of memory.
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.
Trait Implementations
sourceimpl Align for MemoryDescriptor
impl Align for MemoryDescriptor
sourcefn offset_up_to_alignment(val: usize) -> usize
fn offset_up_to_alignment(val: usize) -> usize
Calculate the offset from 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
. Read more
sourcefn round_up_to_alignment(val: usize) -> usize
fn round_up_to_alignment(val: usize) -> usize
Round val
up so that it is aligned.
sourcefn align_buf(buf: &mut [u8]) -> Option<&mut [u8]>
fn align_buf(buf: &mut [u8]) -> Option<&mut [u8]>
Get a subslice of buf
where the address of the first element
is aligned. Returns None
if no element of the buffer is
aligned. Read more
sourcefn assert_aligned(storage: &mut [u8])
fn assert_aligned(storage: &mut [u8])
Assert that some storage is correctly aligned for this type
sourceimpl Clone for MemoryDescriptor
impl Clone for MemoryDescriptor
sourcefn clone(&self) -> MemoryDescriptor
fn clone(&self) -> MemoryDescriptor
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MemoryDescriptor
impl Debug for MemoryDescriptor
sourceimpl Default for MemoryDescriptor
impl Default for MemoryDescriptor
sourcefn default() -> MemoryDescriptor
fn default() -> MemoryDescriptor
Returns the “default value” for a type. Read more
impl Copy for MemoryDescriptor
Auto Trait Implementations
impl RefUnwindSafe for MemoryDescriptor
impl Send for MemoryDescriptor
impl Sync for MemoryDescriptor
impl Unpin for MemoryDescriptor
impl UnwindSafe for MemoryDescriptor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more