blob: 15dbbe29733425b8a0e7f773096b8da46dcc4885 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/arch/m68k/kernel/ints.c -- Linux/m68k general interrupt handling code
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file COPYING in the main directory of this archive
6 * for more details.
7 *
8 * 07/03/96: Timer initialization, and thus mach_sched_init(),
9 * removed from request_irq() and moved to init_time().
10 * We should therefore consider renaming our add_isr() and
11 * remove_isr() to request_irq() and free_irq()
12 * respectively, so they are compliant with the other
13 * architectures. /Jes
14 * 11/07/96: Changed all add_/remove_isr() to request_/free_irq() calls.
15 * Removed irq list support, if any machine needs an irq server
16 * it must implement this itself (as it's already done), instead
17 * only default handler are used with mach_default_handler.
18 * request_irq got some flags different from other architectures:
19 * - IRQ_FLG_REPLACE : Replace an existing handler (the default one
20 * can be replaced without this flag)
21 * - IRQ_FLG_LOCK : handler can't be replaced
22 * There are other machine depending flags, see there
23 * If you want to replace a default handler you should know what
24 * you're doing, since it might handle different other irq sources
25 * which must be served /Roman Zippel
26 */
27
Linus Torvalds1da177e2005-04-16 15:20:36 -070028#include <linux/module.h>
29#include <linux/types.h>
30#include <linux/sched.h>
Andrew Morton6168a702007-02-17 21:22:39 -080031#include <linux/interrupt.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070032#include <linux/kernel_stat.h>
33#include <linux/errno.h>
34#include <linux/init.h>
35
36#include <asm/setup.h>
37#include <asm/system.h>
38#include <asm/irq.h>
39#include <asm/traps.h>
40#include <asm/page.h>
41#include <asm/machdep.h>
Roman Zippel68387c42006-06-25 05:47:01 -070042#include <asm/cacheflush.h>
Al Viro2850bc22006-10-07 14:16:45 +010043#include <asm/irq_regs.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070044
45#ifdef CONFIG_Q40
46#include <asm/q40ints.h>
47#endif
48
Roman Zippel68387c42006-06-25 05:47:01 -070049extern u32 auto_irqhandler_fixup[];
50extern u32 user_irqhandler_fixup[];
51extern u16 user_irqvec_fixup[];
52
Linus Torvalds1da177e2005-04-16 15:20:36 -070053/* table for system interrupt handlers */
Geert Uytterhoeven6549d532011-04-17 21:59:23 +020054static struct irq_data *irq_list[NR_IRQS];
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +020055static struct irq_chip *irq_chip[NR_IRQS];
Roman Zippel68387c42006-06-25 05:47:01 -070056static int irq_depth[NR_IRQS];
57
Geert Uytterhoeven40a72c82011-05-27 22:33:41 +020058static inline int irq_set_chip(unsigned int irq, struct irq_chip *chip)
59{
60 irq_chip[irq] = chip;
61 return 0;
62}
63
Roman Zippel68387c42006-06-25 05:47:01 -070064static int m68k_first_user_vec;
Roman Zippelb5dc7842006-06-25 05:47:00 -070065
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +020066static struct irq_chip auto_irq_chip = {
Roman Zippelb5dc7842006-06-25 05:47:00 -070067 .name = "auto",
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +020068 .irq_startup = m68k_irq_startup,
69 .irq_shutdown = m68k_irq_shutdown,
Roman Zippelb5dc7842006-06-25 05:47:00 -070070};
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +020072static struct irq_chip user_irq_chip = {
Roman Zippel68387c42006-06-25 05:47:01 -070073 .name = "user",
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +020074 .irq_startup = m68k_irq_startup,
75 .irq_shutdown = m68k_irq_shutdown,
Linus Torvalds1da177e2005-04-16 15:20:36 -070076};
77
Linus Torvalds1da177e2005-04-16 15:20:36 -070078#define NUM_IRQ_NODES 100
Geert Uytterhoeven6549d532011-04-17 21:59:23 +020079static struct irq_data nodes[NUM_IRQ_NODES];
Linus Torvalds1da177e2005-04-16 15:20:36 -070080
Linus Torvalds1da177e2005-04-16 15:20:36 -070081/*
82 * void init_IRQ(void)
83 *
84 * Parameters: None
85 *
86 * Returns: Nothing
87 *
88 * This function should be called during kernel startup to initialize
89 * the IRQ handling routines.
90 */
91
92void __init init_IRQ(void)
93{
94 int i;
95
Roman Zippel6d2f16a2006-06-23 02:04:59 -070096 /* assembly irq entry code relies on this... */
97 if (HARDIRQ_MASK != 0x00ff0000) {
98 extern void hardirq_mask_is_broken(void);
99 hardirq_mask_is_broken();
100 }
101
Roman Zippel68387c42006-06-25 05:47:01 -0700102 for (i = IRQ_AUTO_1; i <= IRQ_AUTO_7; i++)
Geert Uytterhoeven40a72c82011-05-27 22:33:41 +0200103 irq_set_chip(i, &auto_irq_chip);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104
Roman Zippel68387c42006-06-25 05:47:01 -0700105 mach_init_IRQ();
106}
107
108/**
109 * m68k_setup_auto_interrupt
110 * @handler: called from auto vector interrupts
111 *
112 * setup the handler to be called from auto vector interrupts instead of the
Geert Uytterhoeven1425df82011-07-01 20:39:19 +0200113 * standard do_IRQ(), it will be called with irq numbers in the range
Roman Zippel68387c42006-06-25 05:47:01 -0700114 * from IRQ_AUTO_1 - IRQ_AUTO_7.
115 */
116void __init m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_regs *))
117{
118 if (handler)
119 *auto_irqhandler_fixup = (u32)handler;
120 flush_icache();
121}
122
123/**
124 * m68k_setup_user_interrupt
125 * @vec: first user vector interrupt to handle
126 * @cnt: number of active user vector interrupts
127 * @handler: called from user vector interrupts
128 *
129 * setup user vector interrupts, this includes activating the specified range
130 * of interrupts, only then these interrupts can be requested (note: this is
131 * different from auto vector interrupts). An optional handler can be installed
Geert Uytterhoeven1425df82011-07-01 20:39:19 +0200132 * to be called instead of the default do_IRQ(), it will be called
Roman Zippel68387c42006-06-25 05:47:01 -0700133 * with irq numbers starting from IRQ_USER.
134 */
135void __init m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt,
136 void (*handler)(unsigned int, struct pt_regs *))
137{
138 int i;
139
Geert Uytterhoeven27123cb2008-11-14 08:10:19 +0100140 BUG_ON(IRQ_USER + cnt > NR_IRQS);
Roman Zippel68387c42006-06-25 05:47:01 -0700141 m68k_first_user_vec = vec;
142 for (i = 0; i < cnt; i++)
Geert Uytterhoeven40a72c82011-05-27 22:33:41 +0200143 irq_set_chip(IRQ_USER + i, &user_irq_chip);
Roman Zippel68387c42006-06-25 05:47:01 -0700144 *user_irqvec_fixup = vec - IRQ_USER;
145 if (handler)
146 *user_irqhandler_fixup = (u32)handler;
147 flush_icache();
148}
149
150/**
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200151 * m68k_setup_irq_chip
Roman Zippel68387c42006-06-25 05:47:01 -0700152 * @contr: irq controller which controls specified irq
153 * @irq: first irq to be managed by the controller
154 *
155 * Change the controller for the specified range of irq, which will be used to
156 * manage these irq. auto/user irq already have a default controller, which can
157 * be changed as well, but the controller probably should use m68k_irq_startup/
158 * m68k_irq_shutdown.
159 */
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200160void m68k_setup_irq_chip(struct irq_chip *contr, unsigned int irq,
Roman Zippel68387c42006-06-25 05:47:01 -0700161 unsigned int cnt)
162{
163 int i;
164
165 for (i = 0; i < cnt; i++)
Geert Uytterhoeven40a72c82011-05-27 22:33:41 +0200166 irq_set_chip(irq + i, contr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167}
168
Geert Uytterhoeven6549d532011-04-17 21:59:23 +0200169struct irq_data *new_irq_node(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170{
Geert Uytterhoeven6549d532011-04-17 21:59:23 +0200171 struct irq_data *node;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172 short i;
173
Roman Zippelb5dc7842006-06-25 05:47:00 -0700174 for (node = nodes, i = NUM_IRQ_NODES-1; i >= 0; node++, i--) {
175 if (!node->handler) {
176 memset(node, 0, sizeof(*node));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177 return node;
Roman Zippelb5dc7842006-06-25 05:47:00 -0700178 }
179 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180
181 printk ("new_irq_node: out of nodes\n");
182 return NULL;
183}
184
Geert Uytterhoeven13d6da32011-04-19 20:10:53 +0200185static int m68k_setup_irq(unsigned int irq, struct irq_data *node)
Roman Zippelb5dc7842006-06-25 05:47:00 -0700186{
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200187 struct irq_chip *contr;
Geert Uytterhoeven6549d532011-04-17 21:59:23 +0200188 struct irq_data **prev;
Roman Zippelb5dc7842006-06-25 05:47:00 -0700189 unsigned long flags;
190
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200191 if (irq >= NR_IRQS || !(contr = irq_chip[irq])) {
Roman Zippelb5dc7842006-06-25 05:47:00 -0700192 printk("%s: Incorrect IRQ %d from %s\n",
Harvey Harrisonf85e7cd2008-04-28 02:13:49 -0700193 __func__, irq, node->devname);
Roman Zippelb5dc7842006-06-25 05:47:00 -0700194 return -ENXIO;
195 }
196
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200197 local_irq_save(flags);
Roman Zippelb5dc7842006-06-25 05:47:00 -0700198
199 prev = irq_list + irq;
200 if (*prev) {
201 /* Can't share interrupts unless both agree to */
Thomas Gleixnerb0b9fdc2006-07-01 19:29:19 -0700202 if (!((*prev)->flags & node->flags & IRQF_SHARED)) {
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200203 local_irq_restore(flags);
Roman Zippelb5dc7842006-06-25 05:47:00 -0700204 return -EBUSY;
205 }
206 while (*prev)
207 prev = &(*prev)->next;
208 }
209
210 if (!irq_list[irq]) {
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200211 if (contr->irq_startup)
Geert Uytterhoevene8abf5e2011-04-17 22:53:04 +0200212 contr->irq_startup(node);
Roman Zippelb5dc7842006-06-25 05:47:00 -0700213 else
Geert Uytterhoevene8abf5e2011-04-17 22:53:04 +0200214 contr->irq_enable(node);
Roman Zippelb5dc7842006-06-25 05:47:00 -0700215 }
216 node->next = NULL;
217 *prev = node;
218
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200219 local_irq_restore(flags);
Roman Zippelb5dc7842006-06-25 05:47:00 -0700220
221 return 0;
222}
223
Roman Zippel68387c42006-06-25 05:47:01 -0700224int request_irq(unsigned int irq,
David Howells40220c12006-10-09 12:19:47 +0100225 irq_handler_t handler,
Roman Zippel68387c42006-06-25 05:47:01 -0700226 unsigned long flags, const char *devname, void *dev_id)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700227{
Geert Uytterhoeven6549d532011-04-17 21:59:23 +0200228 struct irq_data *node;
Roman Zippelb5dc7842006-06-25 05:47:00 -0700229 int res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230
Roman Zippelb5dc7842006-06-25 05:47:00 -0700231 node = new_irq_node();
232 if (!node)
233 return -ENOMEM;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234
Geert Uytterhoeven6549d532011-04-17 21:59:23 +0200235 node->irq = irq;
Roman Zippelb5dc7842006-06-25 05:47:00 -0700236 node->handler = handler;
237 node->flags = flags;
238 node->dev_id = dev_id;
239 node->devname = devname;
240
Geert Uytterhoeven13d6da32011-04-19 20:10:53 +0200241 res = m68k_setup_irq(irq, node);
Roman Zippelb5dc7842006-06-25 05:47:00 -0700242 if (res)
243 node->handler = NULL;
244
245 return res;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246}
247
Roman Zippel68387c42006-06-25 05:47:01 -0700248EXPORT_SYMBOL(request_irq);
249
250void free_irq(unsigned int irq, void *dev_id)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251{
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200252 struct irq_chip *contr;
Geert Uytterhoeven6549d532011-04-17 21:59:23 +0200253 struct irq_data **p, *node;
Roman Zippelb5dc7842006-06-25 05:47:00 -0700254 unsigned long flags;
255
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200256 if (irq >= NR_IRQS || !(contr = irq_chip[irq])) {
Harvey Harrisonf85e7cd2008-04-28 02:13:49 -0700257 printk("%s: Incorrect IRQ %d\n", __func__, irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700258 return;
259 }
260
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200261 local_irq_save(flags);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262
Roman Zippelb5dc7842006-06-25 05:47:00 -0700263 p = irq_list + irq;
264 while ((node = *p)) {
265 if (node->dev_id == dev_id)
266 break;
267 p = &node->next;
268 }
269
270 if (node) {
271 *p = node->next;
272 node->handler = NULL;
273 } else
274 printk("%s: Removing probably wrong IRQ %d\n",
Harvey Harrisonf85e7cd2008-04-28 02:13:49 -0700275 __func__, irq);
Roman Zippelb5dc7842006-06-25 05:47:00 -0700276
Roman Zippel68387c42006-06-25 05:47:01 -0700277 if (!irq_list[irq]) {
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200278 if (contr->irq_shutdown)
Geert Uytterhoevene8abf5e2011-04-17 22:53:04 +0200279 contr->irq_shutdown(node);
Roman Zippel68387c42006-06-25 05:47:01 -0700280 else
Geert Uytterhoevene8abf5e2011-04-17 22:53:04 +0200281 contr->irq_disable(node);
Roman Zippel68387c42006-06-25 05:47:01 -0700282 }
Roman Zippelb5dc7842006-06-25 05:47:00 -0700283
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200284 local_irq_restore(flags);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700285}
286
Roman Zippel68387c42006-06-25 05:47:01 -0700287EXPORT_SYMBOL(free_irq);
288
289void enable_irq(unsigned int irq)
290{
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200291 struct irq_chip *contr;
Roman Zippel68387c42006-06-25 05:47:01 -0700292 unsigned long flags;
293
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200294 if (irq >= NR_IRQS || !(contr = irq_chip[irq])) {
Roman Zippel68387c42006-06-25 05:47:01 -0700295 printk("%s: Incorrect IRQ %d\n",
Harvey Harrisonf85e7cd2008-04-28 02:13:49 -0700296 __func__, irq);
Roman Zippel68387c42006-06-25 05:47:01 -0700297 return;
298 }
299
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200300 local_irq_save(flags);
Roman Zippel68387c42006-06-25 05:47:01 -0700301 if (irq_depth[irq]) {
302 if (!--irq_depth[irq]) {
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200303 if (contr->irq_enable)
Geert Uytterhoevene8abf5e2011-04-17 22:53:04 +0200304 contr->irq_enable(irq_list[irq]);
Roman Zippel68387c42006-06-25 05:47:01 -0700305 }
306 } else
307 WARN_ON(1);
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200308 local_irq_restore(flags);
Roman Zippel68387c42006-06-25 05:47:01 -0700309}
310
311EXPORT_SYMBOL(enable_irq);
312
313void disable_irq(unsigned int irq)
314{
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200315 struct irq_chip *contr;
Roman Zippel68387c42006-06-25 05:47:01 -0700316 unsigned long flags;
317
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200318 if (irq >= NR_IRQS || !(contr = irq_chip[irq])) {
Roman Zippel68387c42006-06-25 05:47:01 -0700319 printk("%s: Incorrect IRQ %d\n",
Harvey Harrisonf85e7cd2008-04-28 02:13:49 -0700320 __func__, irq);
Roman Zippel68387c42006-06-25 05:47:01 -0700321 return;
322 }
323
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200324 local_irq_save(flags);
Roman Zippel68387c42006-06-25 05:47:01 -0700325 if (!irq_depth[irq]++) {
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200326 if (contr->irq_disable)
Geert Uytterhoevene8abf5e2011-04-17 22:53:04 +0200327 contr->irq_disable(irq_list[irq]);
Roman Zippel68387c42006-06-25 05:47:01 -0700328 }
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200329 local_irq_restore(flags);
Roman Zippel68387c42006-06-25 05:47:01 -0700330}
331
332EXPORT_SYMBOL(disable_irq);
333
Al Viroe9ed7e72007-07-21 23:29:12 +0100334void disable_irq_nosync(unsigned int irq) __attribute__((alias("disable_irq")));
335
336EXPORT_SYMBOL(disable_irq_nosync);
337
Geert Uytterhoevene8abf5e2011-04-17 22:53:04 +0200338unsigned int m68k_irq_startup_irq(unsigned int irq)
Roman Zippelb5dc7842006-06-25 05:47:00 -0700339{
340 if (irq <= IRQ_AUTO_7)
341 vectors[VEC_SPUR + irq] = auto_inthandler;
Roman Zippel68387c42006-06-25 05:47:01 -0700342 else
343 vectors[m68k_first_user_vec + irq - IRQ_USER] = user_inthandler;
Roman Zippelb5dc7842006-06-25 05:47:00 -0700344 return 0;
345}
346
Geert Uytterhoevene8abf5e2011-04-17 22:53:04 +0200347unsigned int m68k_irq_startup(struct irq_data *data)
Roman Zippelb5dc7842006-06-25 05:47:00 -0700348{
Geert Uytterhoevene8abf5e2011-04-17 22:53:04 +0200349 return m68k_irq_startup_irq(data->irq);
350}
351
352void m68k_irq_shutdown(struct irq_data *data)
353{
354 unsigned int irq = data->irq;
355
Roman Zippelb5dc7842006-06-25 05:47:00 -0700356 if (irq <= IRQ_AUTO_7)
357 vectors[VEC_SPUR + irq] = bad_inthandler;
Roman Zippel68387c42006-06-25 05:47:01 -0700358 else
359 vectors[m68k_first_user_vec + irq - IRQ_USER] = bad_inthandler;
Roman Zippelb5dc7842006-06-25 05:47:00 -0700360}
361
362
Linus Torvalds1da177e2005-04-16 15:20:36 -0700363/*
364 * Do we need these probe functions on the m68k?
365 *
366 * ... may be useful with ISA devices
367 */
368unsigned long probe_irq_on (void)
369{
370#ifdef CONFIG_Q40
371 if (MACH_IS_Q40)
372 return q40_probe_irq_on();
373#endif
374 return 0;
375}
376
377EXPORT_SYMBOL(probe_irq_on);
378
379int probe_irq_off (unsigned long irqs)
380{
381#ifdef CONFIG_Q40
382 if (MACH_IS_Q40)
383 return q40_probe_irq_off(irqs);
384#endif
385 return 0;
386}
387
388EXPORT_SYMBOL(probe_irq_off);
389
Roman Zippel68387c42006-06-25 05:47:01 -0700390unsigned int irq_canonicalize(unsigned int irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391{
Roman Zippel68387c42006-06-25 05:47:01 -0700392#ifdef CONFIG_Q40
393 if (MACH_IS_Q40 && irq == 11)
394 irq = 10;
395#endif
396 return irq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397}
398
Roman Zippel68387c42006-06-25 05:47:01 -0700399EXPORT_SYMBOL(irq_canonicalize);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400
Geert Uytterhoeven1425df82011-07-01 20:39:19 +0200401void generic_handle_irq(unsigned int irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700402{
Geert Uytterhoeven6549d532011-04-17 21:59:23 +0200403 struct irq_data *node;
Roman Zippel92445eaa2006-06-25 05:46:58 -0700404 kstat_cpu(0).irqs[irq]++;
Roman Zippelb5dc7842006-06-25 05:47:00 -0700405 node = irq_list[irq];
406 do {
Al Viro2850bc22006-10-07 14:16:45 +0100407 node->handler(irq, node->dev_id);
Roman Zippelb5dc7842006-06-25 05:47:00 -0700408 node = node->next;
409 } while (node);
Roman Zippel92445eaa2006-06-25 05:46:58 -0700410}
411
Geert Uytterhoeven1425df82011-07-01 20:39:19 +0200412asmlinkage void do_IRQ(int irq, struct pt_regs *regs)
Al Viro2850bc22006-10-07 14:16:45 +0100413{
414 struct pt_regs *old_regs;
415 old_regs = set_irq_regs(regs);
Geert Uytterhoeven1425df82011-07-01 20:39:19 +0200416 generic_handle_irq(irq);
Al Viro2850bc22006-10-07 14:16:45 +0100417 set_irq_regs(old_regs);
418}
419
Roman Zippel92445eaa2006-06-25 05:46:58 -0700420asmlinkage void handle_badint(struct pt_regs *regs)
421{
422 kstat_cpu(0).irqs[0]++;
423 printk("unexpected interrupt from %u\n", regs->vector);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700424}
425
426int show_interrupts(struct seq_file *p, void *v)
427{
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200428 struct irq_chip *contr;
Geert Uytterhoeven6549d532011-04-17 21:59:23 +0200429 struct irq_data *node;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700430 int i = *(loff_t *) v;
431
432 /* autovector interrupts */
Roman Zippel68387c42006-06-25 05:47:01 -0700433 if (irq_list[i]) {
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +0200434 contr = irq_chip[i];
Roman Zippelb5dc7842006-06-25 05:47:00 -0700435 node = irq_list[i];
Roman Zippel68387c42006-06-25 05:47:01 -0700436 seq_printf(p, "%-8s %3u: %10u %s", contr->name, i, kstat_cpu(0).irqs[i], node->devname);
Roman Zippelb5dc7842006-06-25 05:47:00 -0700437 while ((node = node->next))
438 seq_printf(p, ", %s", node->devname);
439 seq_puts(p, "\n");
Roman Zippel68387c42006-06-25 05:47:01 -0700440 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700441 return 0;
442}
443
Geert Uytterhoevenda9870e2008-10-13 21:59:01 +0200444#ifdef CONFIG_PROC_FS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700445void init_irq_proc(void)
446{
447 /* Insert /proc/irq driver here */
448}
Geert Uytterhoevenda9870e2008-10-13 21:59:01 +0200449#endif