Struct r3_core::kernel::interrupt::InterruptLine
source · pub struct InterruptLine<System: KernelInterruptLine>(_, _);
Expand description
Refers to an interrupt line in a system.
Implementations§
source§impl<System: KernelInterruptLine> InterruptLine<System>
impl<System: KernelInterruptLine> InterruptLine<System>
sourcepub const fn from_num(num: InterruptNum) -> Self
pub const fn from_num(num: InterruptNum) -> Self
Construct a InterruptLine
from InterruptNum
.
sourcepub const fn num(self) -> InterruptNum
pub const fn num(self) -> InterruptNum
Get the raw InterruptNum
value representing this interrupt line.
source§impl<System: KernelInterruptLine> InterruptLine<System>
impl<System: KernelInterruptLine> InterruptLine<System>
sourcepub const fn define() -> InterruptLineDefiner<System>
pub const fn define() -> InterruptLineDefiner<System>
Construct a InterruptLineDefiner
to define an interrupt line in a
configuration function.
sourcepub fn set_priority(
self,
value: InterruptPriority
) -> Result<(), SetInterruptLinePriorityError>
pub fn set_priority( self, value: InterruptPriority ) -> Result<(), SetInterruptLinePriorityError>
Set the priority of the interrupt line. The new priority must fall within a managed range.
Turning a managed interrupt handler into an unmanaged one is unsafe
because the behavior of system calls is undefined inside an unmanaged
interrupt handler. This method checks the new priority to prevent this
from happening and returns SetInterruptLinePriorityError::BadParam
if the operation is unsafe.
sourcepub unsafe fn set_priority_unchecked(
self,
value: InterruptPriority
) -> Result<(), SetInterruptLinePriorityError>
pub unsafe fn set_priority_unchecked( self, value: InterruptPriority ) -> Result<(), SetInterruptLinePriorityError>
Set the priority of the interrupt line without checking if the new priority falls within a managed range.
Safety
If a non-unmanaged-safe interrupt handler is attached to the interrupt line, changing the priority of the interrupt line to outside of the managed range (thus turning the handler into an unmanaged handler) may allow the interrupt handler to invoke an undefined behavior, for example, by making system calls, which are disallowed in an unmanaged interrupt handler.
sourcepub fn enable(self) -> Result<(), EnableInterruptLineError>
pub fn enable(self) -> Result<(), EnableInterruptLineError>
Enable the interrupt line.
sourcepub fn disable(self) -> Result<(), EnableInterruptLineError>
pub fn disable(self) -> Result<(), EnableInterruptLineError>
Disable the interrupt line.
sourcepub fn pend(self) -> Result<(), PendInterruptLineError>
pub fn pend(self) -> Result<(), PendInterruptLineError>
Set the pending flag of the interrupt line.
sourcepub fn clear(self) -> Result<(), ClearInterruptLineError>
pub fn clear(self) -> Result<(), ClearInterruptLineError>
Clear the pending flag of the interrupt line.
sourcepub fn is_pending(self) -> Result<bool, QueryInterruptLineError>
pub fn is_pending(self) -> Result<bool, QueryInterruptLineError>
Read the pending flag of the interrupt line.