Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 212169
b: refs/heads/master
c: a98d24b
h: refs/heads/master
i:
  212167: 54a604a
v: v3
  • Loading branch information
Thomas Gleixner committed Oct 12, 2010
1 parent d18b290 commit 4471457
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 13bfe99e09123ef5edb6acb81ba337d2db600b53
refs/heads/master: a98d24b71b6e229965f18dc00d28dc71cb8fe324
5 changes: 5 additions & 0 deletions trunk/include/linux/irqnr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand All @@ -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) \
Expand Down
11 changes: 11 additions & 0 deletions trunk/kernel/irq/irqdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 4471457

Please sign in to comment.