From patchwork Sun Oct 2 08:46:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 4461 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 2FAC223EF9 for ; Sun, 2 Oct 2011 08:43:32 +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 1936EA181B8 for ; Sun, 2 Oct 2011 08:43:32 +0000 (UTC) Received: by mail-bw0-f52.google.com with SMTP id 5so5301748bke.11 for ; Sun, 02 Oct 2011 01:43:32 -0700 (PDT) Received: by 10.223.5.76 with SMTP id 12mr21473691fau.103.1317545011889; Sun, 02 Oct 2011 01:43:31 -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 f10cs18155laf; Sun, 2 Oct 2011 01:43:31 -0700 (PDT) Received: by 10.68.19.40 with SMTP id b8mr53002235pbe.17.1317545010236; Sun, 02 Oct 2011 01:43:30 -0700 (PDT) Received: from mail-pz0-f42.google.com (mail-pz0-f42.google.com [209.85.210.42]) by mx.google.com with ESMTPS id y6si11875913pbi.59.2011.10.02.01.43.29 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Oct 2011 01:43:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.42 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.210.42; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.42 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by mail-pz0-f42.google.com with SMTP id 1so8738314pzk.1 for ; Sun, 02 Oct 2011 01:43:29 -0700 (PDT) Received: by 10.68.15.194 with SMTP id z2mr70860466pbc.47.1317545009389; Sun, 02 Oct 2011 01:43:29 -0700 (PDT) Received: from localhost.localdomain ([114.216.151.253]) by mx.google.com with ESMTPS id ji3sm39771071pbc.2.2011.10.02.01.43.23 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Oct 2011 01:43:28 -0700 (PDT) From: Shawn Guo To: Russell King - ARM Linux Cc: Marc Zyngier , patches@linaro.org Subject: [PATCH 1/2] ARM: smp: Add an IPI handler callable from C code Date: Sun, 2 Oct 2011 16:46:30 +0800 Message-Id: <1317545191-22976-2-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1317545191-22976-1-git-send-email-shawn.guo@linaro.org> References: <1317545191-22976-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);