Struct r3::kernel::InterruptLine
source · pub struct InterruptLine<System>(_, _)
where
System: KernelInterruptLine;
Expand description
Refers to an interrupt line in a system.
Implementations
sourceimpl<System> InterruptLine<System>where
System: KernelInterruptLine,
impl<System> InterruptLine<System>where
System: KernelInterruptLine,
sourceimpl<System> InterruptLine<System>where
System: KernelInterruptLine,
impl<System> InterruptLine<System>where
System: KernelInterruptLine,
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: i16
) -> Result<(), SetInterruptLinePriorityError>
pub fn set_priority(
self,
value: i16
) -> 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: i16
) -> Result<(), SetInterruptLinePriorityError>
pub unsafe fn set_priority_unchecked(
self,
value: i16
) -> 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.
Trait Implementations
sourceimpl<System> Clone for InterruptLine<System>where
System: KernelInterruptLine,
impl<System> Clone for InterruptLine<System>where
System: KernelInterruptLine,
sourcefn clone(&self) -> InterruptLine<System>
fn clone(&self) -> InterruptLine<System>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more