From patchwork Sun Oct 2 08:57:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 4463 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 4C98D23EF5 for ; Sun, 2 Oct 2011 08:54:21 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 357DEA18466 for ; Sun, 2 Oct 2011 08:54:21 +0000 (UTC) Received: by mail-bw0-f52.google.com with SMTP id 5so5310471bke.11 for ; Sun, 02 Oct 2011 01:54:21 -0700 (PDT) Received: by 10.223.57.17 with SMTP id a17mr7160492fah.65.1317545660979; Sun, 02 Oct 2011 01:54:20 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.3.234 with SMTP id f10cs18308laf; Sun, 2 Oct 2011 01:54:20 -0700 (PDT) Received: by 10.42.167.72 with SMTP id r8mr5709120icy.20.1317545659581; Sun, 02 Oct 2011 01:54:19 -0700 (PDT) Received: from mail-iy0-f178.google.com (mail-iy0-f178.google.com [209.85.210.178]) by mx.google.com with ESMTPS id t8si1731555icv.152.2011.10.02.01.54.18 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Oct 2011 01:54:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.210.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by iabz21 with SMTP id z21so5020893iab.37 for ; Sun, 02 Oct 2011 01:54:18 -0700 (PDT) Received: by 10.68.19.6 with SMTP id a6mr72141770pbe.46.1317545658676; Sun, 02 Oct 2011 01:54:18 -0700 (PDT) Received: from localhost.localdomain ([114.216.151.253]) by mx.google.com with ESMTPS id u1sm39795119pbr.9.2011.10.02.01.54.13 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Oct 2011 01:54:17 -0700 (PDT) From: Shawn Guo To: Russell King - ARM Linux Cc: Marc Zyngier , linux-arm-kernel@lists.infradead.org, patches@linaro.org Subject: [PATCH 1/2] ARM: smp: Add an IPI handler callable from C code Date: Sun, 2 Oct 2011 16:57:00 +0800 Message-Id: <1317545821-23194-2-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1317545821-23194-1-git-send-email-shawn.guo@linaro.org> References: <1317545821-23194-1-git-send-email-shawn.guo@linaro.org> From: Marc Zyngier In order to be able to handle IPI directly from C code instead of assembly code, introduce handle_IPI(), which is modeled after handle_IRQ(). Signed-off-by: Marc Zyngier --- arch/arm/include/asm/smp.h | 5 +++++ arch/arm/kernel/smp.c | 5 +++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h index 674ebcd..0a17b62 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h @@ -33,6 +33,11 @@ extern void show_ipi_list(struct seq_file *, int); asmlinkage void do_IPI(int ipinr, struct pt_regs *regs); /* + * Called from C code, this handles an IPI. + */ +void handle_IPI(int ipinr, struct pt_regs *regs); + +/* * Setup the set of possible CPUs (via set_cpu_possible) */ extern void smp_init_cpus(void); diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 3f12ce9..2e49f18 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -587,6 +587,11 @@ static void ipi_cpu_stop(unsigned int cpu) */ asmlinkage void __exception_irq_entry do_IPI(int ipinr, struct pt_regs *regs) { + handle_IPI(ipinr, regs); +} + +void handle_IPI(int ipinr, struct pt_regs *regs) +{ unsigned int cpu = smp_processor_id(); struct pt_regs *old_regs = set_irq_regs(regs);