Struct kernel::mem::address::physical_address::PhysicalAddress
source · pub struct PhysicalAddress {
bits: usize,
}
Expand description
The PhysicalAddress
struct represents a 56-bit physical address defined in the Sv39
page table format.
Fields§
§bits: usize
Implementations§
source§impl PhysicalAddress
impl PhysicalAddress
sourcepub fn floor(&self) -> FrameNumber
pub fn floor(&self) -> FrameNumber
Returns the FrameNumber that represents the frame that contains the physical address.
sourcepub fn ceil(&self) -> FrameNumber
pub fn ceil(&self) -> FrameNumber
Returns the FrameNumber that represents the frame that contains the physical address, rounding up to the next frame if the physical address is not aligned to a frame.
sourcepub fn page_offset(&self) -> usize
pub fn page_offset(&self) -> usize
Returns the byte offset of the physical address within its containing frame.
sourcepub fn is_aligned(&self) -> bool
pub fn is_aligned(&self) -> bool
Returns true
if the physical address is aligned to a frame.
sourcepub fn as_ptr_mut(&self) -> *mut u8
pub fn as_ptr_mut(&self) -> *mut u8
Returns a mutable raw pointer to the physical address.
pub fn as_ref<T>(&self) -> &'static T
pub fn as_mut<T>(&self) -> &'static mut T
Trait Implementations§
source§impl Add<usize> for PhysicalAddress
impl Add<usize> for PhysicalAddress
source§impl Clone for PhysicalAddress
impl Clone for PhysicalAddress
source§fn clone(&self) -> PhysicalAddress
fn clone(&self) -> PhysicalAddress
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl From<FrameNumber> for PhysicalAddress
impl From<FrameNumber> for PhysicalAddress
source§fn from(value: FrameNumber) -> Self
fn from(value: FrameNumber) -> Self
Converts to this type from the input type.
source§impl From<PhysicalAddress> for FrameNumber
impl From<PhysicalAddress> for FrameNumber
source§fn from(value: PhysicalAddress) -> Self
fn from(value: PhysicalAddress) -> Self
Converts to this type from the input type.
source§impl From<PhysicalAddress> for usize
impl From<PhysicalAddress> for usize
source§fn from(value: PhysicalAddress) -> Self
fn from(value: PhysicalAddress) -> Self
Converts to this type from the input type.
source§impl From<usize> for PhysicalAddress
impl From<usize> for PhysicalAddress
source§impl Ord for PhysicalAddress
impl Ord for PhysicalAddress
source§fn cmp(&self, other: &PhysicalAddress) -> Ordering
fn cmp(&self, other: &PhysicalAddress) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<PhysicalAddress> for PhysicalAddress
impl PartialEq<PhysicalAddress> for PhysicalAddress
source§fn eq(&self, other: &PhysicalAddress) -> bool
fn eq(&self, other: &PhysicalAddress) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<PhysicalAddress> for PhysicalAddress
impl PartialOrd<PhysicalAddress> for PhysicalAddress
source§fn partial_cmp(&self, other: &PhysicalAddress) -> Option<Ordering>
fn partial_cmp(&self, other: &PhysicalAddress) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more