blob: ace700afbfdf01350065662020c7a94622717781 [file] [log] [blame]
Michal Simekeedbdab2009-03-27 14:25:49 +01001/*
2 * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2007-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
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/init.h>
Steven J. Magnanie6d79612010-04-12 16:01:36 -050012#include <linux/ftrace.h>
Michal Simekeedbdab2009-03-27 14:25:49 +010013#include <linux/kernel.h>
14#include <linux/hardirq.h>
15#include <linux/interrupt.h>
16#include <linux/irqflags.h>
17#include <linux/seq_file.h>
18#include <linux/kernel_stat.h>
19#include <linux/irq.h>
Grant Likelye3873442010-06-18 11:09:59 -060020#include <linux/of_irq.h>
Paul Gortmaker66421a62011-09-22 11:22:55 -040021#include <linux/export.h>
Michal Simekeedbdab2009-03-27 14:25:49 +010022
23#include <asm/prom.h>
24
Michal Simekeedbdab2009-03-27 14:25:49 +010025static u32 concurrent_irq;
26
Steven J. Magnanie6d79612010-04-12 16:01:36 -050027void __irq_entry do_IRQ(struct pt_regs *regs)
Michal Simekeedbdab2009-03-27 14:25:49 +010028{
29 unsigned int irq;
30 struct pt_regs *old_regs = set_irq_regs(regs);
Michal Simek0d9ec762010-05-25 13:44:38 +020031 trace_hardirqs_off();
Michal Simekeedbdab2009-03-27 14:25:49 +010032
33 irq_enter();
Grant Likely2462bac2012-01-26 14:10:13 -070034 irq = get_irq();
Michal Simekeedbdab2009-03-27 14:25:49 +010035next_irq:
Michal Simek6c7a2672011-12-09 10:45:20 +010036 BUG_ON(!irq);
Grant Likely2462bac2012-01-26 14:10:13 -070037 generic_handle_irq(irq);
Michal Simekeedbdab2009-03-27 14:25:49 +010038
Grant Likely2462bac2012-01-26 14:10:13 -070039 irq = get_irq();
40 if (irq != -1U) {
Michal Simekeedbdab2009-03-27 14:25:49 +010041 pr_debug("next irq: %d\n", irq);
42 ++concurrent_irq;
43 goto next_irq;
44 }
45
46 irq_exit();
47 set_irq_regs(old_regs);
Michal Simek0d9ec762010-05-25 13:44:38 +020048 trace_hardirqs_on();
Michal Simekeedbdab2009-03-27 14:25:49 +010049}