#[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
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
const GATE_BITS: usize = 3usize
const GATE_OFFSET: usize = 8usize
const GATE_32_BITS: usize = 1usize
const GATE_32_OFFSET: usize = 11usize
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
const PRIVILEGE_LEVEL_BITS: usize = 2usize
const PRIVILEGE_LEVEL_OFFSET: usize = 13usize
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 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 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
const PRESENT_BITS: usize = 1usize
const PRESENT_OFFSET: usize = 15usize
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
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 more