pub struct Entry<F> { /* private fields */ }Expand description
An Interrupt Descriptor Table entry.
The generic parameter is some HandlerFuncType, 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.
Trait Implementations§
impl<F: Copy> Copy for Entry<F>
Auto Trait Implementations§
impl<F> Freeze for Entry<F>
impl<F> RefUnwindSafe for Entry<F>where
F: RefUnwindSafe,
impl<F> Send for Entry<F>where
F: Send,
impl<F> Sync for Entry<F>where
F: Sync,
impl<F> Unpin for Entry<F>where
F: Unpin,
impl<F> UnsafeUnpin for Entry<F>
impl<F> UnwindSafe for Entry<F>where
F: UnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)