Struct locked_idt::LockedIdt
source · pub struct LockedIdt { /* private fields */ }
Expand description
A thread-safe and interrupt-safe wrapper around [InterruptDescriptorTable
].
This type offers interior mutability, allowing interrupt handlers to be added/changed/removed, but preserves safety by guaranteeing that only a static object can be loaded.
Implementations§
source§impl LockedIdt
impl LockedIdt
sourcepub fn load(&'static self)
pub fn load(&'static self)
Obtains the lock on the inner IDT and loads it into the current CPU
using the lidt
command.
sourcepub fn lock(&self) -> IrqSafeMutexGuard<'_, InterruptDescriptorTable>
pub fn lock(&self) -> IrqSafeMutexGuard<'_, InterruptDescriptorTable>
Obtains the lock on the inner IDT and returns a guard that derefs into it.
Interrupts are also disabled until the guard falls out of scope, at which point they are re-enabled iff they were previously enabled when this function was invoked. and the lock will be dropped when the guard falls out of scope.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for LockedIdt
impl Send for LockedIdt
impl Sync for LockedIdt
impl Unpin for LockedIdt
impl UnwindSafe for LockedIdt
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
Mutably borrows from an owned value. Read more