mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
add routines for manipulating the dirty field
This commit is contained in:
parent
769616e266
commit
250bf4553e
1 changed files with 7 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ use core::mem::size_of;
|
|||
use aes_gcm_siv::Tag;
|
||||
|
||||
use crate::PAGE_SIZE;
|
||||
use crate::SWAP_FLG_DIRTY;
|
||||
use crate::SWAP_FLG_WIRED;
|
||||
use crate::SWAPPER_PID;
|
||||
|
||||
|
|
@ -132,6 +133,12 @@ impl SwapAlloc {
|
|||
|
||||
pub fn is_wired(&self) -> bool { (self.vpn & SWAP_FLG_WIRED) != 0 }
|
||||
|
||||
pub fn set_dirty(&mut self) { self.vpn |= SWAP_FLG_DIRTY; }
|
||||
|
||||
pub fn clear_dirty(&mut self) { self.vpn &= !SWAP_FLG_DIRTY; }
|
||||
|
||||
pub fn is_dirty(&self) -> bool { self.vpn & SWAP_FLG_DIRTY == SWAP_FLG_DIRTY }
|
||||
|
||||
pub fn is_valid(&self) -> bool { self.vpn != 0 }
|
||||
|
||||
pub fn raw_pid(&self) -> u8 { self.vpn as u8 }
|
||||
|
|
|
|||
Loading…
Reference in a new issue