linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 03/17] ARM: GIC: Add global gic_handle_irq() function
Date: Fri,  4 Nov 2011 16:57:37 +0000	[thread overview]
Message-ID: <1320425871-30564-4-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1320425871-30564-1-git-send-email-marc.zyngier@arm.com>

Provide the GIC code with a low level handler that can be used
by platforms using CONFIG_MULTI_IRQ_HANDLER.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/common/gic.c               |   27 +++++++++++++++++++++++++++
 arch/arm/include/asm/hardware/gic.h |    1 +
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 1565fca..2d29d86 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -40,6 +40,7 @@
 #include <linux/slab.h>
 
 #include <asm/irq.h>
+#include <asm/exception.h>
 #include <asm/mach/irq.h>
 #include <asm/hardware/gic.h>
 
@@ -242,6 +243,32 @@ static int gic_set_wake(struct irq_data *d, unsigned int on)
 #define gic_set_wake	NULL
 #endif
 
+asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
+{
+	u32 irqstat, irqnr;
+	struct gic_chip_data *gic = &gic_data[0];
+	void __iomem *cpu_base = gic_data_cpu_base(gic);
+
+	do {
+		irqstat = readl_relaxed(cpu_base + GIC_CPU_INTACK);
+		irqnr = irqstat & ~0x1c00;
+
+		if (likely(irqnr > 15 && irqnr < 1021)) {
+			irqnr = irq_domain_to_irq(&gic->domain, irqnr);
+			handle_IRQ(irqnr, regs);
+			continue;
+		}
+		if (irqnr < 16) {
+			writel_relaxed(irqstat, cpu_base + GIC_CPU_EOI);
+#ifdef CONFIG_SMP
+			handle_IPI(irqnr, regs);
+#endif
+			continue;
+		}
+		break;
+	} while (1);
+}
+
 static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
 {
 	struct gic_chip_data *chip_data = irq_get_handler_data(irq);
diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
index 729e00b..a38eee2 100644
--- a/arch/arm/include/asm/hardware/gic.h
+++ b/arch/arm/include/asm/hardware/gic.h
@@ -42,6 +42,7 @@ extern struct irq_chip gic_arch_extn;
 void gic_init(unsigned int, int, void __iomem *, void __iomem *);
 int gic_of_init(struct device_node *node, struct device_node *parent);
 void gic_secondary_init_base(unsigned int, void __iomem *, void __iomem *);
+void gic_handle_irq(struct pt_regs *regs);
 void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
 void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
 
-- 
1.7.0.4

  parent reply	other threads:[~2011-11-04 16:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-04 16:57 [PATCH v3 00/17] Switch GIC users (and omap2plus) to CONFIG_MULTI_IRQ_HANDLER Marc Zyngier
2011-11-04 16:57 ` [PATCH v3 01/17] ARM: Make global handler and CONFIG_MULTI_IRQ_HANDLER mutually exclusive Marc Zyngier
2011-11-04 18:30   ` Nicolas Pitre
2011-11-04 20:37   ` Eric Miao
2011-11-07  9:45   ` Jamie Iles
2011-11-07 11:02     ` Linus Walleij
2011-11-07 11:12       ` Marc Zyngier
2011-11-07 11:17         ` Jamie Iles
2011-11-07 11:22           ` Marc Zyngier
2011-11-04 16:57 ` [PATCH v3 02/17] ARM: mxc: rename gic_handle_irq to avoid name clash Marc Zyngier
2011-11-04 21:09   ` Shawn Guo
2011-11-04 16:57 ` Marc Zyngier [this message]
2011-11-04 16:57 ` [PATCH v3 04/17] ARM: mxc: convert smp platforms to global gic_handle_irq() Marc Zyngier
2011-11-04 21:15   ` Shawn Guo
2011-11-07 14:01     ` Marc Zyngier
2011-11-04 16:57 ` [PATCH v3 05/17] ARM: highbank: convert to CONFIG_MULTI_IRQ_HANDLER Marc Zyngier
2011-11-04 18:30   ` Rob Herring
2011-11-04 16:57 ` [PATCH v3 06/17] ARM: RealView: " Marc Zyngier
2011-11-04 16:57 ` [PATCH v3 07/17] ARM: VExpress: " Marc Zyngier
2011-11-04 16:57 ` [PATCH v3 08/17] ARM: msm: convert SMP platforms " Marc Zyngier
2011-11-04 16:57 ` [PATCH v3 09/17] ARM: exynos4: convert " Marc Zyngier
2011-11-04 16:57 ` [PATCH v3 10/17] ARM: tegra2: " Marc Zyngier
2011-11-04 19:48   ` Olof Johansson
2011-11-04 16:57 ` [PATCH v3 11/17] ARM: ux500: " Marc Zyngier
2011-11-04 16:57 ` [PATCH v3 12/17] ARM: shmobile: convert smp platforms to gic_handle_irq() Marc Zyngier
2011-11-04 16:57 ` [PATCH v3 13/17] ARM: cns3xxx: convert to CONFIG_MULTI_IRQ_HANDLER Marc Zyngier
2011-11-04 16:57 ` [PATCH v3 14/17] ARM: zynq: " Marc Zyngier
2011-11-04 16:57 ` [PATCH v3 15/17] ARM: omap2/3: Add global omap2/3_intc_handle_irq() functions Marc Zyngier
2011-11-04 16:57 ` [PATCH v3 16/17] ARM: omap2plus: convert to CONFIG_MULTI_IRQ_HANDLER Marc Zyngier
2011-11-04 16:57 ` [PATCH v3 17/17] ARM: GIC: Make MULTI_IRQ_HANDLER mandatory Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1320425871-30564-4-git-send-email-marc.zyngier@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).