|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC 10/29] xen/arm: Add helpers to retrieve an interrupt description from the device tree
On 04/29/2013 04:28 PM, Ian Campbell wrote:
> On Mon, 2013-04-29 at 00:01 +0100, Julien Grall wrote:
>> diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
>> index 7386358..42dc172 100644
>> --- a/xen/include/xen/irq.h
>> +++ b/xen/include/xen/irq.h
>> @@ -33,6 +33,31 @@ struct irqaction {
>> #define NEVER_ASSIGN_IRQ (-2)
>> #define FREE_TO_ASSIGN_IRQ (-3)
>>
>> +/**
>> + * IRQ line type.
>> + *
>> + * IRQ_TYPE_NONE - default, unspecified type
>> + * IRQ_TYPE_EDGE_RISING - rising edge triggered
>> + * IRQ_TYPE_EDGE_FALLING - falling edge triggered
>> + * IRQ_TYPE_EDGE_BOTH - rising and falling edge triggered
>> + * IRQ_TYPE_LEVEL_HIGH - high level triggered
>> + * IRQ_TYPE_LEVEL_LOW - low level triggered
>> + * IRQ_TYPE_LEVEL_MASK - Mask to filter out the level bits
>> + * IRQ_TYPE_SENSE_MASK - Mask for all the above bits
>> + */
>> +#define IRQ_TYPE_NONE 0x00000000
>> +#define IRQ_TYPE_EDGE_RISING 0x00000001
>> +#define IRQ_TYPE_EDGE_FALLING 0x00000002
>> +#define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING |
>> IRQ_TYPE_EDGE_RISING)
>> +#define IRQ_TYPE_LEVEL_HIGH 0x00000004
>> +#define IRQ_TYPE_LEVEL_LOW 0x00000008
>> +#define IRQ_TYPE_LEVEL_MASK (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)
>> +#define IRQ_TYPE_SENSE_MASK 0x0000000f
>> +
>> +/* If type == IRQ_TYPE_NONE, assume we use level triggered */
>> +#define irq_is_level_trigger(irq) \
>> + (((irq)->type & IRQ_TYPE_LEVEL_MASK) || ((irq)->type == IRQ_TYPE_NONE))
>
> What is the type of irq here? None of the structs in this irq.h have a
> type member, so I must be looking in the wrong place.
It's specified if an IRQ will be edge-triggered or level-triggered.
Except the irq_is_level_trigger macro, all this code is copied from
include/linux/irq.h in linux. That's why I have put this code here.
> Or is it struct dt_irq? If so then can we put these in a DT (or ARM)
> specific header and add a DT_ prefix, rather than pollute the non-DT
> headers, e.g. these defines have no meaning on x86 AFAICT.
Yes. I will move to device_tree.h.
--
Julien
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |