[][src]Struct sunrise_kernel::i386::structures::idt::IdtEntry

#[repr(C)]pub struct IdtEntry<F> {
    pointer_low: u16,
    gdt_selector: SegmentSelector,
    zero: u8,
    options: EntryOptions,
    pointer_high: u16,
    phantom: PhantomData<F>,
}

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.

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]

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

impl<F> Send for IdtEntry<F> where
    F: Send

impl<F> Sync for IdtEntry<F> where
    F: Sync

impl<F> Unpin for IdtEntry<F> where
    F: Unpin

impl<F> UnwindSafe for IdtEntry<F> where
    F: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.