#[repr(C)]pub struct Entry<F> { /* private fields */ }
Expand description
An Interrupt Descriptor Table entry.
The generic parameter is some [InterruptFn
], depending on the interrupt vector.
Implementations§
Source§impl<F> Entry<F>
impl<F> Entry<F>
Sourcepub const fn missing() -> Self
pub const fn missing() -> Self
Creates a non-present IDT entry (but sets the must-be-one bits).
Sourcepub unsafe fn set_handler_addr(&mut self, addr: VirtAddr) -> &mut EntryOptions
pub unsafe fn set_handler_addr(&mut self, addr: VirtAddr) -> &mut EntryOptions
Sets the handler address for the IDT entry and sets the following defaults:
- The code selector is the code segment currently active in the CPU
- The present bit is set
- Interrupts are disabled on handler invocation
- The privilege level (DPL) is
PrivilegeLevel::Ring0
- No IST is configured (existing stack will be used)
The function returns a mutable reference to the entry’s options that allows further customization.
§Safety
The caller must ensure that addr
is the address of a valid interrupt handler function,
and the signature of such a function is correct for the entry type.
Sourcepub fn handler_addr(&self) -> VirtAddr
pub fn handler_addr(&self) -> VirtAddr
Returns the virtual address of this IDT entry’s handler function.
Source§impl<F: HandlerFuncType> Entry<F>
impl<F: HandlerFuncType> Entry<F>
Sourcepub fn set_handler_fn(&mut self, handler: F) -> &mut EntryOptions
pub fn set_handler_fn(&mut self, handler: F) -> &mut EntryOptions
Sets the handler function for the IDT entry and sets the following defaults:
- The code selector is the code segment currently active in the CPU
- The present bit is set
- Interrupts are disabled on handler invocation
- The privilege level (DPL) is
PrivilegeLevel::Ring0
- No IST is configured (existing stack will be used)
The function returns a mutable reference to the entry’s options that allows further customization.
This method is only usable with the abi_x86_interrupt
feature enabled. Without it, the
unsafe Entry::set_handler_addr
method has to be used instead.