Struct tartan_arch::x86_common::ControlRegister4
source · pub struct ControlRegister4(/* private fields */);
Expand description
Implementations§
source§impl ControlRegister4
impl ControlRegister4
sourcepub fn virtual_8086_extensions(&self) -> bool
pub fn virtual_8086_extensions(&self) -> bool
CR4.VME
: Enable interrupts and exception handling in virtual
real-mode.
Requires BasicFeatures::virtual_8086_extensions
.
sourcepub fn protected_virtual_interrupts(&self) -> bool
pub fn protected_virtual_interrupts(&self) -> bool
CR4.PVI
: Enable virtual interrupts in protected mode.
Requires BasicFeatures::virtual_8086_extensions
.
sourcepub fn timestamp_disabled(&self) -> bool
pub fn timestamp_disabled(&self) -> bool
CR4.TSD
: Disable access to processor timestamp counter except in privilege
level 0.
Requires [BasicFeatures::timestamp_counter
].
sourcepub fn debugging_extensions(&self) -> bool
pub fn debugging_extensions(&self) -> bool
CR4.DE
: Enable newer debug register scheme where DR4
and DR5
are
unavailable.
When this flag is clear, they are equivalent to DR6
and DR7
.
Requires BasicFeatures::debugging_extensions
.
sourcepub fn page_size_extensions(&self) -> bool
pub fn page_size_extensions(&self) -> bool
CR4.PSE
: Support large pages (4MB). Applies to 32-bit mode only.
When this flag is clear in 32-bit mode, pages are always 4KB. Large pages are always enabled in 64-bit mode.
Requires [BasicFeatures::page_size_extensions
].
sourcepub fn physical_address_extension(&self) -> bool
pub fn physical_address_extension(&self) -> bool
CR4.PAE
: Enable pages to map to physical addresses larger than 32-bits.
Required for 64-bit mode.
sourcepub fn machine_check_exception(&self) -> bool
pub fn machine_check_exception(&self) -> bool
CR4.MCE
: Enable machine-check exception.
Requires BasicFeatures::machine_check_exception
.
sourcepub fn global_pages(&self) -> bool
pub fn global_pages(&self) -> bool
CR4.PGE
: Enable global pages, which are shared across task contexts.
Requires BasicFeatures::global_pages
.
sourcepub fn performance_counter(&self) -> bool
pub fn performance_counter(&self) -> bool
CR4.PCE
: Allow access to performance monitoring counter in privilege levels
1–3 (always accessible in level 0).
sourcepub fn sse_and_fpu_save(&self) -> bool
pub fn sse_and_fpu_save(&self) -> bool
CR4.OSFXSR
: Enable the FXSAVE
/FXRSTOR
and SSE instructions, if present.
These instructions require special support from the operating system.
Requires BasicFeatures::fpu_save
.
sourcepub fn simd_exceptions(&self) -> bool
pub fn simd_exceptions(&self) -> bool
CR4.OSXMMEXCPT
: Enable unmasked SIMD floating-point exception handling for
SSE instructions.
This requires special support from the operating system.
sourcepub fn restrict_user_mode_instructions(&self) -> bool
pub fn restrict_user_mode_instructions(&self) -> bool
CR4.UMIP
: Prevent access to instructions that allow reads from
descriptor/task registers, except in privilege level 0.
sourcepub fn five_level_paging(&self) -> bool
Available on x86-64 only.
pub fn five_level_paging(&self) -> bool
CR4.LA57
: Support 57-bit addresses using 5-level paging in 64-bit mode.
sourcepub fn virtual_machine_extensions(&self) -> bool
pub fn virtual_machine_extensions(&self) -> bool
CR4.VMX
(Intel-only): Enable virtual machine extensions.
sourcepub fn safer_mode_extensions(&self) -> bool
pub fn safer_mode_extensions(&self) -> bool
CR4.SME
(Intel-only): Enable safer-mode extensions.
Requires BasicFeatures::safer_mode_extensions
.
sourcepub fn extended_base_registers(&self) -> bool
Available on x86-64 only.
pub fn extended_base_registers(&self) -> bool
CR4.FSGSBASE
: Enable instructions to load/store the FS
and GS
base
registers with 32/64-bit values in 64-bit mode.
sourcepub fn process_context_ids(&self) -> bool
Available on x86-64 only.
pub fn process_context_ids(&self) -> bool
CR4.PCIDE
: Enable process-context identifiers (PCID) in 64-bit mode.
Requires BasicFeatures::process_context_ids
.
sourcepub fn extended_state_save(&self) -> bool
pub fn extended_state_save(&self) -> bool
CR4.OSXSAVE
: Enable instructions for saving and restoring extended processor
state (FPU/MMX/SSE/AVX).
These instructions require special support from the operating system.
Requires BasicFeatures::extended_state_save
.
sourcepub fn supervisor_execution_prevention(&self) -> bool
pub fn supervisor_execution_prevention(&self) -> bool
CR4.SMEP
: Enable execution prevention in privilege levels 0–2.
sourcepub fn supervisor_access_prevention(&self) -> bool
pub fn supervisor_access_prevention(&self) -> bool
CR4.SMAP
: Enable access prevention in privilege levels 0–2.
sourcepub fn user_protection_keys(&self) -> bool
Available on x86-64 only.
pub fn user_protection_keys(&self) -> bool
CR4.PKE
: Use page protection keys in 64-bit mode to control access from
privilege level 3.
sourcepub fn control_flow_enforcement(&self) -> bool
pub fn control_flow_enforcement(&self) -> bool
CR4.CET
(Intel-only): Enable control-flow enforcement technology.
Requires ControlRegister0::write_protect
.
sourcepub fn supervisor_protection_keys(&self) -> bool
Available on x86-64 only.
pub fn supervisor_protection_keys(&self) -> bool
CR4.PKS
(Intel-only): Use page protection keys in 64-bit mode to control
access from privilege levels 0-2.
sourcepub fn set_virtual_8086_extensions(&mut self, value: bool)
pub fn set_virtual_8086_extensions(&mut self, value: bool)
CR4.VME
: Enable interrupts and exception handling in virtual
real-mode.
Requires BasicFeatures::virtual_8086_extensions
.
sourcepub fn with_virtual_8086_extensions(&mut self, value: bool) -> Self
pub fn with_virtual_8086_extensions(&mut self, value: bool) -> Self
CR4.VME
: Enable interrupts and exception handling in virtual
real-mode.
Requires BasicFeatures::virtual_8086_extensions
.
sourcepub fn set_protected_virtual_interrupts(&mut self, value: bool)
pub fn set_protected_virtual_interrupts(&mut self, value: bool)
CR4.PVI
: Enable virtual interrupts in protected mode.
Requires BasicFeatures::virtual_8086_extensions
.
sourcepub fn with_protected_virtual_interrupts(&mut self, value: bool) -> Self
pub fn with_protected_virtual_interrupts(&mut self, value: bool) -> Self
CR4.PVI
: Enable virtual interrupts in protected mode.
Requires BasicFeatures::virtual_8086_extensions
.
sourcepub fn set_timestamp_disabled(&mut self, value: bool)
pub fn set_timestamp_disabled(&mut self, value: bool)
CR4.TSD
: Disable access to processor timestamp counter except in privilege
level 0.
Requires [BasicFeatures::timestamp_counter
].
sourcepub fn with_timestamp_disabled(&mut self, value: bool) -> Self
pub fn with_timestamp_disabled(&mut self, value: bool) -> Self
CR4.TSD
: Disable access to processor timestamp counter except in privilege
level 0.
Requires [BasicFeatures::timestamp_counter
].
sourcepub fn set_debugging_extensions(&mut self, value: bool)
pub fn set_debugging_extensions(&mut self, value: bool)
CR4.DE
: Enable newer debug register scheme where DR4
and DR5
are
unavailable.
When this flag is clear, they are equivalent to DR6
and DR7
.
Requires BasicFeatures::debugging_extensions
.
sourcepub fn with_debugging_extensions(&mut self, value: bool) -> Self
pub fn with_debugging_extensions(&mut self, value: bool) -> Self
CR4.DE
: Enable newer debug register scheme where DR4
and DR5
are
unavailable.
When this flag is clear, they are equivalent to DR6
and DR7
.
Requires BasicFeatures::debugging_extensions
.
sourcepub fn set_page_size_extensions(&mut self, value: bool)
pub fn set_page_size_extensions(&mut self, value: bool)
CR4.PSE
: Support large pages (4MB). Applies to 32-bit mode only.
When this flag is clear in 32-bit mode, pages are always 4KB. Large pages are always enabled in 64-bit mode.
Requires [BasicFeatures::page_size_extensions
].
sourcepub fn with_page_size_extensions(&mut self, value: bool) -> Self
pub fn with_page_size_extensions(&mut self, value: bool) -> Self
CR4.PSE
: Support large pages (4MB). Applies to 32-bit mode only.
When this flag is clear in 32-bit mode, pages are always 4KB. Large pages are always enabled in 64-bit mode.
Requires [BasicFeatures::page_size_extensions
].
sourcepub fn set_physical_address_extension(&mut self, value: bool)
pub fn set_physical_address_extension(&mut self, value: bool)
CR4.PAE
: Enable pages to map to physical addresses larger than 32-bits.
Required for 64-bit mode.
sourcepub fn with_physical_address_extension(&mut self, value: bool) -> Self
pub fn with_physical_address_extension(&mut self, value: bool) -> Self
CR4.PAE
: Enable pages to map to physical addresses larger than 32-bits.
Required for 64-bit mode.
sourcepub fn set_machine_check_exception(&mut self, value: bool)
pub fn set_machine_check_exception(&mut self, value: bool)
CR4.MCE
: Enable machine-check exception.
Requires BasicFeatures::machine_check_exception
.
sourcepub fn with_machine_check_exception(&mut self, value: bool) -> Self
pub fn with_machine_check_exception(&mut self, value: bool) -> Self
CR4.MCE
: Enable machine-check exception.
Requires BasicFeatures::machine_check_exception
.
sourcepub fn set_global_pages(&mut self, value: bool)
pub fn set_global_pages(&mut self, value: bool)
CR4.PGE
: Enable global pages, which are shared across task contexts.
Requires BasicFeatures::global_pages
.
sourcepub fn with_global_pages(&mut self, value: bool) -> Self
pub fn with_global_pages(&mut self, value: bool) -> Self
CR4.PGE
: Enable global pages, which are shared across task contexts.
Requires BasicFeatures::global_pages
.
sourcepub fn set_performance_counter(&mut self, value: bool)
pub fn set_performance_counter(&mut self, value: bool)
CR4.PCE
: Allow access to performance monitoring counter in privilege levels
1–3 (always accessible in level 0).
sourcepub fn with_performance_counter(&mut self, value: bool) -> Self
pub fn with_performance_counter(&mut self, value: bool) -> Self
CR4.PCE
: Allow access to performance monitoring counter in privilege levels
1–3 (always accessible in level 0).
sourcepub fn set_sse_and_fpu_save(&mut self, value: bool)
pub fn set_sse_and_fpu_save(&mut self, value: bool)
CR4.OSFXSR
: Enable the FXSAVE
/FXRSTOR
and SSE instructions, if present.
These instructions require special support from the operating system.
Requires BasicFeatures::fpu_save
.
sourcepub fn with_sse_and_fpu_save(&mut self, value: bool) -> Self
pub fn with_sse_and_fpu_save(&mut self, value: bool) -> Self
CR4.OSFXSR
: Enable the FXSAVE
/FXRSTOR
and SSE instructions, if present.
These instructions require special support from the operating system.
Requires BasicFeatures::fpu_save
.
sourcepub fn set_simd_exceptions(&mut self, value: bool)
pub fn set_simd_exceptions(&mut self, value: bool)
CR4.OSXMMEXCPT
: Enable unmasked SIMD floating-point exception handling for
SSE instructions.
This requires special support from the operating system.
sourcepub fn with_simd_exceptions(&mut self, value: bool) -> Self
pub fn with_simd_exceptions(&mut self, value: bool) -> Self
CR4.OSXMMEXCPT
: Enable unmasked SIMD floating-point exception handling for
SSE instructions.
This requires special support from the operating system.
sourcepub fn set_restrict_user_mode_instructions(&mut self, value: bool)
pub fn set_restrict_user_mode_instructions(&mut self, value: bool)
CR4.UMIP
: Prevent access to instructions that allow reads from
descriptor/task registers, except in privilege level 0.
sourcepub fn with_restrict_user_mode_instructions(&mut self, value: bool) -> Self
pub fn with_restrict_user_mode_instructions(&mut self, value: bool) -> Self
CR4.UMIP
: Prevent access to instructions that allow reads from
descriptor/task registers, except in privilege level 0.
sourcepub fn set_five_level_paging(&mut self, value: bool)
Available on x86-64 only.
pub fn set_five_level_paging(&mut self, value: bool)
CR4.LA57
: Support 57-bit addresses using 5-level paging in 64-bit mode.
sourcepub fn with_five_level_paging(&mut self, value: bool) -> Self
Available on x86-64 only.
pub fn with_five_level_paging(&mut self, value: bool) -> Self
CR4.LA57
: Support 57-bit addresses using 5-level paging in 64-bit mode.
sourcepub fn set_virtual_machine_extensions(&mut self, value: bool)
pub fn set_virtual_machine_extensions(&mut self, value: bool)
CR4.VMX
(Intel-only): Enable virtual machine extensions.
sourcepub fn with_virtual_machine_extensions(&mut self, value: bool) -> Self
pub fn with_virtual_machine_extensions(&mut self, value: bool) -> Self
CR4.VMX
(Intel-only): Enable virtual machine extensions.
sourcepub fn set_safer_mode_extensions(&mut self, value: bool)
pub fn set_safer_mode_extensions(&mut self, value: bool)
CR4.SME
(Intel-only): Enable safer-mode extensions.
Requires BasicFeatures::safer_mode_extensions
.
sourcepub fn with_safer_mode_extensions(&mut self, value: bool) -> Self
pub fn with_safer_mode_extensions(&mut self, value: bool) -> Self
CR4.SME
(Intel-only): Enable safer-mode extensions.
Requires BasicFeatures::safer_mode_extensions
.
sourcepub fn set_extended_base_registers(&mut self, value: bool)
Available on x86-64 only.
pub fn set_extended_base_registers(&mut self, value: bool)
CR4.FSGSBASE
: Enable instructions to load/store the FS
and GS
base
registers with 32/64-bit values in 64-bit mode.
sourcepub fn with_extended_base_registers(&mut self, value: bool) -> Self
Available on x86-64 only.
pub fn with_extended_base_registers(&mut self, value: bool) -> Self
CR4.FSGSBASE
: Enable instructions to load/store the FS
and GS
base
registers with 32/64-bit values in 64-bit mode.
sourcepub fn set_process_context_ids(&mut self, value: bool)
Available on x86-64 only.
pub fn set_process_context_ids(&mut self, value: bool)
CR4.PCIDE
: Enable process-context identifiers (PCID) in 64-bit mode.
Requires BasicFeatures::process_context_ids
.
sourcepub fn with_process_context_ids(&mut self, value: bool) -> Self
Available on x86-64 only.
pub fn with_process_context_ids(&mut self, value: bool) -> Self
CR4.PCIDE
: Enable process-context identifiers (PCID) in 64-bit mode.
Requires BasicFeatures::process_context_ids
.
sourcepub fn set_extended_state_save(&mut self, value: bool)
pub fn set_extended_state_save(&mut self, value: bool)
CR4.OSXSAVE
: Enable instructions for saving and restoring extended processor
state (FPU/MMX/SSE/AVX).
These instructions require special support from the operating system.
Requires BasicFeatures::extended_state_save
.
sourcepub fn with_extended_state_save(&mut self, value: bool) -> Self
pub fn with_extended_state_save(&mut self, value: bool) -> Self
CR4.OSXSAVE
: Enable instructions for saving and restoring extended processor
state (FPU/MMX/SSE/AVX).
These instructions require special support from the operating system.
Requires BasicFeatures::extended_state_save
.
sourcepub fn set_supervisor_execution_prevention(&mut self, value: bool)
pub fn set_supervisor_execution_prevention(&mut self, value: bool)
CR4.SMEP
: Enable execution prevention in privilege levels 0–2.
sourcepub fn with_supervisor_execution_prevention(&mut self, value: bool) -> Self
pub fn with_supervisor_execution_prevention(&mut self, value: bool) -> Self
CR4.SMEP
: Enable execution prevention in privilege levels 0–2.
sourcepub fn set_supervisor_access_prevention(&mut self, value: bool)
pub fn set_supervisor_access_prevention(&mut self, value: bool)
CR4.SMAP
: Enable access prevention in privilege levels 0–2.
sourcepub fn with_supervisor_access_prevention(&mut self, value: bool) -> Self
pub fn with_supervisor_access_prevention(&mut self, value: bool) -> Self
CR4.SMAP
: Enable access prevention in privilege levels 0–2.
sourcepub fn set_user_protection_keys(&mut self, value: bool)
Available on x86-64 only.
pub fn set_user_protection_keys(&mut self, value: bool)
CR4.PKE
: Use page protection keys in 64-bit mode to control access from
privilege level 3.
sourcepub fn with_user_protection_keys(&mut self, value: bool) -> Self
Available on x86-64 only.
pub fn with_user_protection_keys(&mut self, value: bool) -> Self
CR4.PKE
: Use page protection keys in 64-bit mode to control access from
privilege level 3.
sourcepub fn set_control_flow_enforcement(&mut self, value: bool)
pub fn set_control_flow_enforcement(&mut self, value: bool)
CR4.CET
(Intel-only): Enable control-flow enforcement technology.
Requires ControlRegister0::write_protect
.
sourcepub fn with_control_flow_enforcement(&mut self, value: bool) -> Self
pub fn with_control_flow_enforcement(&mut self, value: bool) -> Self
CR4.CET
(Intel-only): Enable control-flow enforcement technology.
Requires ControlRegister0::write_protect
.
sourcepub fn set_supervisor_protection_keys(&mut self, value: bool)
Available on x86-64 only.
pub fn set_supervisor_protection_keys(&mut self, value: bool)
CR4.PKS
(Intel-only): Use page protection keys in 64-bit mode to control
access from privilege levels 0-2.
sourcepub fn with_supervisor_protection_keys(&mut self, value: bool) -> Self
Available on x86-64 only.
pub fn with_supervisor_protection_keys(&mut self, value: bool) -> Self
CR4.PKS
(Intel-only): Use page protection keys in 64-bit mode to control
access from privilege levels 0-2.
Trait Implementations§
source§impl Bitfield<usize> for ControlRegister4
impl Bitfield<usize> for ControlRegister4
source§impl Clone for ControlRegister4
impl Clone for ControlRegister4
source§fn clone(&self) -> ControlRegister4
fn clone(&self) -> ControlRegister4
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ControlRegister4
impl Debug for ControlRegister4
source§impl Default for ControlRegister4
impl Default for ControlRegister4
source§fn default() -> ControlRegister4
fn default() -> ControlRegister4
source§impl From<ControlRegister4> for usize
impl From<ControlRegister4> for usize
source§fn from(val: ControlRegister4) -> Self
fn from(val: ControlRegister4) -> Self
source§impl From<usize> for ControlRegister4
impl From<usize> for ControlRegister4
source§impl PartialEq for ControlRegister4
impl PartialEq for ControlRegister4
impl Copy for ControlRegister4
impl Eq for ControlRegister4
impl StructuralPartialEq for ControlRegister4
Auto Trait Implementations§
impl Freeze for ControlRegister4
impl RefUnwindSafe for ControlRegister4
impl Send for ControlRegister4
impl Sync for ControlRegister4
impl Unpin for ControlRegister4
impl UnwindSafe for ControlRegister4
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)