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,
impl<'a, const TS: usize, const BS: usize, const BC: usize> KernelView<'a, TS, BS, BC>where
BitsImpl<BC>: Bits,
Sourcepub fn read_range(&self, addr: u16, out: &mut [u8]) -> Result<(), ShadowError>
pub fn read_range(&self, addr: u16, out: &mut [u8]) -> Result<(), ShadowError>
Reads data from the shadow table without marking dirty.
Sourcepub fn write_range(&mut self, addr: u16, data: &[u8]) -> Result<(), ShadowError>
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.
Sourcepub fn for_each_dirty_block<F>(&self, f: F) -> Result<(), ShadowError>
pub fn for_each_dirty_block<F>(&self, f: F) -> Result<(), ShadowError>
Iterates over each dirty block, providing its address and data.
Sourcepub fn is_dirty(&self, addr: u16, len: usize) -> Result<bool, ShadowError>
pub fn is_dirty(&self, addr: u16, len: usize) -> Result<bool, ShadowError>
Returns true if any block overlapping the given range is dirty.
Sourcepub fn clear_dirty(&mut self)
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more