1eedbdab9SMichal Simek /* 2eedbdab9SMichal Simek * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu> 3eedbdab9SMichal Simek * Copyright (C) 2007-2009 PetaLogix 4eedbdab9SMichal Simek * Copyright (C) 2006 Atmark Techno, Inc. 5eedbdab9SMichal Simek * 6eedbdab9SMichal Simek * This file is subject to the terms and conditions of the GNU General Public 7eedbdab9SMichal Simek * License. See the file "COPYING" in the main directory of this archive 8eedbdab9SMichal Simek * for more details. 9eedbdab9SMichal Simek */ 10eedbdab9SMichal Simek 11eedbdab9SMichal Simek #include <linux/init.h> 12e6d7961eSSteven J. Magnani #include <linux/ftrace.h> 13eedbdab9SMichal Simek #include <linux/kernel.h> 14eedbdab9SMichal Simek #include <linux/hardirq.h> 15eedbdab9SMichal Simek #include <linux/interrupt.h> 16eedbdab9SMichal Simek #include <linux/irqflags.h> 17eedbdab9SMichal Simek #include <linux/seq_file.h> 18eedbdab9SMichal Simek #include <linux/kernel_stat.h> 19eedbdab9SMichal Simek #include <linux/irq.h> 208a9e90a1SMichal Simek #include <linux/irqchip.h> 21e3873444SGrant Likely #include <linux/of_irq.h> 22eedbdab9SMichal Simek 23*4cea749dSMarc Zyngier static u32 concurrent_irq; 24*4cea749dSMarc Zyngier 25e6d7961eSSteven J. Magnani void __irq_entry do_IRQ(struct pt_regs *regs) 26eedbdab9SMichal Simek { 27*4cea749dSMarc Zyngier unsigned int irq; 28*4cea749dSMarc Zyngier struct pt_regs *old_regs = set_irq_regs(regs); 290d9ec762SMichal Simek trace_hardirqs_off(); 30*4cea749dSMarc Zyngier 31*4cea749dSMarc Zyngier irq_enter(); 32*4cea749dSMarc Zyngier irq = xintc_get_irq(); 33*4cea749dSMarc Zyngier next_irq: 34*4cea749dSMarc Zyngier BUG_ON(!irq); 35*4cea749dSMarc Zyngier generic_handle_irq(irq); 36*4cea749dSMarc Zyngier 37*4cea749dSMarc Zyngier irq = xintc_get_irq(); 38*4cea749dSMarc Zyngier if (irq != -1U) { 39*4cea749dSMarc Zyngier pr_debug("next irq: %d\n", irq); 40*4cea749dSMarc Zyngier ++concurrent_irq; 41*4cea749dSMarc Zyngier goto next_irq; 42*4cea749dSMarc Zyngier } 43*4cea749dSMarc Zyngier 44*4cea749dSMarc Zyngier irq_exit(); 45*4cea749dSMarc Zyngier set_irq_regs(old_regs); 460d9ec762SMichal Simek trace_hardirqs_on(); 47eedbdab9SMichal Simek } 488a9e90a1SMichal Simek 498a9e90a1SMichal Simek void __init init_IRQ(void) 508a9e90a1SMichal Simek { 518a9e90a1SMichal Simek /* process the entire interrupt tree in one go */ 528a9e90a1SMichal Simek irqchip_init(); 538a9e90a1SMichal Simek } 54