2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Code to handle x86 style IRQs plus some generic interrupt stuff.
8 * Copyright (C) 1992 Linus Torvalds
9 * Copyright (C) 1994 - 2000 Ralf Baechle
11 #include <linux/config.h>
12 #include <linux/kernel.h>
13 #include <linux/delay.h>
14 #include <linux/init.h>
15 #include <linux/interrupt.h>
16 #include <linux/kernel_stat.h>
17 #include <linux/module.h>
18 #include <linux/proc_fs.h>
19 #include <linux/slab.h>
21 #include <linux/random.h>
22 #include <linux/sched.h>
23 #include <linux/seq_file.h>
24 #include <linux/kallsyms.h>
26 #include <asm/atomic.h>
27 #include <asm/system.h>
28 #include <asm/uaccess.h>
31 * 'what should we do if we get a hw irq event on an illegal vector'.
32 * each architecture has to answer this themselves.
34 void ack_bad_irq(unsigned int irq
)
36 printk("unexpected IRQ # %d\n", irq
);
39 atomic_t irq_err_count
;
41 #ifdef CONFIG_MIPS_MT_SMTC
43 * SMTC Kernel needs to manipulate low-level CPU interrupt mask
44 * in do_IRQ. These are passed in setup_irq_smtc() and stored
47 unsigned long irq_hwmask
[NR_IRQS
];
48 #endif /* CONFIG_MIPS_MT_SMTC */
53 * do_IRQ handles all normal device IRQ's (the special
54 * SMP cross-CPU interrupts have their own specific
57 asmlinkage
unsigned int do_IRQ(unsigned int irq
, struct pt_regs
*regs
)
70 * Generic, controller-independent functions:
73 int show_interrupts(struct seq_file
*p
, void *v
)
75 int i
= *(loff_t
*) v
, j
;
76 struct irqaction
* action
;
81 for_each_online_cpu(j
)
82 seq_printf(p
, "CPU%d ",j
);
87 spin_lock_irqsave(&irq_desc
[i
].lock
, flags
);
88 action
= irq_desc
[i
].action
;
91 seq_printf(p
, "%3d: ",i
);
93 seq_printf(p
, "%10u ", kstat_irqs(i
));
95 for_each_online_cpu(j
)
96 seq_printf(p
, "%10u ", kstat_cpu(j
).irqs
[i
]);
98 seq_printf(p
, " %14s", irq_desc
[i
].handler
->typename
);
99 seq_printf(p
, " %s", action
->name
);
101 for (action
=action
->next
; action
; action
= action
->next
)
102 seq_printf(p
, ", %s", action
->name
);
106 spin_unlock_irqrestore(&irq_desc
[i
].lock
, flags
);
107 } else if (i
== NR_IRQS
) {
109 seq_printf(p
, "ERR: %10u\n", atomic_read(&irq_err_count
));
114 asmlinkage
void spurious_interrupt(struct pt_regs
*regs
)
116 atomic_inc(&irq_err_count
);
120 extern void breakpoint(void);
121 extern void set_debug_traps(void);
123 static int kgdb_flag
= 1;
124 static int __init
nokgdb(char *str
)
129 __setup("nokgdb", nokgdb
);
132 void __init
init_IRQ(void)
136 for (i
= 0; i
< NR_IRQS
; i
++) {
137 irq_desc
[i
].status
= IRQ_DISABLED
;
138 irq_desc
[i
].action
= NULL
;
139 irq_desc
[i
].depth
= 1;
140 irq_desc
[i
].handler
= &no_irq_type
;
141 spin_lock_init(&irq_desc
[i
].lock
);
142 #ifdef CONFIG_MIPS_MT_SMTC
144 #endif /* CONFIG_MIPS_MT_SMTC */
151 printk("Wait for gdb client connection ...\n");