#[repr(transparent)]pub struct Flags(u32);
Expand description
The EFLAGS register.
Tuple Fields§
§0: u32
Implementations§
source§impl Flags
impl Flags
const CARRY_BITS: usize = 1usize
const CARRY_OFFSET: usize = 0usize
const PARITY_BITS: usize = 1usize
const PARITY_OFFSET: usize = 2usize
const AUXILIARY_CARRY_BITS: usize = 1usize
const AUXILIARY_CARRY_OFFSET: usize = 4usize
const ZERO_BITS: usize = 1usize
const ZERO_OFFSET: usize = 6usize
const SIGN_BITS: usize = 1usize
const SIGN_OFFSET: usize = 7usize
const TRAP_BITS: usize = 1usize
const TRAP_OFFSET: usize = 8usize
const INTERRUPT_BITS: usize = 1usize
const INTERRUPT_OFFSET: usize = 9usize
const DIRECTION_BITS: usize = 1usize
const DIRECTION_OFFSET: usize = 10usize
const OVERFLOW_BITS: usize = 1usize
const OVERFLOW_OFFSET: usize = 11usize
const IOPL_LOW_BITS: usize = 1usize
const IOPL_LOW_OFFSET: usize = 12usize
const IOPL_HIGH_BITS: usize = 1usize
const IOPL_HIGH_OFFSET: usize = 13usize
const NESTED_TASK_BITS: usize = 1usize
const NESTED_TASK_OFFSET: usize = 14usize
const RESUME_BITS: usize = 1usize
const RESUME_OFFSET: usize = 16usize
const VIRTUAL_8086_MODE_BITS: usize = 1usize
const VIRTUAL_8086_MODE_OFFSET: usize = 17usize
const ALIGNMENT_CHECK_BITS: usize = 1usize
const ALIGNMENT_CHECK_OFFSET: usize = 18usize
const VIRTUAL_INTERRUPT_BITS: usize = 1usize
const VIRTUAL_INTERRUPT_OFFSET: usize = 19usize
const VIRTUAL_INTERRUPT_PENDING_BITS: usize = 1usize
const VIRTUAL_INTERRUPT_PENDING_OFFSET: usize = 20usize
const ID_BITS: usize = 1usize
const ID_OFFSET: usize = 21usize
sourcepub const fn carry(&self) -> bool
pub const fn carry(&self) -> bool
Set by hardware if last arithmetic operation generated a carry out of the most-significant bit of the result.
Bits: 0..1
sourcepub const fn with_carry_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_carry_checked(self, value: bool) -> Result<Self, ()>
Set by hardware if last arithmetic operation generated a carry out of the most-significant bit of the result.
Bits: 0..1
sourcepub const fn with_carry(self, value: bool) -> Self
pub const fn with_carry(self, value: bool) -> Self
Set by hardware if last arithmetic operation generated a carry out of the most-significant bit of the result.
Bits: 0..1
sourcepub fn set_carry(&mut self, value: bool)
pub fn set_carry(&mut self, value: bool)
Set by hardware if last arithmetic operation generated a carry out of the most-significant bit of the result.
Bits: 0..1
sourcepub fn set_carry_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_carry_checked(&mut self, value: bool) -> Result<(), ()>
Set by hardware if last arithmetic operation generated a carry out of the most-significant bit of the result.
Bits: 0..1
sourcepub const fn parity(&self) -> bool
pub const fn parity(&self) -> bool
Set by hardware if last result has an even number of 1 bits (only for some operations).
Bits: 2..3
sourcepub const fn with_parity_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_parity_checked(self, value: bool) -> Result<Self, ()>
Set by hardware if last result has an even number of 1 bits (only for some operations).
Bits: 2..3
sourcepub const fn with_parity(self, value: bool) -> Self
pub const fn with_parity(self, value: bool) -> Self
Set by hardware if last result has an even number of 1 bits (only for some operations).
Bits: 2..3
sourcepub fn set_parity(&mut self, value: bool)
pub fn set_parity(&mut self, value: bool)
Set by hardware if last result has an even number of 1 bits (only for some operations).
Bits: 2..3
sourcepub fn set_parity_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_parity_checked(&mut self, value: bool) -> Result<(), ()>
Set by hardware if last result has an even number of 1 bits (only for some operations).
Bits: 2..3
sourcepub const fn auxiliary_carry(&self) -> bool
pub const fn auxiliary_carry(&self) -> bool
Set by hardware if last arithmetic operation generated a carry ouf of bit 3 of the result.
Bits: 4..5
sourcepub const fn with_auxiliary_carry_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_auxiliary_carry_checked(self, value: bool) -> Result<Self, ()>
Set by hardware if last arithmetic operation generated a carry ouf of bit 3 of the result.
Bits: 4..5
sourcepub const fn with_auxiliary_carry(self, value: bool) -> Self
pub const fn with_auxiliary_carry(self, value: bool) -> Self
Set by hardware if last arithmetic operation generated a carry ouf of bit 3 of the result.
Bits: 4..5
sourcepub fn set_auxiliary_carry(&mut self, value: bool)
pub fn set_auxiliary_carry(&mut self, value: bool)
Set by hardware if last arithmetic operation generated a carry ouf of bit 3 of the result.
Bits: 4..5
sourcepub fn set_auxiliary_carry_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_auxiliary_carry_checked(&mut self, value: bool) -> Result<(), ()>
Set by hardware if last arithmetic operation generated a carry ouf of bit 3 of the result.
Bits: 4..5
sourcepub const fn zero(&self) -> bool
pub const fn zero(&self) -> bool
Set by hardware if last arithmetic operation resulted in a zero value.
Bits: 6..7
sourcepub const fn with_zero_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_zero_checked(self, value: bool) -> Result<Self, ()>
Set by hardware if last arithmetic operation resulted in a zero value.
Bits: 6..7
sourcepub const fn with_zero(self, value: bool) -> Self
pub const fn with_zero(self, value: bool) -> Self
Set by hardware if last arithmetic operation resulted in a zero value.
Bits: 6..7
sourcepub fn set_zero(&mut self, value: bool)
pub fn set_zero(&mut self, value: bool)
Set by hardware if last arithmetic operation resulted in a zero value.
Bits: 6..7
sourcepub fn set_zero_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_zero_checked(&mut self, value: bool) -> Result<(), ()>
Set by hardware if last arithmetic operation resulted in a zero value.
Bits: 6..7
sourcepub const fn sign(&self) -> bool
pub const fn sign(&self) -> bool
Set by hardware if last arithmetic operation resulted in a negative value.
Bits: 7..8
sourcepub const fn with_sign_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_sign_checked(self, value: bool) -> Result<Self, ()>
Set by hardware if last arithmetic operation resulted in a negative value.
Bits: 7..8
sourcepub const fn with_sign(self, value: bool) -> Self
pub const fn with_sign(self, value: bool) -> Self
Set by hardware if last arithmetic operation resulted in a negative value.
Bits: 7..8
sourcepub fn set_sign(&mut self, value: bool)
pub fn set_sign(&mut self, value: bool)
Set by hardware if last arithmetic operation resulted in a negative value.
Bits: 7..8
sourcepub fn set_sign_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_sign_checked(&mut self, value: bool) -> Result<(), ()>
Set by hardware if last arithmetic operation resulted in a negative value.
Bits: 7..8
sourcepub const fn with_trap_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_trap_checked(self, value: bool) -> Result<Self, ()>
Enable single-step mode for debugging.
Bits: 8..9
sourcepub const fn with_trap(self, value: bool) -> Self
pub const fn with_trap(self, value: bool) -> Self
Enable single-step mode for debugging.
Bits: 8..9
sourcepub fn set_trap_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_trap_checked(&mut self, value: bool) -> Result<(), ()>
Enable single-step mode for debugging.
Bits: 8..9
sourcepub const fn with_interrupt_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_interrupt_checked(self, value: bool) -> Result<Self, ()>
Enable interrupts.
Bits: 9..10
sourcepub const fn with_interrupt(self, value: bool) -> Self
pub const fn with_interrupt(self, value: bool) -> Self
Enable interrupts.
Bits: 9..10
sourcepub fn set_interrupt(&mut self, value: bool)
pub fn set_interrupt(&mut self, value: bool)
Enable interrupts.
Bits: 9..10
sourcepub fn set_interrupt_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_interrupt_checked(&mut self, value: bool) -> Result<(), ()>
Enable interrupts.
Bits: 9..10
sourcepub const fn direction(&self) -> bool
pub const fn direction(&self) -> bool
Determines the order in which strings are processed.
Bits: 10..11
sourcepub const fn with_direction_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_direction_checked(self, value: bool) -> Result<Self, ()>
Determines the order in which strings are processed.
Bits: 10..11
sourcepub const fn with_direction(self, value: bool) -> Self
pub const fn with_direction(self, value: bool) -> Self
Determines the order in which strings are processed.
Bits: 10..11
sourcepub fn set_direction(&mut self, value: bool)
pub fn set_direction(&mut self, value: bool)
Determines the order in which strings are processed.
Bits: 10..11
sourcepub fn set_direction_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_direction_checked(&mut self, value: bool) -> Result<(), ()>
Determines the order in which strings are processed.
Bits: 10..11
sourcepub const fn overflow(&self) -> bool
pub const fn overflow(&self) -> bool
Set by hardware to indicate that the sign bit of the result of the last signed integer operation differs from the source operands.
Bits: 11..12
sourcepub const fn with_overflow_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_overflow_checked(self, value: bool) -> Result<Self, ()>
Set by hardware to indicate that the sign bit of the result of the last signed integer operation differs from the source operands.
Bits: 11..12
sourcepub const fn with_overflow(self, value: bool) -> Self
pub const fn with_overflow(self, value: bool) -> Self
Set by hardware to indicate that the sign bit of the result of the last signed integer operation differs from the source operands.
Bits: 11..12
sourcepub fn set_overflow(&mut self, value: bool)
pub fn set_overflow(&mut self, value: bool)
Set by hardware to indicate that the sign bit of the result of the last signed integer operation differs from the source operands.
Bits: 11..12
sourcepub fn set_overflow_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_overflow_checked(&mut self, value: bool) -> Result<(), ()>
Set by hardware to indicate that the sign bit of the result of the last signed integer operation differs from the source operands.
Bits: 11..12
sourcepub const fn iopl_low(&self) -> bool
pub const fn iopl_low(&self) -> bool
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 12..13
sourcepub const fn with_iopl_low_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_iopl_low_checked(self, value: bool) -> Result<Self, ()>
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 12..13
sourcepub const fn with_iopl_low(self, value: bool) -> Self
pub const fn with_iopl_low(self, value: bool) -> Self
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 12..13
sourcepub fn set_iopl_low(&mut self, value: bool)
pub fn set_iopl_low(&mut self, value: bool)
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 12..13
sourcepub fn set_iopl_low_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_iopl_low_checked(&mut self, value: bool) -> Result<(), ()>
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 12..13
sourcepub const fn iopl_high(&self) -> bool
pub const fn iopl_high(&self) -> bool
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 13..14
sourcepub const fn with_iopl_high_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_iopl_high_checked(self, value: bool) -> Result<Self, ()>
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 13..14
sourcepub const fn with_iopl_high(self, value: bool) -> Self
pub const fn with_iopl_high(self, value: bool) -> Self
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 13..14
sourcepub fn set_iopl_high(&mut self, value: bool)
pub fn set_iopl_high(&mut self, value: bool)
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 13..14
sourcepub fn set_iopl_high_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_iopl_high_checked(&mut self, value: bool) -> Result<(), ()>
Specifies the privilege level required for executing I/O address-space instructions.
Bits: 13..14
sourcepub const fn nested_task(&self) -> bool
pub const fn nested_task(&self) -> bool
Used by iret
in hardware task switch mode to determine if current task is nested.
Bits: 14..15
sourcepub const fn with_nested_task_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_nested_task_checked(self, value: bool) -> Result<Self, ()>
Used by iret
in hardware task switch mode to determine if current task is nested.
Bits: 14..15
sourcepub const fn with_nested_task(self, value: bool) -> Self
pub const fn with_nested_task(self, value: bool) -> Self
Used by iret
in hardware task switch mode to determine if current task is nested.
Bits: 14..15
sourcepub fn set_nested_task(&mut self, value: bool)
pub fn set_nested_task(&mut self, value: bool)
Used by iret
in hardware task switch mode to determine if current task is nested.
Bits: 14..15
sourcepub fn set_nested_task_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_nested_task_checked(&mut self, value: bool) -> Result<(), ()>
Used by iret
in hardware task switch mode to determine if current task is nested.
Bits: 14..15
sourcepub const fn resume(&self) -> bool
pub const fn resume(&self) -> bool
Temporarily disables debug exceptions so that an instruction can be restarted after a debug exception without immediately causing another debug exception.
Bits: 16..17
sourcepub const fn with_resume_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_resume_checked(self, value: bool) -> Result<Self, ()>
Temporarily disables debug exceptions so that an instruction can be restarted after a debug exception without immediately causing another debug exception.
Bits: 16..17
sourcepub const fn with_resume(self, value: bool) -> Self
pub const fn with_resume(self, value: bool) -> Self
Temporarily disables debug exceptions so that an instruction can be restarted after a debug exception without immediately causing another debug exception.
Bits: 16..17
sourcepub fn set_resume(&mut self, value: bool)
pub fn set_resume(&mut self, value: bool)
Temporarily disables debug exceptions so that an instruction can be restarted after a debug exception without immediately causing another debug exception.
Bits: 16..17
sourcepub fn set_resume_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_resume_checked(&mut self, value: bool) -> Result<(), ()>
Temporarily disables debug exceptions so that an instruction can be restarted after a debug exception without immediately causing another debug exception.
Bits: 16..17
sourcepub const fn virtual_8086_mode(&self) -> bool
pub const fn virtual_8086_mode(&self) -> bool
Enable the virtual-8086 mode.
Bits: 17..18
sourcepub const fn with_virtual_8086_mode_checked(
self,
value: bool,
) -> Result<Self, ()>
pub const fn with_virtual_8086_mode_checked( self, value: bool, ) -> Result<Self, ()>
Enable the virtual-8086 mode.
Bits: 17..18
sourcepub const fn with_virtual_8086_mode(self, value: bool) -> Self
pub const fn with_virtual_8086_mode(self, value: bool) -> Self
Enable the virtual-8086 mode.
Bits: 17..18
sourcepub fn set_virtual_8086_mode(&mut self, value: bool)
pub fn set_virtual_8086_mode(&mut self, value: bool)
Enable the virtual-8086 mode.
Bits: 17..18
sourcepub fn set_virtual_8086_mode_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_virtual_8086_mode_checked(&mut self, value: bool) -> Result<(), ()>
Enable the virtual-8086 mode.
Bits: 17..18
sourcepub const fn alignment_check(&self) -> bool
pub const fn alignment_check(&self) -> bool
Enable automatic alignment checking if Cr0::alignment_mask is set. Only works if CPL is 3.
Bits: 18..19
sourcepub const fn with_alignment_check_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_alignment_check_checked(self, value: bool) -> Result<Self, ()>
Enable automatic alignment checking if Cr0::alignment_mask is set. Only works if CPL is 3.
Bits: 18..19
sourcepub const fn with_alignment_check(self, value: bool) -> Self
pub const fn with_alignment_check(self, value: bool) -> Self
Enable automatic alignment checking if Cr0::alignment_mask is set. Only works if CPL is 3.
Bits: 18..19
sourcepub fn set_alignment_check(&mut self, value: bool)
pub fn set_alignment_check(&mut self, value: bool)
Enable automatic alignment checking if Cr0::alignment_mask is set. Only works if CPL is 3.
Bits: 18..19
sourcepub fn set_alignment_check_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_alignment_check_checked(&mut self, value: bool) -> Result<(), ()>
Enable automatic alignment checking if Cr0::alignment_mask is set. Only works if CPL is 3.
Bits: 18..19
sourcepub const fn virtual_interrupt(&self) -> bool
pub const fn virtual_interrupt(&self) -> bool
Virtual interrupt flag.
Bits: 19..20
sourcepub const fn with_virtual_interrupt_checked(
self,
value: bool,
) -> Result<Self, ()>
pub const fn with_virtual_interrupt_checked( self, value: bool, ) -> Result<Self, ()>
Virtual interrupt flag.
Bits: 19..20
sourcepub const fn with_virtual_interrupt(self, value: bool) -> Self
pub const fn with_virtual_interrupt(self, value: bool) -> Self
Virtual interrupt flag.
Bits: 19..20
sourcepub fn set_virtual_interrupt(&mut self, value: bool)
pub fn set_virtual_interrupt(&mut self, value: bool)
Virtual interrupt flag.
Bits: 19..20
sourcepub fn set_virtual_interrupt_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_virtual_interrupt_checked(&mut self, value: bool) -> Result<(), ()>
Virtual interrupt flag.
Bits: 19..20
sourcepub const fn virtual_interrupt_pending(&self) -> bool
pub const fn virtual_interrupt_pending(&self) -> bool
Virtual interrupt pending.
Bits: 20..21
sourcepub const fn with_virtual_interrupt_pending_checked(
self,
value: bool,
) -> Result<Self, ()>
pub const fn with_virtual_interrupt_pending_checked( self, value: bool, ) -> Result<Self, ()>
Virtual interrupt pending.
Bits: 20..21
sourcepub const fn with_virtual_interrupt_pending(self, value: bool) -> Self
pub const fn with_virtual_interrupt_pending(self, value: bool) -> Self
Virtual interrupt pending.
Bits: 20..21
sourcepub fn set_virtual_interrupt_pending(&mut self, value: bool)
pub fn set_virtual_interrupt_pending(&mut self, value: bool)
Virtual interrupt pending.
Bits: 20..21
sourcepub fn set_virtual_interrupt_pending_checked(
&mut self,
value: bool,
) -> Result<(), ()>
pub fn set_virtual_interrupt_pending_checked( &mut self, value: bool, ) -> Result<(), ()>
Virtual interrupt pending.
Bits: 20..21
sourcepub const fn with_id_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_id_checked(self, value: bool) -> Result<Self, ()>
Able to use CPUID instruction.
Bits: 21..22
sourcepub fn set_id_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_id_checked(&mut self, value: bool) -> Result<(), ()>
Able to use CPUID instruction.
Bits: 21..22
Trait Implementations§
impl Copy for Flags
Auto Trait Implementations§
impl Freeze for Flags
impl RefUnwindSafe for Flags
impl Send for Flags
impl Sync for Flags
impl Unpin for Flags
impl UnwindSafe for Flags
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)