Struct Entry
#[repr(C)]pub struct Entry<F> {
pointer_low: u16,
options: EntryOptions,
pointer_middle: u16,
pointer_high: u32,
reserved: u32,
phantom: PhantomData<F>,
}Expand description
An Interrupt Descriptor Table entry.
The generic parameter is some HandlerFuncType, depending on the interrupt vector.
Fields§
§pointer_low: u16§options: EntryOptions§pointer_middle: u16§pointer_high: u32§reserved: u32§phantom: PhantomData<F>Implementations§
§impl<F> Entry<F>
impl<F> Entry<F>
pub 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.
pub fn handler_addr(&self) -> VirtAddr
pub fn handler_addr(&self) -> VirtAddr
Returns the virtual address of this IDT entry’s handler function.
§impl<F> Entry<F>where
F: HandlerFuncType,
impl<F> Entry<F>where
F: HandlerFuncType,
pub 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 for Entry<F>where
F: Copy,
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more