diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-11-29 03:55:47 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-29 03:55:47 -0500 |
commit | b71d4da092801634d04190693a38ca03bdbe2505 (patch) | |
tree | e4adc88ade5832b844768c114b15d4d97253c4d0 /kernel/irq | |
parent | 656563e32c3f1dfdc35b3944305ece1c5dfeade5 (diff) | |
parent | 624f54be206adf970cd8eece16446b027913e533 (diff) | |
download | op-kernel-dev-b71d4da092801634d04190693a38ca03bdbe2505.zip op-kernel-dev-b71d4da092801634d04190693a38ca03bdbe2505.tar.gz |
Merge branch 'master'
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/manage.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 3bd7226..81c49a4 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -36,6 +36,9 @@ void synchronize_irq(unsigned int irq) { struct irq_desc *desc = irq_desc + irq; + if (irq >= NR_IRQS) + return; + while (desc->status & IRQ_INPROGRESS) cpu_relax(); } @@ -60,6 +63,9 @@ void disable_irq_nosync(unsigned int irq) irq_desc_t *desc = irq_desc + irq; unsigned long flags; + if (irq >= NR_IRQS) + return; + spin_lock_irqsave(&desc->lock, flags); if (!desc->depth++) { desc->status |= IRQ_DISABLED; @@ -86,6 +92,9 @@ void disable_irq(unsigned int irq) { irq_desc_t *desc = irq_desc + irq; + if (irq >= NR_IRQS) + return; + disable_irq_nosync(irq); if (desc->action) synchronize_irq(irq); @@ -108,6 +117,9 @@ void enable_irq(unsigned int irq) irq_desc_t *desc = irq_desc + irq; unsigned long flags; + if (irq >= NR_IRQS) + return; + spin_lock_irqsave(&desc->lock, flags); switch (desc->depth) { case 0: @@ -163,6 +175,9 @@ int setup_irq(unsigned int irq, struct irqaction * new) unsigned long flags; int shared = 0; + if (irq >= NR_IRQS) + return -EINVAL; + if (desc->handler == &no_irq_type) return -ENOSYS; /* |