Struct PTF
pub struct PTF(/* private fields */);
Expand description
Possible flags for a page table entry.
Implementations§
§impl PageTableFlags
impl PageTableFlags
pub const PRESENT: PageTableFlags = _
pub const PRESENT: PageTableFlags = _
Specifies whether the mapped frame or page table is loaded in memory.
pub const WRITABLE: PageTableFlags = _
pub const WRITABLE: PageTableFlags = _
Controls whether writes to the mapped frames are allowed.
If this bit is unset in a level 1 page table entry, the mapped frame is read-only. If this bit is unset in a higher level page table entry the complete range of mapped pages is read-only.
pub const USER_ACCESSIBLE: PageTableFlags = _
pub const USER_ACCESSIBLE: PageTableFlags = _
Controls whether accesses from userspace (i.e. ring 3) are permitted.
pub const WRITE_THROUGH: PageTableFlags = _
pub const WRITE_THROUGH: PageTableFlags = _
If this bit is set, a “write-through” policy is used for the cache, else a “write-back” policy is used.
pub const NO_CACHE: PageTableFlags = _
pub const NO_CACHE: PageTableFlags = _
Disables caching for the pointed entry is cacheable.
pub const ACCESSED: PageTableFlags = _
pub const ACCESSED: PageTableFlags = _
Set by the CPU when the mapped frame or page table is accessed.
pub const DIRTY: PageTableFlags = _
pub const DIRTY: PageTableFlags = _
Set by the CPU on a write to the mapped frame.
pub const HUGE_PAGE: PageTableFlags = _
pub const HUGE_PAGE: PageTableFlags = _
Specifies that the entry maps a huge frame instead of a page table. Only allowed in P2 or P3 tables.
pub const GLOBAL: PageTableFlags = _
pub const GLOBAL: PageTableFlags = _
Indicates that the mapping is present in all address spaces, so it isn’t flushed from the TLB on an address space switch.
pub const BIT_9: PageTableFlags = _
pub const BIT_9: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const BIT_10: PageTableFlags = _
pub const BIT_10: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const BIT_11: PageTableFlags = _
pub const BIT_11: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const BIT_52: PageTableFlags = _
pub const BIT_52: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const BIT_53: PageTableFlags = _
pub const BIT_53: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const BIT_54: PageTableFlags = _
pub const BIT_54: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const BIT_55: PageTableFlags = _
pub const BIT_55: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const BIT_56: PageTableFlags = _
pub const BIT_56: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const BIT_57: PageTableFlags = _
pub const BIT_57: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const BIT_58: PageTableFlags = _
pub const BIT_58: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const BIT_59: PageTableFlags = _
pub const BIT_59: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const BIT_60: PageTableFlags = _
pub const BIT_60: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const BIT_61: PageTableFlags = _
pub const BIT_61: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const BIT_62: PageTableFlags = _
pub const BIT_62: PageTableFlags = _
Available to the OS, can be used to store additional data, e.g. custom flags.
pub const NO_EXECUTE: PageTableFlags = _
pub const NO_EXECUTE: PageTableFlags = _
Forbid code execution from the mapped frames.
Can be only used when the no-execute page protection feature is enabled in the EFER register.
§impl PageTableFlags
impl PageTableFlags
pub const fn empty() -> PageTableFlags
pub const fn empty() -> PageTableFlags
Get a flags value with all bits unset.
pub const fn all() -> PageTableFlags
pub const fn all() -> PageTableFlags
Get a flags value with all known bits set.
pub const fn bits(&self) -> u64
pub const fn bits(&self) -> u64
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
pub const fn from_bits(bits: u64) -> Option<PageTableFlags>
pub const fn from_bits(bits: u64) -> Option<PageTableFlags>
Convert from a bits value.
This method will return None
if any unknown bits are set.
pub const fn from_bits_truncate(bits: u64) -> PageTableFlags
pub const fn from_bits_truncate(bits: u64) -> PageTableFlags
Convert from a bits value, unsetting any unknown bits.
pub const fn from_bits_retain(bits: u64) -> PageTableFlags
pub const fn from_bits_retain(bits: u64) -> PageTableFlags
Convert from a bits value exactly.
pub fn from_name(name: &str) -> Option<PageTableFlags>
pub fn from_name(name: &str) -> Option<PageTableFlags>
Get a flags value with the bits of a flag with the given name set.
This method will return None
if name
is empty or doesn’t
correspond to any named flag.
pub const fn intersects(&self, other: PageTableFlags) -> bool
pub const fn intersects(&self, other: PageTableFlags) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
pub const fn contains(&self, other: PageTableFlags) -> bool
pub const fn contains(&self, other: PageTableFlags) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
pub fn insert(&mut self, other: PageTableFlags)
pub fn insert(&mut self, other: PageTableFlags)
The bitwise or (|
) of the bits in two flags values.
pub fn remove(&mut self, other: PageTableFlags)
pub fn remove(&mut self, other: PageTableFlags)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
remove
won’t truncate other
, but the !
operator will.
pub fn toggle(&mut self, other: PageTableFlags)
pub fn toggle(&mut self, other: PageTableFlags)
The bitwise exclusive-or (^
) of the bits in two flags values.
pub fn set(&mut self, other: PageTableFlags, value: bool)
pub fn set(&mut self, other: PageTableFlags, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
pub const fn intersection(self, other: PageTableFlags) -> PageTableFlags
pub const fn intersection(self, other: PageTableFlags) -> PageTableFlags
The bitwise and (&
) of the bits in two flags values.
pub const fn union(self, other: PageTableFlags) -> PageTableFlags
pub const fn union(self, other: PageTableFlags) -> PageTableFlags
The bitwise or (|
) of the bits in two flags values.
pub const fn difference(self, other: PageTableFlags) -> PageTableFlags
pub const fn difference(self, other: PageTableFlags) -> PageTableFlags
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
pub const fn symmetric_difference(self, other: PageTableFlags) -> PageTableFlags
pub const fn symmetric_difference(self, other: PageTableFlags) -> PageTableFlags
The bitwise exclusive-or (^
) of the bits in two flags values.
pub const fn complement(self) -> PageTableFlags
pub const fn complement(self) -> PageTableFlags
The bitwise negation (!
) of the bits in a flags value, truncating the result.
§impl PageTableFlags
impl PageTableFlags
pub const fn iter(&self) -> Iter<PageTableFlags>
pub const fn iter(&self) -> Iter<PageTableFlags>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
pub const fn iter_names(&self) -> IterNames<PageTableFlags>
pub const fn iter_names(&self) -> IterNames<PageTableFlags>
Yield a set of contained named flags values.
This method is like iter
, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait Implementations§
§impl Binary for PageTableFlags
impl Binary for PageTableFlags
§impl BitAnd for PageTableFlags
impl BitAnd for PageTableFlags
§fn bitand(self, other: PageTableFlags) -> PageTableFlags
fn bitand(self, other: PageTableFlags) -> PageTableFlags
The bitwise and (&
) of the bits in two flags values.
§type Output = PageTableFlags
type Output = PageTableFlags
&
operator.§impl BitAndAssign for PageTableFlags
impl BitAndAssign for PageTableFlags
§fn bitand_assign(&mut self, other: PageTableFlags)
fn bitand_assign(&mut self, other: PageTableFlags)
The bitwise and (&
) of the bits in two flags values.
§impl BitOr for PageTableFlags
impl BitOr for PageTableFlags
§fn bitor(self, other: PageTableFlags) -> PageTableFlags
fn bitor(self, other: PageTableFlags) -> PageTableFlags
The bitwise or (|
) of the bits in two flags values.
§type Output = PageTableFlags
type Output = PageTableFlags
|
operator.§impl BitOrAssign for PageTableFlags
impl BitOrAssign for PageTableFlags
§fn bitor_assign(&mut self, other: PageTableFlags)
fn bitor_assign(&mut self, other: PageTableFlags)
The bitwise or (|
) of the bits in two flags values.
§impl BitXor for PageTableFlags
impl BitXor for PageTableFlags
§fn bitxor(self, other: PageTableFlags) -> PageTableFlags
fn bitxor(self, other: PageTableFlags) -> PageTableFlags
The bitwise exclusive-or (^
) of the bits in two flags values.
§type Output = PageTableFlags
type Output = PageTableFlags
^
operator.§impl BitXorAssign for PageTableFlags
impl BitXorAssign for PageTableFlags
§fn bitxor_assign(&mut self, other: PageTableFlags)
fn bitxor_assign(&mut self, other: PageTableFlags)
The bitwise exclusive-or (^
) of the bits in two flags values.
§impl Clone for PageTableFlags
impl Clone for PageTableFlags
§fn clone(&self) -> PageTableFlags
fn clone(&self) -> PageTableFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for PageTableFlags
impl Debug for PageTableFlags
§impl Extend<PageTableFlags> for PageTableFlags
impl Extend<PageTableFlags> for PageTableFlags
§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = PageTableFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = PageTableFlags>,
The bitwise or (|
) of the bits in each flags value.
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)§impl Flags for PageTableFlags
impl Flags for PageTableFlags
§const FLAGS: &'static [Flag<PageTableFlags>] = _
const FLAGS: &'static [Flag<PageTableFlags>] = _
§fn from_bits_retain(bits: u64) -> PageTableFlags
fn from_bits_retain(bits: u64) -> PageTableFlags
§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|
) of the bits in two flags values.§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read more§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^
) of the bits in two flags values.§fn set(&mut self, other: Self, value: bool)where
Self: Sized,
fn set(&mut self, other: Self, value: bool)where
Self: Sized,
Flags::insert
] when value
is true
or [Flags::remove
] when value
is false
.§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read more§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.Source§impl From<MappingFlags> for PTF
impl From<MappingFlags> for PTF
Source§fn from(f: MappingFlags) -> Self
fn from(f: MappingFlags) -> Self
Source§impl From<PageTableFlags> for MappingFlags
impl From<PageTableFlags> for MappingFlags
§impl FromIterator<PageTableFlags> for PageTableFlags
impl FromIterator<PageTableFlags> for PageTableFlags
§fn from_iter<T>(iterator: T) -> PageTableFlagswhere
T: IntoIterator<Item = PageTableFlags>,
fn from_iter<T>(iterator: T) -> PageTableFlagswhere
T: IntoIterator<Item = PageTableFlags>,
The bitwise or (|
) of the bits in each flags value.
§impl Hash for PageTableFlags
impl Hash for PageTableFlags
§impl IntoIterator for PageTableFlags
impl IntoIterator for PageTableFlags
§type Item = PageTableFlags
type Item = PageTableFlags
§type IntoIter = Iter<PageTableFlags>
type IntoIter = Iter<PageTableFlags>
§fn into_iter(self) -> <PageTableFlags as IntoIterator>::IntoIter
fn into_iter(self) -> <PageTableFlags as IntoIterator>::IntoIter
§impl LowerHex for PageTableFlags
impl LowerHex for PageTableFlags
§impl Not for PageTableFlags
impl Not for PageTableFlags
§fn not(self) -> PageTableFlags
fn not(self) -> PageTableFlags
The bitwise negation (!
) of the bits in a flags value, truncating the result.
§type Output = PageTableFlags
type Output = PageTableFlags
!
operator.§impl Octal for PageTableFlags
impl Octal for PageTableFlags
§impl Ord for PageTableFlags
impl Ord for PageTableFlags
§impl PartialEq for PageTableFlags
impl PartialEq for PageTableFlags
§impl PartialOrd for PageTableFlags
impl PartialOrd for PageTableFlags
§impl Sub for PageTableFlags
impl Sub for PageTableFlags
§fn sub(self, other: PageTableFlags) -> PageTableFlags
fn sub(self, other: PageTableFlags) -> PageTableFlags
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
§type Output = PageTableFlags
type Output = PageTableFlags
-
operator.§impl SubAssign for PageTableFlags
impl SubAssign for PageTableFlags
§fn sub_assign(&mut self, other: PageTableFlags)
fn sub_assign(&mut self, other: PageTableFlags)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.