Struct Flags

Source
pub struct Flags(/* private fields */);
Expand description

Flags to be used when registering IRQ handlers.

Flags can be used to request specific behaviors when registering an IRQ handler, and can be combined using the |, &, and ! operators to further control the system’s behavior.

A common use case is to register a shared interrupt, as sharing the line between devices is increasingly common in modern systems and is even required for some buses. This requires setting Flags::SHARED when requesting the interrupt. Other use cases include setting the trigger type through Flags::TRIGGER_*, which determines when the interrupt fires, or controlling whether the interrupt is masked after the handler runs by using Flags::ONESHOT.

If an invalid combination of flags is provided, the system will refuse to register the handler, and lower layers will enforce certain flags when necessary. This means, for example, that all the crate::irq::Registration for a shared interrupt have to agree on Flags::SHARED and on the same trigger type, if set.

Implementations§

Source§

impl Flags

Source

pub const TRIGGER_NONE: Flags

Use the interrupt line as already configured.

Source

pub const TRIGGER_RISING: Flags

The interrupt is triggered when the signal goes from low to high.

Source

pub const TRIGGER_FALLING: Flags

The interrupt is triggered when the signal goes from high to low.

Source

pub const TRIGGER_HIGH: Flags

The interrupt is triggered while the signal is held high.

Source

pub const TRIGGER_LOW: Flags

The interrupt is triggered while the signal is held low.

Source

pub const SHARED: Flags

Allow sharing the IRQ among several devices.

Source

pub const PROBE_SHARED: Flags

Set by callers when they expect sharing mismatches to occur.

Source

pub const TIMER: Flags

Flag to mark this interrupt as timer interrupt.

Source

pub const PERCPU: Flags

Interrupt is per CPU.

Source

pub const NOBALANCING: Flags

Flag to exclude this interrupt from irq balancing.

Source

pub const IRQPOLL: Flags

Interrupt is used for polling (only the interrupt that is registered first in a shared interrupt is considered for performance reasons).

Source

pub const ONESHOT: Flags

Interrupt is not re-enabled after the hardirq handler finished. Used by threaded interrupts which need to keep the irq line disabled until the threaded handler has been run.

Source

pub const NO_SUSPEND: Flags

Do not disable this IRQ during suspend. Does not guarantee that this interrupt will wake the system from a suspended state.

Source

pub const FORCE_RESUME: Flags

Force enable it on resume even if Flags::NO_SUSPEND is set.

Source

pub const NO_THREAD: Flags

Interrupt cannot be threaded.

Source

pub const EARLY_RESUME: Flags

Resume IRQ early during syscore instead of at device resume time.

Source

pub const COND_SUSPEND: Flags

If the IRQ is shared with a Flags::NO_SUSPEND user, execute this interrupt handler after suspending interrupts. For system wakeup devices users need to implement wakeup detection in their interrupt handlers.

Source

pub const NO_AUTOEN: Flags

Don’t enable IRQ or NMI automatically when users request it. Users will enable it explicitly by enable_irq or enable_nmi later.

Source

pub const NO_DEBUG: Flags

Exclude from runnaway detection for IPI and similar handlers, depends on PERCPU.

Trait Implementations§

Source§

impl BitAnd for Flags

Source§

type Output = Flags

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl BitOr for Flags

Source§

type Output = Flags

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl Clone for Flags

Source§

fn clone(&self) -> Flags

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Not for Flags

Source§

type Output = Flags

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl PartialEq for Flags

Source§

fn eq(&self, other: &Flags) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Flags

Source§

impl Eq for Flags

Source§

impl StructuralPartialEq for Flags

Auto Trait Implementations§

§

impl Freeze for Flags

§

impl RefUnwindSafe for Flags

§

impl Send for Flags

§

impl Sync for Flags

§

impl Unpin for Flags

§

impl UnwindSafe for Flags

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Init<T> for T

Source§

unsafe fn __init(self, slot: *mut T) -> Result<(), Infallible>

Initializes slot. Read more
Source§

fn chain<F>(self, f: F) -> ChainInit<Self, F, T, E>
where F: FnOnce(&mut T) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PinInit<T> for T

Source§

unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>

Initializes slot. Read more
Source§

fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>
where F: FnOnce(Pin<&mut T>) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.