Re: [PATCH v6 3/6] rust: irq: add support for non-threaded IRQs and handlers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alice,

[…]

>> +/// The value that can be returned from an IrqHandler or a ThreadedIrqHandler.
>> +pub enum IrqReturn {
>> +    /// The interrupt was not from this device or was not handled.
>> +    None,
>> +
>> +    /// The interrupt was handled by this device.
>> +    Handled,
>> +}
>> +
>> +impl IrqReturn {
>> +    fn into_inner(self) -> u32 {
>> +        match self {
>> +            IrqReturn::None => bindings::irqreturn_IRQ_NONE,
>> +            IrqReturn::Handled => bindings::irqreturn_IRQ_HANDLED,
> 
> One option is to specify these in the enum:
> 
> /// The value that can be returned from an IrqHandler or a ThreadedIrqHandler.
> pub enum IrqReturn {
>    /// The interrupt was not from this device or was not handled.
>    None = bindings::irqreturn_IRQ_NONE,
> 
>    /// The interrupt was handled by this device.
>    Handled = bindings::irqreturn_IRQ_HANDLED,
> }

This requires explicitly setting #[repr(u32)], which is something that was
reverted at an earlier iteration of the series on Benno’s request.

— Daniel




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux