pub struct Registration<H: Handler>(_);
Expand description

The registration of an interrupt handler.

Examples

The following is an example of a regular handler with a boxed u32 as data.

use kernel::irq;

struct Example;

impl irq::Handler for Example {
    type Data = Box<u32>;

    fn handle_irq(_data: &u32) -> irq::Return {
        irq::Return::None
    }
}

fn request_irq(irq: u32, data: Box<u32>) -> Result<irq::Registration<Example>> {
    irq::Registration::try_new(irq, data, irq::flags::SHARED, fmt!("example_{irq}"))
}

Implementations

Registers a new irq handler.

The valid values of flags come from the flags module.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

This documentation is an old archive. Please see https://rust.docs.kernel.org instead.