Skip to main content

PhysFrame

Struct PhysFrame 

Source
pub struct PhysFrame<H: AxMmHal> { /* private fields */ }
Expand description

A physical frame which will be automatically deallocated when dropped.

The frame is allocated using the AxMmHal implementation. The size of the frame is likely to be 4 KiB but the actual size is determined by the AxMmHal implementation.

Implementations§

Source§

impl<H: AxMmHal> PhysFrame<H>

Source

pub fn alloc() -> AxResult<Self>

Allocate a PhysFrame.

Source

pub fn alloc_zero() -> AxResult<Self>

Allocate a PhysFrame and fill it with zeros.

Source

pub const unsafe fn uninit() -> Self

Create an uninitialized PhysFrame.

§Safety

The caller must ensure that the PhysFrame is only used as a placeholder and never accessed.

Source

pub fn start_paddr(&self) -> HostPhysAddr

Get the starting physical address of the frame.

Source

pub fn as_mut_ptr(&self) -> *mut u8

Get a mutable pointer to the frame.

Source

pub fn fill(&mut self, byte: u8)

Fill the frame with a byte. Works only when the frame is 4 KiB in size.

Trait Implementations§

Source§

impl<H: Debug + AxMmHal> Debug for PhysFrame<H>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<H: AxMmHal> Drop for PhysFrame<H>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<H> Freeze for PhysFrame<H>

§

impl<H> RefUnwindSafe for PhysFrame<H>
where H: RefUnwindSafe,

§

impl<H> Send for PhysFrame<H>
where H: Send,

§

impl<H> Sync for PhysFrame<H>
where H: Sync,

§

impl<H> Unpin for PhysFrame<H>
where H: Unpin,

§

impl<H> UnsafeUnpin for PhysFrame<H>

§

impl<H> UnwindSafe for PhysFrame<H>
where H: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.