#[repr(transparent)]pub struct EntryOptions(u16);
Expand description
Represents the options field of an IDT entry.
Tuple Fields§
§0: u16
Implementations§
source§impl EntryOptions
impl EntryOptions
const STACK_IDX_BITS: usize = 3usize
const STACK_IDX_OFFSET: usize = 0usize
const GATE_BITS: usize = 3usize
const GATE_OFFSET: usize = 8usize
const GATE_32_BITS: usize = 1usize
const GATE_32_OFFSET: usize = 11usize
const PRIVILEGE_LEVEL_BITS: usize = 2usize
const PRIVILEGE_LEVEL_OFFSET: usize = 13usize
const PRESENT_BITS: usize = 1usize
const PRESENT_OFFSET: usize = 15usize
sourceconst fn with_stack_idx_checked(self, value: u16) -> Result<Self, ()>
const fn with_stack_idx_checked(self, value: u16) -> Result<Self, ()>
Index of an interrupt stack
Bits: 0..3
sourceconst fn with_stack_idx(self, value: u16) -> Self
const fn with_stack_idx(self, value: u16) -> Self
Index of an interrupt stack
Bits: 0..3
sourcefn set_stack_idx(&mut self, value: u16)
fn set_stack_idx(&mut self, value: u16)
Index of an interrupt stack
Bits: 0..3
sourcefn set_stack_idx_checked(&mut self, value: u16) -> Result<(), ()>
fn set_stack_idx_checked(&mut self, value: u16) -> Result<(), ()>
Index of an interrupt stack
Bits: 0..3
sourcepub const fn with_gate_checked(self, value: Gate) -> Result<Self, ()>
pub const fn with_gate_checked(self, value: Gate) -> Result<Self, ()>
Gate type
Bits: 8..11
sourcepub fn set_gate_checked(&mut self, value: Gate) -> Result<(), ()>
pub fn set_gate_checked(&mut self, value: Gate) -> Result<(), ()>
Gate type
Bits: 8..11
sourcepub const fn with_gate_32_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_gate_32_checked(self, value: bool) -> Result<Self, ()>
If this is a 32 bit entry
Bits: 11..12
sourcepub const fn with_gate_32(self, value: bool) -> Self
pub const fn with_gate_32(self, value: bool) -> Self
If this is a 32 bit entry
Bits: 11..12
sourcepub fn set_gate_32(&mut self, value: bool)
pub fn set_gate_32(&mut self, value: bool)
If this is a 32 bit entry
Bits: 11..12
sourcepub fn set_gate_32_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_gate_32_checked(&mut self, value: bool) -> Result<(), ()>
If this is a 32 bit entry
Bits: 11..12
sourcepub const fn privilege_level(&self) -> Ring
pub const fn privilege_level(&self) -> Ring
Set the required privilege level (DPL) for invoking the handler. The DPL can be 0 or 3, the default is 0. If CPL < DPL, a general protection fault occurs.
Bits: 13..15
sourcepub const fn with_privilege_level_checked(self, value: Ring) -> Result<Self, ()>
pub const fn with_privilege_level_checked(self, value: Ring) -> Result<Self, ()>
Set the required privilege level (DPL) for invoking the handler. The DPL can be 0 or 3, the default is 0. If CPL < DPL, a general protection fault occurs.
Bits: 13..15
sourcepub const fn with_privilege_level(self, value: Ring) -> Self
pub const fn with_privilege_level(self, value: Ring) -> Self
Set the required privilege level (DPL) for invoking the handler. The DPL can be 0 or 3, the default is 0. If CPL < DPL, a general protection fault occurs.
Bits: 13..15
sourcepub fn set_privilege_level(&mut self, value: Ring)
pub fn set_privilege_level(&mut self, value: Ring)
Set the required privilege level (DPL) for invoking the handler. The DPL can be 0 or 3, the default is 0. If CPL < DPL, a general protection fault occurs.
Bits: 13..15
sourcepub fn set_privilege_level_checked(&mut self, value: Ring) -> Result<(), ()>
pub fn set_privilege_level_checked(&mut self, value: Ring) -> Result<(), ()>
Set the required privilege level (DPL) for invoking the handler. The DPL can be 0 or 3, the default is 0. If CPL < DPL, a general protection fault occurs.
Bits: 13..15
sourcepub const fn with_present_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_present_checked(self, value: bool) -> Result<Self, ()>
Has to be true for valid entries.
Bits: 15..16
sourcepub const fn with_present(self, value: bool) -> Self
pub const fn with_present(self, value: bool) -> Self
Has to be true for valid entries.
Bits: 15..16
sourcepub fn set_present(&mut self, value: bool)
pub fn set_present(&mut self, value: bool)
Has to be true for valid entries.
Bits: 15..16
sourcepub fn set_present_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_present_checked(&mut self, value: bool) -> Result<(), ()>
Has to be true for valid entries.
Bits: 15..16
source§impl EntryOptions
impl EntryOptions
sourcepub const unsafe fn with_stack(self, index: u16) -> Self
pub const unsafe fn with_stack(self, index: u16) -> Self
Assigns a Interrupt Stack Table (IST) stack to this handler. The CPU will then always switch to the specified stack before the handler is invoked. This allows kernels to recover from corrupt stack pointers (e.g., on kernel stack overflow).
An IST stack is specified by an IST index between 0 and 6 (inclusive). Using the same stack for multiple interrupts can be dangerous when nested interrupts are possible.
This function panics if the index is not in the range 0..7.
§Safety
This function is unsafe because the caller must ensure that the passed stack index is valid and not used by other interrupts. Otherwise, memory safety violations are possible.
Trait Implementations§
source§impl Clone for EntryOptions
impl Clone for EntryOptions
source§fn clone(&self) -> EntryOptions
fn clone(&self) -> EntryOptions
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EntryOptions
impl Debug for EntryOptions
source§impl Default for EntryOptions
impl Default for EntryOptions
source§impl From<EntryOptions> for u16
impl From<EntryOptions> for u16
source§fn from(v: EntryOptions) -> u16
fn from(v: EntryOptions) -> u16
source§impl From<u16> for EntryOptions
impl From<u16> for EntryOptions
source§impl PartialEq for EntryOptions
impl PartialEq for EntryOptions
impl Copy for EntryOptions
impl Eq for EntryOptions
impl StructuralPartialEq for EntryOptions
Auto Trait Implementations§
impl Freeze for EntryOptions
impl RefUnwindSafe for EntryOptions
impl Send for EntryOptions
impl Sync for EntryOptions
impl Unpin for EntryOptions
impl UnwindSafe for EntryOptions
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
)