StaleTLBEntry

Struct StaleTLBEntry 

Source
pub struct StaleTLBEntry(Va, Page);
Expand description

Struct for invalidating the TLB (Translation Lookaside Buffer) entry.

This struct is responsible for invalidating a TLB entry associated with a specific virtual address (Va). TLB entries are cached mappings between virtual addresses and physical addresses, and they need to be invalidated when the corresponding page table entries are modified or removed.

This struct provides methods for invalidating the TLB entry and safely forgetting the modification. This internally holds the page to be invalidated, to delay the free until the tlb entry is invalidated.

Tuple Fields§

§0: Va§1: Page

Implementations§

Source§

impl StaleTLBEntry

Source

pub fn new(va: Va, page: Page) -> Self

Create a new StaleTLBEntry.

Source

pub fn invalidate(self) -> Page

Invalidate the underlying virtual address.

This method issues an assembly instruction to invalidate the TLB entry corresponding to the given virtual address. The invalidation ensures that any cached translations are cleared and that the system will use the updated page table entries for subsequent address lookups.

Methods from Deref<Target = Page>§

Source

pub fn kva(&self) -> Kva

Get the kernel virtual address of this page.

§Returns
  • The kernel virtual address (Kva) of the page.
Source

pub fn pa(&self) -> Pa

Get the physical address of this page.

§Returns
  • The physical address (Pa) of the page.
Source

pub fn inner(&self) -> &[u8]

Get a reference to the underlying slice of the page (read-only).

This method allows access to the contents of the page as a byte slice. The caller can read from the page’s memory, but cannot modify it.

§Returns
  • A reference to the byte slice representing the contents of the page.
Source

pub fn inner_mut(&mut self) -> &mut [u8]

Get a mutable reference to the underlying slice of the page.

This method allows modification of the contents of the page as a byte slice. The caller can read from and write to the page’s memory.

§Returns
  • A mutable reference to the byte slice representing the contents of the page.

Trait Implementations§

Source§

impl Deref for StaleTLBEntry

Source§

type Target = Page

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for StaleTLBEntry

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl Drop for StaleTLBEntry

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for StaleTLBEntry

§

impl RefUnwindSafe for StaleTLBEntry

§

impl Send for StaleTLBEntry

§

impl Sync for StaleTLBEntry

§

impl Unpin for StaleTLBEntry

§

impl UnwindSafe for StaleTLBEntry

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.