Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / include / linux / irqnr.h
blob3496baa0b07f37929eb68216738a10182257bda5
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_IRQNR_H
3 #define _LINUX_IRQNR_H
5 #include <uapi/linux/irqnr.h>
8 extern int nr_irqs;
9 extern struct irq_desc *irq_to_desc(unsigned int irq);
10 unsigned int irq_get_next_irq(unsigned int offset);
12 # define for_each_irq_desc(irq, desc) \
13 for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \
14 irq++, desc = irq_to_desc(irq)) \
15 if (!desc) \
16 ; \
17 else
20 # define for_each_irq_desc_reverse(irq, desc) \
21 for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \
22 irq--, desc = irq_to_desc(irq)) \
23 if (!desc) \
24 ; \
25 else
27 # define for_each_active_irq(irq) \
28 for (irq = irq_get_next_irq(0); irq < nr_irqs; \
29 irq = irq_get_next_irq(irq + 1))
31 #define for_each_irq_nr(irq) \
32 for (irq = 0; irq < nr_irqs; irq++)
34 #endif