forked from luck/tmp_suning_uos_patched
genirq: Implement sane enumeration
Use the allocator bitmap to lookup active interrupts. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
13bfe99e09
commit
a98d24b71b
|
@ -25,6 +25,7 @@
|
|||
|
||||
extern int nr_irqs;
|
||||
extern struct irq_desc *irq_to_desc(unsigned int irq);
|
||||
unsigned int irq_get_next_irq(unsigned int offset);
|
||||
|
||||
# define for_each_irq_desc(irq, desc) \
|
||||
for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \
|
||||
|
@ -47,6 +48,10 @@ extern struct irq_desc *irq_to_desc(unsigned int irq);
|
|||
#define irq_node(irq) 0
|
||||
#endif
|
||||
|
||||
# define for_each_active_irq(irq) \
|
||||
for (irq = irq_get_next_irq(0); irq < nr_irqs; \
|
||||
irq = irq_get_next_irq(irq + 1))
|
||||
|
||||
#endif /* CONFIG_GENERIC_HARDIRQS */
|
||||
|
||||
#define for_each_irq_nr(irq) \
|
||||
|
|
|
@ -463,6 +463,17 @@ irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* irq_get_next_irq - get next allocated irq number
|
||||
* @offset: where to start the search
|
||||
*
|
||||
* Returns next irq number after offset or nr_irqs if none is found.
|
||||
*/
|
||||
unsigned int irq_get_next_irq(unsigned int offset)
|
||||
{
|
||||
return find_next_bit(allocated_irqs, nr_irqs, offset);
|
||||
}
|
||||
|
||||
/* Statistics access */
|
||||
void clear_kstat_irqs(struct irq_desc *desc)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user