[−][src]Struct sunrise_kernel::i386::structures::idt::IdtEntry
An Interrupt Descriptor Table entry.
The generic parameter can either be HandlerFunc
or HandlerFuncWithErrCode
, depending
on the interrupt vector.
Fields
pointer_low: u16
Low word of the interrupt handler's virtual address. In an interrupt/trap gate, the processor will far jump to this pointer when the interrupt occurs. It is unused for task gates.
gdt_selector: SegmentSelector
A segment selector.
- For interrupt/trap gates, the selector will be used when far jumping to the handler. It should be a selector to a code segment.
- For task gates, the selector will be used to perform hardware task switching. It should be a selector to a TSS segment.
zero: u8
Unused.
options: EntryOptions
Option bitfield.
pointer_high: u16
High word of the interrupt handler's virtual address.
phantom: PhantomData<F>
Type-safety guarantee: ensure that the function handler has the correct amount of arguments, return types, etc...
Implementations
impl<F> IdtEntry<F>
[src]
fn missing() -> Self
[src]
Creates a non-present IDT entry (but sets the must-be-one bits).
pub unsafe fn set_interrupt_gate_addr(&mut self, addr: u32) -> &mut EntryOptions
[src]
Set an interrupt gate function for the IDT entry and sets the present bit.
For the code selector field, this function uses the code segment selector currently active in the CPU.
The function returns a mutable reference to the entry's options that allows further customization.
Safety
The provided addr must be a valid virtual address to a function following the x86-interrupt ABI.
pub unsafe fn set_handler_task_gate(&mut self, tss_selector: SegmentSelector)
[src]
Set a task gate for the IDT entry and sets the present bit.
Safety
tss_selector
must point to a valid TSS, which will remain present.
The TSS' eip
should point to the handler function.
The TSS' esp
and esp0
should point to a usable stack for the handler function.
impl<T> IdtEntry<T>
[src]
pub fn set_handler_fn(
&mut self,
handler_asm_wrapper: extern "C" fn()
) -> &mut EntryOptions
[src]
&mut self,
handler_asm_wrapper: extern "C" fn()
) -> &mut EntryOptions
Set an interrupt gate function for the IDT entry and sets the present bit.
For the code selector field, this function uses the code segment selector currently active in the CPU.
The function returns a mutable reference to the entry's options that allows further customization.
Trait Implementations
impl<F: Clone> Clone for IdtEntry<F>
[src]
impl<F: Copy> Copy for IdtEntry<F>
[src]
impl<F> Debug for IdtEntry<F>
[src]
Auto Trait Implementations
impl<F> RefUnwindSafe for IdtEntry<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for IdtEntry<F> where
F: Send,
F: Send,
impl<F> Sync for IdtEntry<F> where
F: Sync,
F: Sync,
impl<F> Unpin for IdtEntry<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for IdtEntry<F> where
F: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,