diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2006-06-25 08:47:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:00:58 -0400 |
commit | 200a3d352cd5e0ae8fb96bfcf8103f7b7c60645b (patch) | |
tree | e9db90ac38cbfba0f4a4c541733fc4ebd09c5fd7 /arch/m68k/mvme147 | |
parent | ebba61d5b05ecfda388dd4c156bafdb78d398055 (diff) |
[PATCH] m68k: convert VME irq code
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/m68k/mvme147')
-rw-r--r-- | arch/m68k/mvme147/147ints.c | 146 | ||||
-rw-r--r-- | arch/m68k/mvme147/Makefile | 2 | ||||
-rw-r--r-- | arch/m68k/mvme147/config.c | 22 |
3 files changed, 10 insertions, 160 deletions
diff --git a/arch/m68k/mvme147/147ints.c b/arch/m68k/mvme147/147ints.c deleted file mode 100644 index b4aa5e8f44ea..000000000000 --- a/arch/m68k/mvme147/147ints.c +++ /dev/null | |||
@@ -1,146 +0,0 @@ | |||
1 | /* | ||
2 | * arch/m68k/mvme147/147ints.c | ||
3 | * | ||
4 | * Copyright (C) 1997 Richard Hirst [richard@sleepie.demon.co.uk] | ||
5 | * | ||
6 | * based on amiints.c -- Amiga Linux interrupt handling code | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file README.legal in the main directory of this archive | ||
10 | * for more details. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/types.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/errno.h> | ||
17 | #include <linux/interrupt.h> | ||
18 | #include <linux/seq_file.h> | ||
19 | |||
20 | #include <asm/ptrace.h> | ||
21 | #include <asm/system.h> | ||
22 | #include <asm/irq.h> | ||
23 | #include <asm/traps.h> | ||
24 | |||
25 | static irqreturn_t mvme147_defhand (int irq, void *dev_id, struct pt_regs *fp); | ||
26 | |||
27 | /* | ||
28 | * This should ideally be 4 elements only, for speed. | ||
29 | */ | ||
30 | |||
31 | static struct { | ||
32 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | ||
33 | unsigned long flags; | ||
34 | void *dev_id; | ||
35 | const char *devname; | ||
36 | unsigned count; | ||
37 | } irq_tab[256]; | ||
38 | |||
39 | /* | ||
40 | * void mvme147_init_IRQ (void) | ||
41 | * | ||
42 | * Parameters: None | ||
43 | * | ||
44 | * Returns: Nothing | ||
45 | * | ||
46 | * This function is called during kernel startup to initialize | ||
47 | * the mvme147 IRQ handling routines. | ||
48 | */ | ||
49 | |||
50 | void mvme147_init_IRQ (void) | ||
51 | { | ||
52 | int i; | ||
53 | |||
54 | for (i = 0; i < 256; i++) { | ||
55 | irq_tab[i].handler = mvme147_defhand; | ||
56 | irq_tab[i].flags = IRQ_FLG_STD; | ||
57 | irq_tab[i].dev_id = NULL; | ||
58 | irq_tab[i].devname = NULL; | ||
59 | irq_tab[i].count = 0; | ||
60 | } | ||
61 | } | ||
62 | |||
63 | int mvme147_request_irq(unsigned int irq, | ||
64 | irqreturn_t (*handler)(int, void *, struct pt_regs *), | ||
65 | unsigned long flags, const char *devname, void *dev_id) | ||
66 | { | ||
67 | if (irq > 255) { | ||
68 | printk("%s: Incorrect IRQ %d from %s\n", __FUNCTION__, irq, devname); | ||
69 | return -ENXIO; | ||
70 | } | ||
71 | if (!(irq_tab[irq].flags & IRQ_FLG_STD)) { | ||
72 | if (irq_tab[irq].flags & IRQ_FLG_LOCK) { | ||
73 | printk("%s: IRQ %d from %s is not replaceable\n", | ||
74 | __FUNCTION__, irq, irq_tab[irq].devname); | ||
75 | return -EBUSY; | ||
76 | } | ||
77 | if (flags & IRQ_FLG_REPLACE) { | ||
78 | printk("%s: %s can't replace IRQ %d from %s\n", | ||
79 | __FUNCTION__, devname, irq, irq_tab[irq].devname); | ||
80 | return -EBUSY; | ||
81 | } | ||
82 | } | ||
83 | irq_tab[irq].handler = handler; | ||
84 | irq_tab[irq].flags = flags; | ||
85 | irq_tab[irq].dev_id = dev_id; | ||
86 | irq_tab[irq].devname = devname; | ||
87 | return 0; | ||
88 | } | ||
89 | |||
90 | void mvme147_free_irq(unsigned int irq, void *dev_id) | ||
91 | { | ||
92 | if (irq > 255) { | ||
93 | printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq); | ||
94 | return; | ||
95 | } | ||
96 | if (irq_tab[irq].dev_id != dev_id) | ||
97 | printk("%s: Removing probably wrong IRQ %d from %s\n", | ||
98 | __FUNCTION__, irq, irq_tab[irq].devname); | ||
99 | |||
100 | irq_tab[irq].handler = mvme147_defhand; | ||
101 | irq_tab[irq].flags = IRQ_FLG_STD; | ||
102 | irq_tab[irq].dev_id = NULL; | ||
103 | irq_tab[irq].devname = NULL; | ||
104 | } | ||
105 | |||
106 | irqreturn_t mvme147_process_int (unsigned long vec, struct pt_regs *fp) | ||
107 | { | ||
108 | if (vec > 255) { | ||
109 | printk ("mvme147_process_int: Illegal vector %ld\n", vec); | ||
110 | return IRQ_NONE; | ||
111 | } else { | ||
112 | irq_tab[vec].count++; | ||
113 | irq_tab[vec].handler(vec, irq_tab[vec].dev_id, fp); | ||
114 | return IRQ_HANDLED; | ||
115 | } | ||
116 | } | ||
117 | |||
118 | int show_mvme147_interrupts (struct seq_file *p, void *v) | ||
119 | { | ||
120 | int i; | ||
121 | |||
122 | for (i = 0; i < 256; i++) { | ||
123 | if (irq_tab[i].count) | ||
124 | seq_printf(p, "Vec 0x%02x: %8d %s\n", | ||
125 | i, irq_tab[i].count, | ||
126 | irq_tab[i].devname ? irq_tab[i].devname : "free"); | ||
127 | } | ||
128 | return 0; | ||
129 | } | ||
130 | |||
131 | |||
132 | static irqreturn_t mvme147_defhand (int irq, void *dev_id, struct pt_regs *fp) | ||
133 | { | ||
134 | printk ("Unknown interrupt 0x%02x\n", irq); | ||
135 | return IRQ_NONE; | ||
136 | } | ||
137 | |||
138 | void mvme147_enable_irq (unsigned int irq) | ||
139 | { | ||
140 | } | ||
141 | |||
142 | |||
143 | void mvme147_disable_irq (unsigned int irq) | ||
144 | { | ||
145 | } | ||
146 | |||
diff --git a/arch/m68k/mvme147/Makefile b/arch/m68k/mvme147/Makefile index f0153ed3efa5..a36d38dbfbbc 100644 --- a/arch/m68k/mvme147/Makefile +++ b/arch/m68k/mvme147/Makefile | |||
@@ -2,4 +2,4 @@ | |||
2 | # Makefile for Linux arch/m68k/mvme147 source directory | 2 | # Makefile for Linux arch/m68k/mvme147 source directory |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := config.o 147ints.o | 5 | obj-y := config.o |
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c index 0fcf9720c2fe..0cd0e5bddcee 100644 --- a/arch/m68k/mvme147/config.c +++ b/arch/m68k/mvme147/config.c | |||
@@ -36,15 +36,8 @@ | |||
36 | #include <asm/mvme147hw.h> | 36 | #include <asm/mvme147hw.h> |
37 | 37 | ||
38 | 38 | ||
39 | extern irqreturn_t mvme147_process_int (int level, struct pt_regs *regs); | ||
40 | extern void mvme147_init_IRQ (void); | ||
41 | extern void mvme147_free_irq (unsigned int, void *); | ||
42 | extern int show_mvme147_interrupts (struct seq_file *, void *); | ||
43 | extern void mvme147_enable_irq (unsigned int); | ||
44 | extern void mvme147_disable_irq (unsigned int); | ||
45 | static void mvme147_get_model(char *model); | 39 | static void mvme147_get_model(char *model); |
46 | static int mvme147_get_hardware_list(char *buffer); | 40 | static int mvme147_get_hardware_list(char *buffer); |
47 | extern int mvme147_request_irq (unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id); | ||
48 | extern void mvme147_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); | 41 | extern void mvme147_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); |
49 | extern unsigned long mvme147_gettimeoffset (void); | 42 | extern unsigned long mvme147_gettimeoffset (void); |
50 | extern int mvme147_hwclk (int, struct rtc_time *); | 43 | extern int mvme147_hwclk (int, struct rtc_time *); |
@@ -91,6 +84,15 @@ static int mvme147_get_hardware_list(char *buffer) | |||
91 | return 0; | 84 | return 0; |
92 | } | 85 | } |
93 | 86 | ||
87 | /* | ||
88 | * This function is called during kernel startup to initialize | ||
89 | * the mvme147 IRQ handling routines. | ||
90 | */ | ||
91 | |||
92 | void mvme147_init_IRQ(void) | ||
93 | { | ||
94 | m68k_setup_user_interrupt(VEC_USER, 192, NULL); | ||
95 | } | ||
94 | 96 | ||
95 | void __init config_mvme147(void) | 97 | void __init config_mvme147(void) |
96 | { | 98 | { |
@@ -101,12 +103,6 @@ void __init config_mvme147(void) | |||
101 | mach_hwclk = mvme147_hwclk; | 103 | mach_hwclk = mvme147_hwclk; |
102 | mach_set_clock_mmss = mvme147_set_clock_mmss; | 104 | mach_set_clock_mmss = mvme147_set_clock_mmss; |
103 | mach_reset = mvme147_reset; | 105 | mach_reset = mvme147_reset; |
104 | mach_free_irq = mvme147_free_irq; | ||
105 | mach_process_int = mvme147_process_int; | ||
106 | mach_get_irq_list = show_mvme147_interrupts; | ||
107 | mach_request_irq = mvme147_request_irq; | ||
108 | enable_irq = mvme147_enable_irq; | ||
109 | disable_irq = mvme147_disable_irq; | ||
110 | mach_get_model = mvme147_get_model; | 106 | mach_get_model = mvme147_get_model; |
111 | mach_get_hardware_list = mvme147_get_hardware_list; | 107 | mach_get_hardware_list = mvme147_get_hardware_list; |
112 | 108 | ||