add helper to extract vaddr prefixes (used by swapper to fliter candidates)

This commit is contained in:
bunnie 2024-05-21 03:46:29 +08:00
parent 751042e202
commit a57945e2c0

View file

@ -162,6 +162,8 @@ impl SwapAlloc {
pub fn vaddr(&self) -> usize { (self.vpn & !0xFFFu32) as usize }
pub fn vaddr_prefix(&self) -> u8 { (self.vpn >> 24) as u8 }
pub fn raw_vpn(&self) -> u32 { self.vpn }
pub fn timestamp(&self) -> u32 { self.timestamp }