Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173472
b: refs/heads/master
c: 45b9dea
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Nov 2, 2009
1 parent a99da6f commit 69266ed
Show file tree
Hide file tree
Showing 4 changed files with 35 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: 3d0de414423a20af741b692243317f423827489b
refs/heads/master: 45b9deaf14e74543371aa8faea69c14e27b038c6
6 changes: 6 additions & 0 deletions trunk/arch/sh/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ void __init init_IRQ(void)
{
plat_irq_setup();

/*
* Pin any of the legacy IRQ vectors that haven't already been
* grabbed by the platform
*/
reserve_irq_legacy();

/* Perform the machine specific initialisation */
if (sh_mv.mv_init_irq)
sh_mv.mv_init_irq();
Expand Down
25 changes: 25 additions & 0 deletions trunk/drivers/sh/intc.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,3 +928,28 @@ void destroy_irq(unsigned int irq)
__clear_bit(irq, intc_irq_map);
spin_unlock_irqrestore(&vector_lock, flags);
}

int reserve_irq_vector(unsigned int irq)
{
unsigned long flags;
int ret = 0;

spin_lock_irqsave(&vector_lock, flags);
if (test_and_set_bit(irq, intc_irq_map))
ret = -EBUSY;
spin_unlock_irqrestore(&vector_lock, flags);

return ret;
}

void reserve_irq_legacy(void)
{
unsigned long flags;
int i, j;

spin_lock_irqsave(&vector_lock, flags);
j = find_first_bit(intc_irq_map, nr_irqs);
for (i = 0; i < j; i++)
__set_bit(i, intc_irq_map);
spin_unlock_irqrestore(&vector_lock, flags);
}
3 changes: 3 additions & 0 deletions trunk/include/linux/sh_intc.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,7 @@ struct intc_desc symbol __initdata = { \
void __init register_intc_controller(struct intc_desc *desc);
int intc_set_priority(unsigned int irq, unsigned int prio);

int reserve_irq_vector(unsigned int irq);
void reserve_irq_legacy(void);

#endif /* __SH_INTC_H */

0 comments on commit 69266ed

Please sign in to comment.