pub struct IOAddr(pub u64);
Expand description
A wrapper for an IO address (IOVA / DMA Address for devices)
Tuple Fields§
§0: u64
Implementations§
source§impl IOAddr
impl IOAddr
sourcepub fn base_page_offset(self) -> u64
pub fn base_page_offset(self) -> u64
Offset within the 4 KiB page.
sourcepub fn large_page_offset(self) -> u64
pub fn large_page_offset(self) -> u64
Offset within the 2 MiB page.
sourcepub fn huge_page_offset(self) -> u64
pub fn huge_page_offset(self) -> u64
Offset within the 1 GiB page.
sourcepub fn align_down_to_base_page(self) -> IOAddr
pub fn align_down_to_base_page(self) -> IOAddr
Return address of nearest 4 KiB page (lower or equal than self).
sourcepub fn align_down_to_large_page(self) -> IOAddr
pub fn align_down_to_large_page(self) -> IOAddr
Return address of nearest 2 MiB page (lower or equal than self).
sourcepub fn align_down_to_huge_page(self) -> IOAddr
pub fn align_down_to_huge_page(self) -> IOAddr
Return address of nearest 1 GiB page (lower or equal than self).
sourcepub fn align_up_to_base_page(self) -> IOAddr
pub fn align_up_to_base_page(self) -> IOAddr
Return address of nearest 4 KiB page (higher or equal than self).
sourcepub fn align_up_to_large_page(self) -> IOAddr
pub fn align_up_to_large_page(self) -> IOAddr
Return address of nearest 2 MiB page (higher or equal than self).
sourcepub fn align_up_to_huge_page(self) -> IOAddr
pub fn align_up_to_huge_page(self) -> IOAddr
Return address of nearest 1 GiB page (higher or equal than self).
sourcepub fn is_base_page_aligned(self) -> bool
pub fn is_base_page_aligned(self) -> bool
Is this address aligned to a 4 KiB page?
sourcepub fn is_large_page_aligned(self) -> bool
pub fn is_large_page_aligned(self) -> bool
Is this address aligned to a 2 MiB page?
sourcepub fn is_huge_page_aligned(self) -> bool
pub fn is_huge_page_aligned(self) -> bool
Is this address aligned to a 1 GiB page?
Trait Implementations§
source§impl AddAssign<IOAddr> for IOAddr
impl AddAssign<IOAddr> for IOAddr
source§fn add_assign(&mut self, other: IOAddr)
fn add_assign(&mut self, other: IOAddr)
Performs the
+=
operation. Read moresource§impl AddAssign<u64> for IOAddr
impl AddAssign<u64> for IOAddr
source§fn add_assign(&mut self, offset: u64)
fn add_assign(&mut self, offset: u64)
Performs the
+=
operation. Read moresource§impl Ord for IOAddr
impl Ord for IOAddr
source§impl PartialEq<IOAddr> for IOAddr
impl PartialEq<IOAddr> for IOAddr
source§impl PartialOrd<IOAddr> for IOAddr
impl PartialOrd<IOAddr> for IOAddr
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 moresource§impl Step for IOAddr
impl Step for IOAddr
source§fn steps_between(start: &IOAddr, end: &IOAddr) -> Option<usize>
fn steps_between(start: &IOAddr, end: &IOAddr) -> Option<usize>
🔬This is a nightly-only experimental API. (
step_trait
)source§fn forward_checked(start: IOAddr, count: usize) -> Option<IOAddr>
fn forward_checked(start: IOAddr, count: usize) -> Option<IOAddr>
🔬This is a nightly-only experimental API. (
step_trait
)source§fn backward_checked(start: IOAddr, count: usize) -> Option<IOAddr>
fn backward_checked(start: IOAddr, count: usize) -> Option<IOAddr>
🔬This is a nightly-only experimental API. (
step_trait
)source§fn forward(start: Self, count: usize) -> Self
fn forward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)source§unsafe fn forward_unchecked(start: Self, count: usize) -> Self
unsafe fn forward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)source§fn backward(start: Self, count: usize) -> Self
fn backward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)source§unsafe fn backward_unchecked(start: Self, count: usize) -> Self
unsafe fn backward_unchecked(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (
step_trait
)