pub struct Cr4Flags { /* private fields */ }
Expand description
Configuration flags of the Cr4
register.
Implementations
sourceimpl 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 PROTECTION_KEY: Self
👎 Deprecated since 0.14.5: use PROTECTION_KEY_USER
instead
pub const PROTECTION_KEY: Self
use PROTECTION_KEY_USER
instead
Alias for PROTECTION_KEY_USER
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.
sourcepub const fn from_bits(bits: u64) -> Option<Self>
pub const fn from_bits(bits: u64) -> Option<Self>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: u64) -> Self
pub const fn from_bits_truncate(bits: u64) -> Self
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u64) -> Self
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Safety
The caller of the bitflags!
macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked()
has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Returns true
if all of the flags in other
are contained within self
.
sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Inserts or removes the specified flags depending on the passed value.
sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both (see Self::symmetric_difference
if that
is undesirable).
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
Returns the symmetric difference between the flags
in self
and other
.
Specifically, the returned set contains the flags present which
are present in self
or other
, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self
and other
.
This is equivalent to using the ^
operator (e.g.
ops::BitXor
), as in flags ^ other
.
sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self
, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all()
and self
(e.g. Self::all() - self
)
This is equivalent to using the !
operator (e.g.
ops::Not
), as in !flags
.
Trait Implementations
sourceimpl BitAndAssign<Cr4Flags> for Cr4Flags
impl BitAndAssign<Cr4Flags> for Cr4Flags
sourcefn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Disables all flags disabled in the set.
sourceimpl BitOrAssign<Cr4Flags> for Cr4Flags
impl BitOrAssign<Cr4Flags> for Cr4Flags
sourcefn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Adds the set of flags.
sourceimpl BitXorAssign<Cr4Flags> for Cr4Flags
impl BitXorAssign<Cr4Flags> for Cr4Flags
sourcefn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Toggles the set of flags.
sourceimpl Extend<Cr4Flags> for Cr4Flags
impl Extend<Cr4Flags> for Cr4Flags
sourcefn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl FromIterator<Cr4Flags> for Cr4Flags
impl FromIterator<Cr4Flags> for Cr4Flags
sourcefn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
Creates a value from an iterator. Read more
sourceimpl Ord for Cr4Flags
impl Ord for Cr4Flags
sourceimpl PartialOrd<Cr4Flags> for Cr4Flags
impl PartialOrd<Cr4Flags> for Cr4Flags
sourcefn partial_cmp(&self, other: &Cr4Flags) -> Option<Ordering>
fn partial_cmp(&self, other: &Cr4Flags) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl SubAssign<Cr4Flags> for Cr4Flags
impl SubAssign<Cr4Flags> for Cr4Flags
sourcefn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Disables all flags enabled in the set.
impl Copy for Cr4Flags
impl Eq for Cr4Flags
impl StructuralEq for Cr4Flags
impl StructuralPartialEq for Cr4Flags
Auto Trait Implementations
impl RefUnwindSafe for Cr4Flags
impl Send for Cr4Flags
impl Sync for Cr4Flags
impl Unpin for Cr4Flags
impl UnwindSafe for Cr4Flags
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more