aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/sh/intc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/sh/intc.c b/drivers/sh/intc.c
index 4789df43c0f9..a7e5c2e9986c 100644
--- a/drivers/sh/intc.c
+++ b/drivers/sh/intc.c
@@ -928,3 +928,28 @@ void destroy_irq(unsigned int irq)
928 __clear_bit(irq, intc_irq_map); 928 __clear_bit(irq, intc_irq_map);
929 spin_unlock_irqrestore(&vector_lock, flags); 929 spin_unlock_irqrestore(&vector_lock, flags);
930} 930}
931
932int reserve_irq_vector(unsigned int irq)
933{
934 unsigned long flags;
935 int ret = 0;
936
937 spin_lock_irqsave(&vector_lock, flags);
938 if (test_and_set_bit(irq, intc_irq_map))
939 ret = -EBUSY;
940 spin_unlock_irqrestore(&vector_lock, flags);
941
942 return ret;
943}
944
945void reserve_irq_legacy(void)
946{
947 unsigned long flags;
948 int i, j;
949
950 spin_lock_irqsave(&vector_lock, flags);
951 j = find_first_bit(intc_irq_map, nr_irqs);
952 for (i = 0; i < j; i++)
953 __set_bit(i, intc_irq_map);
954 spin_unlock_irqrestore(&vector_lock, flags);
955}