-/* $Id: irq.c,v 1.8 2003/07/04 08:27:52 starvik Exp $
+/*
*
* linux/arch/cris/kernel/irq.c
*
#include <linux/init.h>
#include <linux/seq_file.h>
#include <linux/errno.h>
+#include <linux/bitops.h>
#include <asm/io.h>
-#include <asm/bitops.h>
/* Defined in arch specific irq.c */
extern void arch_setup_irq(int irq);
if (!action)
goto skip;
seq_printf(p, "%2d: %10u %c %s",
- i, kstat_cpu(0).irqs[i],
+ i, kstat_this_cpu.irqs[i],
(action->flags & SA_INTERRUPT) ? '+' : ' ',
action->name);
for (action = action->next; action; action = action->next) {
{
struct irqaction *action;
int do_random, cpu;
- int retval = 0;
+ int ret, retval = 0;
cpu = smp_processor_id();
irq_enter();
- kstat_cpu(cpu).irqs[irq]++;
+ kstat_cpu(cpu).irqs[irq - FIRST_IRQ]++;
+ action = irq_action[irq - FIRST_IRQ];
- action = irq_action[irq];
if (action) {
if (!(action->flags & SA_INTERRUPT))
local_irq_enable();
- action = irq_action[irq];
do_random = 0;
do {
- do_random |= action->flags;
- retval |= action->handler(irq, action->dev_id, regs);
+ ret = action->handler(irq, action->dev_id, regs);
+ if (ret == IRQ_HANDLED)
+ do_random |= action->flags;
+ retval |= ret;
action = action->next;
} while (action);
local_irq_disable();
}
irq_exit();
-
- if (softirq_pending(cpu))
- do_softirq();
-
- /* unmasking and bottom half handling is done magically for us. */
}
/* this function links in a handler into the chain of handlers for the
struct irqaction *old, **p;
unsigned long flags;
- p = irq_action + irq;
+ p = irq_action + irq - FIRST_IRQ;
if ((old = *p) != NULL) {
/* Can't share interrupts unless both agree to */
if (!(old->flags & new->flags & SA_SHIRQ))
int retval;
struct irqaction * action;
- /* interrupts 0 and 1 are hardware breakpoint and NMI and we can't support
- these yet. interrupt 15 is the multiple irq, it's special. */
-
- if(irq < 2 || irq == 15 || irq >= NR_IRQS)
- return -EINVAL;
-
if(!handler)
return -EINVAL;
action->handler = handler;
action->flags = irqflags;
- action->mask = 0;
+ cpus_clear(action->mask);
action->name = devname;
action->next = NULL;
action->dev_id = dev_id;
printk("Trying to free IRQ%d\n",irq);
return;
}
- for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) {
+ for (p = irq - FIRST_IRQ + irq_action; (action = *p) != NULL; p = &action->next) {
if (action->dev_id != dev_id)
continue;
local_save_flags(flags);
local_irq_disable();
*p = action->next;
- if (!irq_action[irq]) {
+ if (!irq_action[irq - FIRST_IRQ]) {
mask_irq(irq);
arch_free_irq(irq);
}