irqnr.h 817 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef _LINUX_IRQNR_H
  2. #define _LINUX_IRQNR_H
  3. #include <uapi/linux/irqnr.h>
  4. extern int nr_irqs;
  5. extern struct irq_desc *irq_to_desc(unsigned int irq);
  6. unsigned int irq_get_next_irq(unsigned int offset);
  7. # define for_each_irq_desc(irq, desc) \
  8. for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \
  9. irq++, desc = irq_to_desc(irq)) \
  10. if (!desc) \
  11. ; \
  12. else
  13. # define for_each_irq_desc_reverse(irq, desc) \
  14. for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \
  15. irq--, desc = irq_to_desc(irq)) \
  16. if (!desc) \
  17. ; \
  18. else
  19. # define for_each_active_irq(irq) \
  20. for (irq = irq_get_next_irq(0); irq < nr_irqs; \
  21. irq = irq_get_next_irq(irq + 1))
  22. #define for_each_irq_nr(irq) \
  23. for (irq = 0; irq < nr_irqs; irq++)
  24. #endif