Shawn Guo | 1103643 | 2011-09-24 00:43:06 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Freescale Semiconductor, Inc. |
| 3 | * Copyright 2011 Linaro Ltd. |
| 4 | * |
| 5 | * The code contained herein is licensed under the GNU General Public |
| 6 | * License. You may obtain a copy of the GNU General Public License |
| 7 | * Version 2 or later at the following locations: |
| 8 | * |
| 9 | * http://www.opensource.org/licenses/gpl-license.html |
| 10 | * http://www.gnu.org/copyleft/gpl.html |
| 11 | */ |
| 12 | |
| 13 | #include <linux/io.h> |
| 14 | #include <asm/exception.h> |
| 15 | #include <asm/localtimer.h> |
| 16 | #include <asm/hardware/gic.h> |
| 17 | #ifdef CONFIG_SMP |
| 18 | #include <asm/smp.h> |
| 19 | #endif |
| 20 | |
| 21 | asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs) |
| 22 | { |
| 23 | u32 irqstat, irqnr; |
| 24 | |
| 25 | do { |
| 26 | irqstat = readl_relaxed(gic_cpu_base_addr + GIC_CPU_INTACK); |
| 27 | irqnr = irqstat & 0x3ff; |
| 28 | if (irqnr == 1023) |
| 29 | break; |
| 30 | |
Marc Zyngier | a918fee | 2011-11-02 17:30:49 +0000 | [diff] [blame] | 31 | if (irqnr > 15 && irqnr < 1021) |
Shawn Guo | 1103643 | 2011-09-24 00:43:06 +0800 | [diff] [blame] | 32 | handle_IRQ(irqnr, regs); |
| 33 | #ifdef CONFIG_SMP |
Marc Zyngier | a918fee | 2011-11-02 17:30:49 +0000 | [diff] [blame] | 34 | else { |
Shawn Guo | 1103643 | 2011-09-24 00:43:06 +0800 | [diff] [blame] | 35 | writel_relaxed(irqstat, gic_cpu_base_addr + |
| 36 | GIC_CPU_EOI); |
| 37 | handle_IPI(irqnr, regs); |
| 38 | } |
| 39 | #endif |
Shawn Guo | 1103643 | 2011-09-24 00:43:06 +0800 | [diff] [blame] | 40 | } while (1); |
| 41 | } |