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 more