pub struct Cr4Flags(/* private fields */);
Expand description
Configuration flags of the Cr4
register.
Implementations§
Source§impl Cr4Flags
impl Cr4Flags
Sourcepub const VIRTUAL_8086_MODE_EXTENSIONS: Self = _
pub const VIRTUAL_8086_MODE_EXTENSIONS: Self = _
Enables hardware-supported performance enhancements for software running in virtual-8086 mode.
Sourcepub const PROTECTED_MODE_VIRTUAL_INTERRUPTS: Self = _
pub const PROTECTED_MODE_VIRTUAL_INTERRUPTS: Self = _
Enables support for protected-mode virtual interrupts.
Sourcepub const TIMESTAMP_DISABLE: Self = _
pub const TIMESTAMP_DISABLE: Self = _
When set, only privilege-level 0 can execute the RDTSC
or RDTSCP
instructions.
Sourcepub const DEBUGGING_EXTENSIONS: Self = _
pub const DEBUGGING_EXTENSIONS: Self = _
Enables I/O breakpoint capability and enforces treatment of DR4
and DR5
registers
as reserved.
Sourcepub const PAGE_SIZE_EXTENSION: Self = _
pub const PAGE_SIZE_EXTENSION: Self = _
Enables the use of 4MB physical frames; ignored if
PHYSICAL_ADDRESS_EXTENSION
is set (so always ignored in long mode).
Sourcepub const PHYSICAL_ADDRESS_EXTENSION: Self = _
pub const PHYSICAL_ADDRESS_EXTENSION: Self = _
Enables physical address extensions and 2MB physical frames. Required in long mode.
Sourcepub const MACHINE_CHECK_EXCEPTION: Self = _
pub const MACHINE_CHECK_EXCEPTION: Self = _
Enables the machine-check exception mechanism.
Sourcepub const PAGE_GLOBAL: Self = _
pub const PAGE_GLOBAL: Self = _
Enables the global page feature, allowing some page translations to
be marked as global (see [PageTableFlags::GLOBAL
]).
Sourcepub const PERFORMANCE_MONITOR_COUNTER: Self = _
pub const PERFORMANCE_MONITOR_COUNTER: Self = _
Allows software running at any privilege level to use the RDPMC
instruction.
Sourcepub const OSFXSR: Self = _
pub const OSFXSR: Self = _
Enables the use of legacy SSE instructions; allows using FXSAVE
/FXRSTOR
for saving
processor state of 128-bit media instructions.
Sourcepub const OSXMMEXCPT_ENABLE: Self = _
pub const OSXMMEXCPT_ENABLE: Self = _
Enables the SIMD floating-point exception (#XF
) for handling unmasked 256-bit and
128-bit media floating-point errors.
Sourcepub const USER_MODE_INSTRUCTION_PREVENTION: Self = _
pub const USER_MODE_INSTRUCTION_PREVENTION: Self = _
Prevents the execution of the SGDT
, SIDT
, SLDT
, SMSW
, and STR
instructions by
user-mode software.
Sourcepub const VIRTUAL_MACHINE_EXTENSIONS: Self = _
pub const VIRTUAL_MACHINE_EXTENSIONS: Self = _
Enables VMX instructions (Intel Only).
Sourcepub const SAFER_MODE_EXTENSIONS: Self = _
pub const SAFER_MODE_EXTENSIONS: Self = _
Enables SMX instructions (Intel Only).
Sourcepub const FSGSBASE: Self = _
pub const FSGSBASE: Self = _
Enables software running in 64-bit mode at any privilege level to read and write the FS.base and GS.base hidden segment register state.
Sourcepub const OSXSAVE: Self = _
pub const OSXSAVE: Self = _
Enables extended processor state management instructions, including XGETBV
and XSAVE
.
Sourcepub const KEY_LOCKER: Self = _
pub const KEY_LOCKER: Self = _
Enables the Key Locker feature (Intel Only).
This enables creation and use of opaque AES key handles; see the Intel Key Locker Specification for more information.
Sourcepub const SUPERVISOR_MODE_EXECUTION_PROTECTION: Self = _
pub const SUPERVISOR_MODE_EXECUTION_PROTECTION: Self = _
Prevents the execution of instructions that reside in pages accessible by user-mode software when the processor is in supervisor-mode.
Sourcepub const SUPERVISOR_MODE_ACCESS_PREVENTION: Self = _
pub const SUPERVISOR_MODE_ACCESS_PREVENTION: Self = _
Enables restrictions for supervisor-mode software when reading data from user-mode pages.
Sourcepub const PROTECTION_KEY_USER: Self = _
pub const PROTECTION_KEY_USER: Self = _
Enables protection keys for user-mode pages.
Also enables access to the PKRU register (via the RDPKRU
/WRPKRU
instructions) to set user-mode protection key access controls.
Sourcepub const CONTROL_FLOW_ENFORCEMENT: Self = _
pub const CONTROL_FLOW_ENFORCEMENT: Self = _
Enables Control-flow Enforcement Technology (CET)
This enables the shadow stack feature, ensuring return addresses read
via RET
and IRET
have not been corrupted.
Sourcepub const PROTECTION_KEY_SUPERVISOR: Self = _
pub const PROTECTION_KEY_SUPERVISOR: Self = _
Enables protection keys for supervisor-mode pages (Intel Only).
Also enables the IA32_PKRS
MSR to set supervisor-mode protection
key access controls.
Source§impl Cr4Flags
impl Cr4Flags
Sourcepub 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.
Sourcepub const fn from_bits(bits: u64) -> Option<Self>
pub const fn from_bits(bits: u64) -> Option<Self>
Convert from a bits value.
This method will return None
if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u64) -> Self
pub const fn from_bits_truncate(bits: u64) -> Self
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u64) -> Self
pub const fn from_bits_retain(bits: u64) -> Self
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
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.
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn remove(&mut self, other: Self)
pub fn remove(&mut self, other: Self)
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.
Sourcepub fn toggle(&mut self, other: Self)
pub fn toggle(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
The bitwise and (&
) of the bits in two flags values.
Sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
The bitwise or (|
) of the bits in two flags values.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
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.
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
The bitwise negation (!
) of the bits in a flags value, truncating the result.
Source§impl Cr4Flags
impl Cr4Flags
Sourcepub const fn iter(&self) -> Iter<Cr4Flags>
pub const fn iter(&self) -> Iter<Cr4Flags>
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.
Sourcepub const fn iter_names(&self) -> IterNames<Cr4Flags>
pub const fn iter_names(&self) -> IterNames<Cr4Flags>
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§
Source§impl BitAndAssign for Cr4Flags
impl BitAndAssign for Cr4Flags
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
The bitwise and (&
) of the bits in two flags values.
Source§impl BitOrAssign for Cr4Flags
impl BitOrAssign for Cr4Flags
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
The bitwise or (|
) of the bits in two flags values.
Source§impl BitXorAssign for Cr4Flags
impl BitXorAssign for Cr4Flags
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
Source§impl Extend<Cr4Flags> for Cr4Flags
impl Extend<Cr4Flags> for Cr4Flags
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
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
)Source§impl Flags for Cr4Flags
impl Flags for Cr4Flags
Source§fn from_bits_retain(bits: u64) -> Cr4Flags
fn from_bits_retain(bits: u64) -> Cr4Flags
Source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
Source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
Source§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
Source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
Source§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.Source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read moreSource§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.Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read moreSource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.Source§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.Source§impl FromIterator<Cr4Flags> for Cr4Flags
impl FromIterator<Cr4Flags> for Cr4Flags
Source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
The bitwise or (|
) of the bits in each flags value.
Source§impl IntoIterator for Cr4Flags
impl IntoIterator for Cr4Flags
Source§impl Ord for Cr4Flags
impl Ord for Cr4Flags
Source§impl PartialOrd for Cr4Flags
impl PartialOrd for Cr4Flags
Source§impl Sub for Cr4Flags
impl Sub for Cr4Flags
Source§impl SubAssign for Cr4Flags
impl SubAssign for Cr4Flags
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
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.