diff options
author | Len Brown <len.brown@intel.com> | 2005-12-06 17:31:30 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-12-06 17:31:30 -0500 |
commit | 3d5271f9883cba7b54762bc4fe027d4172f06db7 (patch) | |
tree | ab8a881a14478598a0c8bda0d26c62cdccfffd6d /kernel/irq/manage.c | |
parent | 378b2556f4e09fa6f87ff0cb5c4395ff28257d02 (diff) | |
parent | 9115a6c787596e687df03010d97fccc5e0762506 (diff) |
Pull release into acpica branch
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r-- | kernel/irq/manage.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 1cfdb08ddf20..81c49a4d679e 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -24,6 +24,7 @@ cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS]; | |||
24 | 24 | ||
25 | /** | 25 | /** |
26 | * synchronize_irq - wait for pending IRQ handlers (on other CPUs) | 26 | * synchronize_irq - wait for pending IRQ handlers (on other CPUs) |
27 | * @irq: interrupt number to wait for | ||
27 | * | 28 | * |
28 | * This function waits for any pending IRQ handlers for this interrupt | 29 | * This function waits for any pending IRQ handlers for this interrupt |
29 | * to complete before returning. If you use this function while | 30 | * to complete before returning. If you use this function while |
@@ -35,6 +36,9 @@ void synchronize_irq(unsigned int irq) | |||
35 | { | 36 | { |
36 | struct irq_desc *desc = irq_desc + irq; | 37 | struct irq_desc *desc = irq_desc + irq; |
37 | 38 | ||
39 | if (irq >= NR_IRQS) | ||
40 | return; | ||
41 | |||
38 | while (desc->status & IRQ_INPROGRESS) | 42 | while (desc->status & IRQ_INPROGRESS) |
39 | cpu_relax(); | 43 | cpu_relax(); |
40 | } | 44 | } |
@@ -59,6 +63,9 @@ void disable_irq_nosync(unsigned int irq) | |||
59 | irq_desc_t *desc = irq_desc + irq; | 63 | irq_desc_t *desc = irq_desc + irq; |
60 | unsigned long flags; | 64 | unsigned long flags; |
61 | 65 | ||
66 | if (irq >= NR_IRQS) | ||
67 | return; | ||
68 | |||
62 | spin_lock_irqsave(&desc->lock, flags); | 69 | spin_lock_irqsave(&desc->lock, flags); |
63 | if (!desc->depth++) { | 70 | if (!desc->depth++) { |
64 | desc->status |= IRQ_DISABLED; | 71 | desc->status |= IRQ_DISABLED; |
@@ -85,6 +92,9 @@ void disable_irq(unsigned int irq) | |||
85 | { | 92 | { |
86 | irq_desc_t *desc = irq_desc + irq; | 93 | irq_desc_t *desc = irq_desc + irq; |
87 | 94 | ||
95 | if (irq >= NR_IRQS) | ||
96 | return; | ||
97 | |||
88 | disable_irq_nosync(irq); | 98 | disable_irq_nosync(irq); |
89 | if (desc->action) | 99 | if (desc->action) |
90 | synchronize_irq(irq); | 100 | synchronize_irq(irq); |
@@ -107,6 +117,9 @@ void enable_irq(unsigned int irq) | |||
107 | irq_desc_t *desc = irq_desc + irq; | 117 | irq_desc_t *desc = irq_desc + irq; |
108 | unsigned long flags; | 118 | unsigned long flags; |
109 | 119 | ||
120 | if (irq >= NR_IRQS) | ||
121 | return; | ||
122 | |||
110 | spin_lock_irqsave(&desc->lock, flags); | 123 | spin_lock_irqsave(&desc->lock, flags); |
111 | switch (desc->depth) { | 124 | switch (desc->depth) { |
112 | case 0: | 125 | case 0: |
@@ -162,6 +175,9 @@ int setup_irq(unsigned int irq, struct irqaction * new) | |||
162 | unsigned long flags; | 175 | unsigned long flags; |
163 | int shared = 0; | 176 | int shared = 0; |
164 | 177 | ||
178 | if (irq >= NR_IRQS) | ||
179 | return -EINVAL; | ||
180 | |||
165 | if (desc->handler == &no_irq_type) | 181 | if (desc->handler == &no_irq_type) |
166 | return -ENOSYS; | 182 | return -ENOSYS; |
167 | /* | 183 | /* |