// source: fs/proc/task_mmu.c
bitflags! { /// Represents the fields and flags in a page table entry for a swapped page. #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, PartialOrd, Ord)] pubstruct SwapPageFlags: u64 { /// Swap type if swapped #[doc(hidden)] const SWAP_TYPE = genmask(MAX_SWAPFILES_SHIFT - 1, 0); /// Swap offset if swapped #[doc(hidden)] const SWAP_OFFSET = genmask(54, MAX_SWAPFILES_SHIFT); /// PTE is soft-dirty const SOFT_DIRTY = 1 << 55; /// Page is exclusively mapped const MMAP_EXCLUSIVE = 1 << 56; /// Page is file-page or shared-anon const FILE = 1 << 61; /// Page is swapped #[doc(hidden)] const SWAP = 1 << 62; /// Page is present const PRESENT = 1 << 63;
}
}
impl SwapPageFlags { /// Returns the swap type recorded in this entry. pubfn get_swap_type(&self) -> u64 {
(*self & Self::SWAP_TYPE).bits()
}
/// Returns the swap offset recorded in this entry. pubfn get_swap_offset(&self) -> u64 {
(*self & Self::SWAP_OFFSET).bits() >> MAX_SWAPFILES_SHIFT
}
}
bitflags! { /// Represents the fields and flags in a page table entry for a memory page. #[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))] #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, PartialOrd, Ord)] pubstruct MemoryPageFlags: u64 { /// Page frame number if present #[doc(hidden)] const PFN = genmask(54, 0); /// PTE is soft-dirty const SOFT_DIRTY = 1 << 55; /// Page is exclusively mapped const MMAP_EXCLUSIVE = 1 << 56; /// Page is file-page or shared-anon const FILE = 1 << 61; /// Page is swapped #[doc(hidden)] const SWAP = 1 << 62; /// Page is present const PRESENT = 1 << 63;
}
}
impl MemoryPageFlags { /// Returns the page frame number recorded in this entry. pubfn get_page_frame_number(&self) -> Pfn {
Pfn((*self & Self::PFN).bits())
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.