Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14641
b: refs/heads/master
c: c2b5a25
h: refs/heads/master
i:
  14639: 8b84283
v: v3
  • Loading branch information
Matthew Wilcox authored and Linus Torvalds committed Nov 23, 2005
1 parent 3c0718d commit c4df5b3
Show file tree
Hide file tree
Showing 2 changed files with 16 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: 2d0ebb36038c0626cde662a3b06da9787cfb68c3
refs/heads/master: c2b5a251b9feca727661f1a3278cafb1de4c80f3
15 changes: 15 additions & 0 deletions trunk/kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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;
Expand All @@ -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);
Expand All @@ -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:
Expand Down Expand Up @@ -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;
/*
Expand Down

0 comments on commit c4df5b3

Please sign in to comment.