Struct r3_core::kernel::interrupt::InterruptHandlerDefiner
source · pub struct InterruptHandlerDefiner<System: KernelInterruptLine> { /* private fields */ }
Expand description
The definer (static builder) for StaticInterruptHandler
.
Implementations§
source§impl<System: KernelInterruptLine> InterruptHandlerDefiner<System>
impl<System: KernelInterruptLine> InterruptHandlerDefiner<System>
sourcepub const fn start<C: IntoClosureConst>(self, start: C) -> Self
pub const fn start<C: IntoClosureConst>(self, start: C) -> Self
[Required] Specify the entry point.
sourcepub const fn line(self, line: InterruptNum) -> Self
pub const fn line(self, line: InterruptNum) -> Self
[Required] Specify the interrupt line to attach the interrupt handler to.
sourcepub const fn priority(self, priority: i32) -> Self
pub const fn priority(self, priority: i32) -> Self
Specify the priority. Defaults to 0
when unspecified.
When multiple handlers are registered to a single interrupt line, those with smaller priority values will execute earlier.
This should not be confused with an interrupt line’s priority.
sourcepub const unsafe fn unmanaged(self) -> Self
pub const unsafe fn unmanaged(self) -> Self
Indicate that the entry point function is unmanaged-safe (designed to execute as an unmanaged interrupt handler).
If an interrupt line is not configured with an initial priority value that falls within a managed range, configuration will fail unless all of its attached interrupt handlers are marked as unmanaged-safe.
Safety
The behavior of system calls is undefined in an unmanaged interrupt handler.
sourcepub const fn finish<C: CfgInterruptLine<System = System>>(
self,
cfg: &mut Cfg<'_, C>
) -> StaticInterruptHandler<System>
pub const fn finish<C: CfgInterruptLine<System = System>>( self, cfg: &mut Cfg<'_, C> ) -> StaticInterruptHandler<System>
Complete the registration of an interrupt handler, returning an
StaticInterruptHandler
object.