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/kernel.h>
12 #include <linux/delay.h>
13 #include <linux/init.h>
14 #include <linux/interrupt.h>
15 #include <linux/kernel_stat.h>
16 #include <linux/module.h>
17 #include <linux/proc_fs.h>
18 #include <linux/slab.h>
20 #include <linux/random.h>
21 #include <linux/sched.h>
22 #include <linux/seq_file.h>
23 #include <linux/kallsyms.h>
25 #include <asm/atomic.h>
26 #include <asm/system.h>
27 #include <asm/uaccess.h>
30 * 'what should we do if we get a hw irq event on an illegal vector'.
31 * each architecture has to answer this themselves.
33 void ack_bad_irq(unsigned int irq
)
35 printk("unexpected IRQ # %d\n", irq
);
38 atomic_t irq_err_count
;
40 #ifdef CONFIG_MIPS_MT_SMTC
42 * SMTC Kernel needs to manipulate low-level CPU interrupt mask
43 * in do_IRQ. These are passed in setup_irq_smtc() and stored
46 unsigned long irq_hwmask
[NR_IRQS
];
47 #endif /* CONFIG_MIPS_MT_SMTC */
52 * do_IRQ handles all normal device IRQ's (the special
53 * SMP cross-CPU interrupts have their own specific
56 asmlinkage
unsigned int do_IRQ(unsigned int irq
, struct pt_regs
*regs
)
69 * Generic, controller-independent functions:
72 int show_interrupts(struct seq_file
*p
, void *v
)
74 int i
= *(loff_t
*) v
, j
;
75 struct irqaction
* action
;
80 for_each_online_cpu(j
)
81 seq_printf(p
, "CPU%d ",j
);
86 spin_lock_irqsave(&irq_desc
[i
].lock
, flags
);
87 action
= irq_desc
[i
].action
;
90 seq_printf(p
, "%3d: ",i
);
92 seq_printf(p
, "%10u ", kstat_irqs(i
));
94 for_each_online_cpu(j
)
95 seq_printf(p
, "%10u ", kstat_cpu(j
).irqs
[i
]);
97 seq_printf(p
, " %14s", irq_desc
[i
].chip
->typename
);
98 seq_printf(p
, " %s", action
->name
);
100 for (action
=action
->next
; action
; action
= action
->next
)
101 seq_printf(p
, ", %s", action
->name
);
105 spin_unlock_irqrestore(&irq_desc
[i
].lock
, flags
);
106 } else if (i
== NR_IRQS
) {
108 seq_printf(p
, "ERR: %10u\n", atomic_read(&irq_err_count
));
113 asmlinkage
void spurious_interrupt(struct pt_regs
*regs
)
115 atomic_inc(&irq_err_count
);
119 extern void breakpoint(void);
120 extern void set_debug_traps(void);
122 static int kgdb_flag
= 1;
123 static int __init
nokgdb(char *str
)
128 __setup("nokgdb", nokgdb
);
131 void __init
init_IRQ(void)
135 for (i
= 0; i
< NR_IRQS
; i
++) {
136 irq_desc
[i
].status
= IRQ_DISABLED
;
137 irq_desc
[i
].action
= NULL
;
138 irq_desc
[i
].depth
= 1;
139 irq_desc
[i
].chip
= &no_irq_chip
;
140 spin_lock_init(&irq_desc
[i
].lock
);
141 #ifdef CONFIG_MIPS_MT_SMTC
143 #endif /* CONFIG_MIPS_MT_SMTC */
150 printk("Wait for gdb client connection ...\n");