KernelView

Struct KernelView 

Source
pub struct KernelView<'a, const TS: usize, const BS: usize, const BC: usize>
where BitsImpl<BC>: Bits,
{ /* private fields */ }
Expand description

Hardware/kernel-side view of the shadow table.

Provides read/write access without marking blocks dirty, plus methods to query and clear dirty state. Used by hardware drivers to sync shadow data to/from actual hardware registers.

Implementations§

Source§

impl<'a, const TS: usize, const BS: usize, const BC: usize> KernelView<'a, TS, BS, BC>
where BitsImpl<BC>: Bits,

Source

pub fn read_range(&self, addr: u16, out: &mut [u8]) -> Result<(), ShadowError>

Reads data from the shadow table without marking dirty.

Source

pub fn write_range(&mut self, addr: u16, data: &[u8]) -> Result<(), ShadowError>

Writes data to the shadow table without marking dirty.

Use this to update the shadow after reading from hardware.

Source

pub fn for_each_dirty_block<F>(&self, f: F) -> Result<(), ShadowError>
where F: FnMut(u16, &[u8]) -> Result<(), ShadowError>,

Iterates over each dirty block, providing its address and data.

Source

pub fn is_dirty(&self, addr: u16, len: usize) -> Result<bool, ShadowError>

Returns true if any block overlapping the given range is dirty.

Source

pub fn any_dirty(&self) -> bool

Returns true if any block in the table is dirty.

Source

pub fn clear_dirty(&mut self)

Clears all dirty flags in the table.

Auto Trait Implementations§

§

impl<'a, const TS: usize, const BS: usize, const BC: usize> Freeze for KernelView<'a, TS, BS, BC>

§

impl<'a, const TS: usize, const BS: usize, const BC: usize> !RefUnwindSafe for KernelView<'a, TS, BS, BC>

§

impl<'a, const TS: usize, const BS: usize, const BC: usize> !Send for KernelView<'a, TS, BS, BC>

§

impl<'a, const TS: usize, const BS: usize, const BC: usize> !Sync for KernelView<'a, TS, BS, BC>

§

impl<'a, const TS: usize, const BS: usize, const BC: usize> Unpin for KernelView<'a, TS, BS, BC>

§

impl<'a, const TS: usize, const BS: usize, const BC: usize> !UnwindSafe for KernelView<'a, TS, BS, BC>

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.