Skip to main content

IrqOps

Trait IrqOps 

Source
pub trait IrqOps {
    type LocalIrqState: Copy;

    // Required methods
    fn current_cpu(&self) -> CpuId;
    fn cpu_online(&self, cpu: CpuId) -> bool;
    fn in_irq_context(&self) -> bool;
    fn local_irq_save(&self) -> Self::LocalIrqState;
    fn local_irq_restore(&self, state: Self::LocalIrqState);
    fn run_on_cpu_sync(
        &self,
        cpu: CpuId,
        f: unsafe fn(*mut ()),
        arg: *mut (),
    ) -> Result<(), IrqError>;
    fn set_enabled(
        &self,
        irq: IrqNumber,
        cpu: Option<CpuId>,
        enabled: bool,
    ) -> Result<(), IrqError>;
    fn is_enabled(
        &self,
        irq: IrqNumber,
        cpu: Option<CpuId>,
    ) -> Result<bool, IrqError>;
    fn is_pending(
        &self,
        irq: IrqNumber,
        cpu: Option<CpuId>,
    ) -> Result<bool, IrqError>;
    fn is_in_service(
        &self,
        irq: IrqNumber,
        cpu: Option<CpuId>,
    ) -> Result<bool, IrqError>;
    fn relax(&self);
}
Expand description

External capabilities supplied by the OS/platform adapter.

Required Associated Types§

Source

type LocalIrqState: Copy

Saved local IRQ state.

Required Methods§

Source

fn current_cpu(&self) -> CpuId

Returns the current CPU.

Source

fn cpu_online(&self, cpu: CpuId) -> bool

Returns whether the CPU is online.

Source

fn in_irq_context(&self) -> bool

Returns whether the current execution context is an IRQ context.

Source

fn local_irq_save(&self) -> Self::LocalIrqState

Saves and disables local IRQs for metadata lock acquisition.

Source

fn local_irq_restore(&self, state: Self::LocalIrqState)

Restores local IRQ state saved by IrqOps::local_irq_save.

Source

fn run_on_cpu_sync( &self, cpu: CpuId, f: unsafe fn(*mut ()), arg: *mut (), ) -> Result<(), IrqError>

Runs a thunk synchronously on the target CPU.

Source

fn set_enabled( &self, irq: IrqNumber, cpu: Option<CpuId>, enabled: bool, ) -> Result<(), IrqError>

Enables or disables an IRQ line.

Source

fn is_enabled( &self, irq: IrqNumber, cpu: Option<CpuId>, ) -> Result<bool, IrqError>

Returns whether the IRQ line is enabled.

Source

fn is_pending( &self, irq: IrqNumber, cpu: Option<CpuId>, ) -> Result<bool, IrqError>

Returns whether the IRQ line is pending.

Source

fn is_in_service( &self, irq: IrqNumber, cpu: Option<CpuId>, ) -> Result<bool, IrqError>

Returns whether the IRQ line is in service.

Source

fn relax(&self)

Relaxes a spin wait.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§