#[repr(C)]pub struct PhysFrame<S: PageSize = Size4KiB> { /* private fields */ }
Expand description
A physical memory frame.
Implementations§
source§impl<S: PageSize> PhysFrame<S>
impl<S: PageSize> PhysFrame<S>
sourcepub fn from_start_address(address: PhysAddr) -> Result<Self, AddressNotAligned>
pub fn from_start_address(address: PhysAddr) -> Result<Self, AddressNotAligned>
Returns the frame that starts at the given virtual address.
Returns an error if the address is not correctly aligned (i.e. is not a valid frame start).
sourcepub const unsafe fn from_start_address_unchecked(
start_address: PhysAddr
) -> Self
pub const unsafe fn from_start_address_unchecked( start_address: PhysAddr ) -> Self
Returns the frame that starts at the given virtual address.
Safety
The address must be correctly aligned.
sourcepub fn containing_address(address: PhysAddr) -> Self
pub fn containing_address(address: PhysAddr) -> Self
Returns the frame that contains the given physical address.
sourcepub const fn start_address(self) -> PhysAddr
pub const fn start_address(self) -> PhysAddr
Returns the start address of the frame.
sourcepub const fn range(start: PhysFrame<S>, end: PhysFrame<S>) -> PhysFrameRange<S> ⓘ
pub const fn range(start: PhysFrame<S>, end: PhysFrame<S>) -> PhysFrameRange<S> ⓘ
Returns a range of frames, exclusive end
.
sourcepub const fn range_inclusive(
start: PhysFrame<S>,
end: PhysFrame<S>
) -> PhysFrameRangeInclusive<S> ⓘ
pub const fn range_inclusive( start: PhysFrame<S>, end: PhysFrame<S> ) -> PhysFrameRangeInclusive<S> ⓘ
Returns a range of frames, inclusive end
.
Trait Implementations§
source§impl<S: PageSize> AddAssign<u64> for PhysFrame<S>
impl<S: PageSize> AddAssign<u64> for PhysFrame<S>
source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
Performs the
+=
operation. Read moresource§impl<S: Ord + PageSize> Ord for PhysFrame<S>
impl<S: Ord + PageSize> Ord for PhysFrame<S>
source§impl<S: PartialOrd + PageSize> PartialOrd for PhysFrame<S>
impl<S: PartialOrd + PageSize> PartialOrd for PhysFrame<S>
source§impl<S: PageSize> SubAssign<u64> for PhysFrame<S>
impl<S: PageSize> SubAssign<u64> for PhysFrame<S>
source§fn sub_assign(&mut self, rhs: u64)
fn sub_assign(&mut self, rhs: u64)
Performs the
-=
operation. Read more