irqnr.h 817 Bytes
Newer Older
1 2 3
#ifndef _LINUX_IRQNR_H
#define _LINUX_IRQNR_H

4 5
#include <uapi/linux/irqnr.h>

6 7

extern int nr_irqs;
8
extern struct irq_desc *irq_to_desc(unsigned int irq);
9
unsigned int irq_get_next_irq(unsigned int offset);
10

11 12
# define for_each_irq_desc(irq, desc)					\
	for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs;		\
13
	     irq++, desc = irq_to_desc(irq))				\
14 15 16
		if (!desc)						\
			;						\
		else
17 18


19 20
# define for_each_irq_desc_reverse(irq, desc)				\
	for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0;	\
21
	     irq--, desc = irq_to_desc(irq))				\
22 23 24
		if (!desc)						\
			;						\
		else
25

26 27 28 29
# define for_each_active_irq(irq)			\
	for (irq = irq_get_next_irq(0); irq < nr_irqs;	\
	     irq = irq_get_next_irq(irq + 1))

30 31
#define for_each_irq_nr(irq)                   \
       for (irq = 0; irq < nr_irqs; irq++)
32 33

#endif