First Support on Ginger and OMAP TI
[linux-ginger.git] / arch / m32r / kernel / irq.c
blob8dfd31e87c4c884d2937d7259bd04f637cef0b11
1 /*
2 * linux/arch/m32r/kernel/irq.c
4 * Copyright (c) 2003, 2004 Hitoshi Yamamoto
5 * Copyright (c) 2004 Hirokazu Takata <takata at linux-m32r.org>
6 */
8 /*
9 * linux/arch/i386/kernel/irq.c
11 * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
13 * This file contains the lowest level m32r-specific interrupt
14 * entry and irq statistics code. All the remaining irq logic is
15 * done by the generic kernel/irq/ code and in the
16 * m32r-specific irq controller code.
19 #include <linux/kernel_stat.h>
20 #include <linux/interrupt.h>
21 #include <linux/seq_file.h>
22 #include <linux/module.h>
23 #include <asm/uaccess.h>
26 * Generic, controller-independent functions:
29 int show_interrupts(struct seq_file *p, void *v)
31 int i = *(loff_t *) v, j;
32 struct irqaction * action;
33 unsigned long flags;
35 if (i == 0) {
36 seq_printf(p, " ");
37 for_each_online_cpu(j)
38 seq_printf(p, "CPU%d ",j);
39 seq_putc(p, '\n');
42 if (i < NR_IRQS) {
43 spin_lock_irqsave(&irq_desc[i].lock, flags);
44 action = irq_desc[i].action;
45 if (!action)
46 goto skip;
47 seq_printf(p, "%3d: ",i);
48 #ifndef CONFIG_SMP
49 seq_printf(p, "%10u ", kstat_irqs(i));
50 #else
51 for_each_online_cpu(j)
52 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
53 #endif
54 seq_printf(p, " %14s", irq_desc[i].chip->typename);
55 seq_printf(p, " %s", action->name);
57 for (action=action->next; action; action = action->next)
58 seq_printf(p, ", %s", action->name);
60 seq_putc(p, '\n');
61 skip:
62 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
64 return 0;
68 * do_IRQ handles all normal device IRQs (the special
69 * SMP cross-CPU interrupts have their own specific
70 * handlers).
72 asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs)
74 struct pt_regs *old_regs;
75 old_regs = set_irq_regs(regs);
76 irq_enter();
78 #ifdef CONFIG_DEBUG_STACKOVERFLOW
79 /* FIXME M32R */
80 #endif
81 __do_IRQ(irq);
82 irq_exit();
83 set_irq_regs(old_regs);
85 return 1;