2009-03-27 21:25:49 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
|
|
|
|
* Copyright (C) 2007-2009 PetaLogix
|
|
|
|
* Copyright (C) 2006 Atmark Techno, Inc.
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/init.h>
|
2010-04-13 05:01:36 +08:00
|
|
|
#include <linux/ftrace.h>
|
2009-03-27 21:25:49 +08:00
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/hardirq.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/irqflags.h>
|
|
|
|
#include <linux/seq_file.h>
|
|
|
|
#include <linux/kernel_stat.h>
|
|
|
|
#include <linux/irq.h>
|
2010-06-19 01:09:59 +08:00
|
|
|
#include <linux/of_irq.h>
|
2011-09-22 23:22:55 +08:00
|
|
|
#include <linux/export.h>
|
2009-03-27 21:25:49 +08:00
|
|
|
|
|
|
|
#include <asm/prom.h>
|
|
|
|
|
|
|
|
static u32 concurrent_irq;
|
|
|
|
|
2010-04-13 05:01:36 +08:00
|
|
|
void __irq_entry do_IRQ(struct pt_regs *regs)
|
2009-03-27 21:25:49 +08:00
|
|
|
{
|
|
|
|
unsigned int irq;
|
|
|
|
struct pt_regs *old_regs = set_irq_regs(regs);
|
2010-05-25 19:44:38 +08:00
|
|
|
trace_hardirqs_off();
|
2009-03-27 21:25:49 +08:00
|
|
|
|
|
|
|
irq_enter();
|
|
|
|
irq = get_irq(regs);
|
|
|
|
next_irq:
|
2011-12-09 17:45:20 +08:00
|
|
|
BUG_ON(!irq);
|
|
|
|
/* Substract 1 because of get_irq */
|
|
|
|
generic_handle_irq(irq + IRQ_OFFSET - NO_IRQ_OFFSET);
|
2009-03-27 21:25:49 +08:00
|
|
|
|
|
|
|
irq = get_irq(regs);
|
2011-12-09 17:45:20 +08:00
|
|
|
if (irq) {
|
2009-03-27 21:25:49 +08:00
|
|
|
pr_debug("next irq: %d\n", irq);
|
|
|
|
++concurrent_irq;
|
|
|
|
goto next_irq;
|
|
|
|
}
|
|
|
|
|
|
|
|
irq_exit();
|
|
|
|
set_irq_regs(old_regs);
|
2010-05-25 19:44:38 +08:00
|
|
|
trace_hardirqs_on();
|
2009-03-27 21:25:49 +08:00
|
|
|
}
|
|
|
|
|
2010-01-14 22:16:31 +08:00
|
|
|
/* MS: There is no any advance mapping mechanism. We are using simple 32bit
|
|
|
|
intc without any cascades or any connection that's why mapping is 1:1 */
|
2012-02-15 05:06:49 +08:00
|
|
|
unsigned int irq_create_mapping(struct irq_domain *host, irq_hw_number_t hwirq)
|
2010-01-14 22:16:31 +08:00
|
|
|
{
|
2011-12-09 17:45:20 +08:00
|
|
|
return hwirq + IRQ_OFFSET;
|
2010-01-14 22:16:31 +08:00
|
|
|
}
|
|
|
|
EXPORT_SYMBOL_GPL(irq_create_mapping);
|
|
|
|
|
|
|
|
unsigned int irq_create_of_mapping(struct device_node *controller,
|
2010-06-19 01:09:59 +08:00
|
|
|
const u32 *intspec, unsigned int intsize)
|
2010-01-14 22:16:31 +08:00
|
|
|
{
|
2011-12-09 17:45:20 +08:00
|
|
|
return intspec[0] + IRQ_OFFSET;
|
2010-01-14 22:16:31 +08:00
|
|
|
}
|
|
|
|
EXPORT_SYMBOL_GPL(irq_create_of_mapping);
|