Struct x86::controlregs::Cr4
source · [−]pub struct Cr4 { /* private fields */ }
Implementations
sourceimpl Cr4
impl Cr4
sourcepub const CR4_ENABLE_PROTECTION_KEY: Self = _
pub const CR4_ENABLE_PROTECTION_KEY: Self = _
Enables use of Protection Keys (MPK).
sourcepub const CR4_ENABLE_SMAP: Self = _
pub const CR4_ENABLE_SMAP: Self = _
Enable Supervisor Mode Access Prevention.
sourcepub const CR4_ENABLE_SMEP: Self = _
pub const CR4_ENABLE_SMEP: Self = _
Enable Supervisor Mode Execution Protection.
sourcepub const CR4_ENABLE_OS_XSAVE: Self = _
pub const CR4_ENABLE_OS_XSAVE: Self = _
Enable XSAVE and Processor Extended States.
sourcepub const CR4_ENABLE_PCID: Self = _
pub const CR4_ENABLE_PCID: Self = _
Enables process-context identifiers (PCIDs).
sourcepub const CR4_ENABLE_FSGSBASE: Self = _
pub const CR4_ENABLE_FSGSBASE: Self = _
Enables the instructions RDFSBASE, RDGSBASE, WRFSBASE, and WRGSBASE.
sourcepub const CR4_ENABLE_SMX: Self = _
pub const CR4_ENABLE_SMX: Self = _
Enables Safer Mode Extensions (Trusted Execution Technology (TXT)).
sourcepub const CR4_ENABLE_VMX: Self = _
pub const CR4_ENABLE_VMX: Self = _
Enables Virtual Machine Extensions.
sourcepub const CR4_ENABLE_LA57: Self = _
pub const CR4_ENABLE_LA57: Self = _
Enables 5-Level Paging.
sourcepub const CR4_ENABLE_UMIP: Self = _
pub const CR4_ENABLE_UMIP: Self = _
Enable User-Mode Instruction Prevention (the SGDT, SIDT, SLDT, SMSW and STR instructions cannot be executed if CPL > 0).
sourcepub const CR4_UNMASKED_SSE: Self = _
pub const CR4_UNMASKED_SSE: Self = _
Enables unmasked SSE exceptions.
sourcepub const CR4_ENABLE_SSE: Self = _
pub const CR4_ENABLE_SSE: Self = _
Enables Streaming SIMD Extensions (SSE) instructions and fast FPU save & restore FXSAVE and FXRSTOR instructions.
sourcepub const CR4_ENABLE_PPMC: Self = _
pub const CR4_ENABLE_PPMC: Self = _
Enable Performance-Monitoring Counters
sourcepub const CR4_ENABLE_GLOBAL_PAGES: Self = _
pub const CR4_ENABLE_GLOBAL_PAGES: Self = _
Enable shared (PDE or PTE) address translation between address spaces.
sourcepub const CR4_ENABLE_MACHINE_CHECK: Self = _
pub const CR4_ENABLE_MACHINE_CHECK: Self = _
Enable machine check interrupts.
sourcepub const CR4_ENABLE_PAE: Self = _
pub const CR4_ENABLE_PAE: Self = _
Enable: Physical Address Extension (allows to address physical memory larger than 4 GiB).
sourcepub const CR4_ENABLE_PSE: Self = _
pub const CR4_ENABLE_PSE: Self = _
Enable Page Size Extensions (allows for pages larger than the traditional 4 KiB size) Note: If Physical Address Extension (PAE) is used, the size of large pages is reduced from 4 MiB down to 2 MiB, and PSE is always enabled, regardless of the PSE bit in CR4.
sourcepub const CR4_DEBUGGING_EXTENSIONS: Self = _
pub const CR4_DEBUGGING_EXTENSIONS: Self = _
If set, enables debug register based breaks on I/O space access.
sourcepub const CR4_TIME_STAMP_DISABLE: Self = _
pub const CR4_TIME_STAMP_DISABLE: Self = _
If set, disables ability to take time-stamps.
sourcepub const CR4_VIRTUAL_INTERRUPTS: Self = _
pub const CR4_VIRTUAL_INTERRUPTS: Self = _
If set, enables support for the virtual interrupt flag (VIF) in protected mode.
sourcepub const CR4_ENABLE_VME: Self = _
pub const CR4_ENABLE_VME: Self = _
If set, enables support for the virtual interrupt flag (VIF) in virtual-8086 mode.
sourcepub const fn from_bits(bits: usize) -> Option<Self>
pub const fn from_bits(bits: usize) -> 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: usize) -> Self
pub const fn from_bits_truncate(bits: usize) -> Self
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: usize) -> Self
pub const unsafe fn from_bits_unchecked(bits: usize) -> 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<Cr4> for Cr4
impl BitAndAssign<Cr4> for Cr4
sourcefn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Disables all flags disabled in the set.
sourceimpl BitOrAssign<Cr4> for Cr4
impl BitOrAssign<Cr4> for Cr4
sourcefn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Adds the set of flags.
sourceimpl BitXorAssign<Cr4> for Cr4
impl BitXorAssign<Cr4> for Cr4
sourcefn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Toggles the set of flags.
sourceimpl Extend<Cr4> for Cr4
impl Extend<Cr4> for Cr4
sourcefn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)sourceimpl FromIterator<Cr4> for Cr4
impl FromIterator<Cr4> for Cr4
sourcefn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
sourceimpl Ord for Cr4
impl Ord for Cr4
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl PartialOrd<Cr4> for Cr4
impl PartialOrd<Cr4> for Cr4
sourcefn partial_cmp(&self, other: &Cr4) -> Option<Ordering>
fn partial_cmp(&self, other: &Cr4) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl SubAssign<Cr4> for Cr4
impl SubAssign<Cr4> for Cr4
sourcefn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Disables all flags enabled in the set.