aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu/kernel
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2007-07-19 04:49:12 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:50 -0400
commit2502b667ea835ee16685c74b2a0d89ba8afe117a (patch)
tree31d492fb934df6d83819b679f3aa8d7f6952396d /arch/m68knommu/kernel
parentf8af0bb890d6cdcb09ec042c128e217a7c500355 (diff)
m68knommu: generic irq handling
Change the m68knommu irq handling to use the generic irq framework. Signed-off-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68knommu/kernel')
-rw-r--r--arch/m68knommu/kernel/Makefile4
-rw-r--r--arch/m68knommu/kernel/asm-offsets.c5
-rw-r--r--arch/m68knommu/kernel/irq.c82
-rw-r--r--arch/m68knommu/kernel/traps.c2
4 files changed, 84 insertions, 9 deletions
diff --git a/arch/m68knommu/kernel/Makefile b/arch/m68knommu/kernel/Makefile
index 1c6cd1ab571e..1524b39ad63f 100644
--- a/arch/m68knommu/kernel/Makefile
+++ b/arch/m68knommu/kernel/Makefile
@@ -4,8 +4,8 @@
4 4
5extra-y := vmlinux.lds 5extra-y := vmlinux.lds
6 6
7obj-y += dma.o entry.o init_task.o m68k_ksyms.o process.o ptrace.o semaphore.o \ 7obj-y += dma.o entry.o init_task.o irq.o m68k_ksyms.o process.o ptrace.o \
8 setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o 8 semaphore.o setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o
9 9
10obj-$(CONFIG_MODULES) += module.o 10obj-$(CONFIG_MODULES) += module.o
11obj-$(CONFIG_COMEMPCI) += comempci.o 11obj-$(CONFIG_COMEMPCI) += comempci.o
diff --git a/arch/m68knommu/kernel/asm-offsets.c b/arch/m68knommu/kernel/asm-offsets.c
index 7cd183d346ef..d97b89bae53c 100644
--- a/arch/m68knommu/kernel/asm-offsets.c
+++ b/arch/m68knommu/kernel/asm-offsets.c
@@ -15,7 +15,6 @@
15#include <linux/hardirq.h> 15#include <linux/hardirq.h>
16#include <asm/bootinfo.h> 16#include <asm/bootinfo.h>
17#include <asm/irq.h> 17#include <asm/irq.h>
18#include <asm/irqnode.h>
19#include <asm/thread_info.h> 18#include <asm/thread_info.h>
20 19
21#define DEFINE(sym, val) \ 20#define DEFINE(sym, val) \
@@ -72,10 +71,6 @@ int main(void)
72#else 71#else
73 /* bitfields are a bit difficult */ 72 /* bitfields are a bit difficult */
74 DEFINE(PT_VECTOR, offsetof(struct pt_regs, pc) + 4); 73 DEFINE(PT_VECTOR, offsetof(struct pt_regs, pc) + 4);
75 /* offsets into the irq_handler struct */
76 DEFINE(IRQ_HANDLER, offsetof(struct irq_node, handler));
77 DEFINE(IRQ_DEVID, offsetof(struct irq_node, dev_id));
78 DEFINE(IRQ_NEXT, offsetof(struct irq_node, next));
79#endif 74#endif
80 75
81 /* offsets into the kernel_stat struct */ 76 /* offsets into the kernel_stat struct */
diff --git a/arch/m68knommu/kernel/irq.c b/arch/m68knommu/kernel/irq.c
new file mode 100644
index 000000000000..bba1bb48a21f
--- /dev/null
+++ b/arch/m68knommu/kernel/irq.c
@@ -0,0 +1,82 @@
1/*
2 * irq.c
3 *
4 * (C) Copyright 2007, Greg Ungerer <gerg@snapgear.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/types.h>
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/kernel_stat.h>
15#include <linux/interrupt.h>
16#include <linux/irq.h>
17#include <linux/seq_file.h>
18#include <asm/system.h>
19#include <asm/traps.h>
20
21asmlinkage void do_IRQ(int irq, struct pt_regs *regs)
22{
23 struct pt_regs *oldregs = set_irq_regs(regs);
24
25 irq_enter();
26 __do_IRQ(irq);
27 irq_exit();
28
29 set_irq_regs(oldregs);
30}
31
32void ack_bad_irq(unsigned int irq)
33{
34 printk(KERN_ERR "IRQ: unexpected irq=%d\n", irq);
35}
36
37static struct irq_chip m_irq_chip = {
38 .name = "M68K-INTC",
39 .enable = enable_vector,
40 .disable = disable_vector,
41 .ack = ack_vector,
42};
43
44void __init init_IRQ(void)
45{
46 int irq;
47
48 init_vectors();
49
50 for (irq = 0; (irq < NR_IRQS); irq++) {
51 irq_desc[irq].status = IRQ_DISABLED;
52 irq_desc[irq].action = NULL;
53 irq_desc[irq].depth = 1;
54 irq_desc[irq].chip = &m_irq_chip;
55 }
56}
57
58int show_interrupts(struct seq_file *p, void *v)
59{
60 struct irqaction *ap;
61 int irq = *((loff_t *) v);
62
63 if (irq == 0)
64 seq_puts(p, " CPU0\n");
65
66 if (irq < NR_IRQS) {
67 ap = irq_desc[irq].action;
68 if (ap) {
69 seq_printf(p, "%3d: ", irq);
70 seq_printf(p, "%10u ", kstat_irqs(irq));
71 seq_printf(p, "%14s ", irq_desc[irq].chip->name);
72
73 seq_printf(p, "%s", ap->name);
74 for (ap = ap->next; ap; ap = ap->next)
75 seq_printf(p, ", %s", ap->name);
76 seq_putc(p, '\n');
77 }
78 }
79
80 return 0;
81}
82
diff --git a/arch/m68knommu/kernel/traps.c b/arch/m68knommu/kernel/traps.c
index fde04e1757f7..9c943a4accc0 100644
--- a/arch/m68knommu/kernel/traps.c
+++ b/arch/m68knommu/kernel/traps.c
@@ -62,8 +62,6 @@ static char const * const vec_names[] = {
62 62
63void __init trap_init(void) 63void __init trap_init(void)
64{ 64{
65 if (mach_trap_init)
66 mach_trap_init();
67} 65}
68 66
69void die_if_kernel(char *str, struct pt_regs *fp, int nr) 67void die_if_kernel(char *str, struct pt_regs *fp, int nr)