Struct x86_64::structures::idt::Entry
source · #[repr(C)]pub struct Entry<F> { /* private fields */ }
Expand description
An Interrupt Descriptor Table entry.
The generic parameter can either be HandlerFunc
or HandlerFuncWithErrCode
, 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
Set the handler address 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 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 Entry<HandlerFunc>
impl Entry<HandlerFunc>
sourcepub fn set_handler_fn(&mut self, handler: HandlerFunc) -> &mut EntryOptions
pub fn set_handler_fn(&mut self, handler: HandlerFunc) -> &mut EntryOptions
Set the handler 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.
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.
source§impl Entry<HandlerFuncWithErrCode>
impl Entry<HandlerFuncWithErrCode>
sourcepub fn set_handler_fn(
&mut self,
handler: HandlerFuncWithErrCode
) -> &mut EntryOptions
pub fn set_handler_fn( &mut self, handler: HandlerFuncWithErrCode ) -> &mut EntryOptions
Set the handler 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.
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.
source§impl Entry<PageFaultHandlerFunc>
impl Entry<PageFaultHandlerFunc>
sourcepub fn set_handler_fn(
&mut self,
handler: PageFaultHandlerFunc
) -> &mut EntryOptions
pub fn set_handler_fn( &mut self, handler: PageFaultHandlerFunc ) -> &mut EntryOptions
Set the handler 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.
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.
source§impl Entry<DivergingHandlerFunc>
impl Entry<DivergingHandlerFunc>
sourcepub fn set_handler_fn(
&mut self,
handler: DivergingHandlerFunc
) -> &mut EntryOptions
pub fn set_handler_fn( &mut self, handler: DivergingHandlerFunc ) -> &mut EntryOptions
Set the handler 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.
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.
source§impl Entry<DivergingHandlerFuncWithErrCode>
impl Entry<DivergingHandlerFuncWithErrCode>
sourcepub fn set_handler_fn(
&mut self,
handler: DivergingHandlerFuncWithErrCode
) -> &mut EntryOptions
pub fn set_handler_fn( &mut self, handler: DivergingHandlerFuncWithErrCode ) -> &mut EntryOptions
Set the handler 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.
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.