From patchwork Sun Oct 2 08:57:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 4464 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 EC7BA23EF5 for ; Sun, 2 Oct 2011 08:54:29 +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 DB89CA18466 for ; Sun, 2 Oct 2011 08:54:29 +0000 (UTC) Received: by mail-bw0-f52.google.com with SMTP id 5so5310471bke.11 for ; Sun, 02 Oct 2011 01:54:29 -0700 (PDT) Received: by 10.223.94.134 with SMTP id z6mr3354059fam.8.1317545669661; Sun, 02 Oct 2011 01:54:29 -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 f10cs18312laf; Sun, 2 Oct 2011 01:54:29 -0700 (PDT) Received: by 10.68.38.8 with SMTP id c8mr44382720pbk.42.1317545667783; Sun, 02 Oct 2011 01:54:27 -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 p3si11885485pbd.95.2011.10.02.01.54.26 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Oct 2011 01:54:27 -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 1so8756275pzk.1 for ; Sun, 02 Oct 2011 01:54:26 -0700 (PDT) Received: by 10.68.20.41 with SMTP id k9mr35294125pbe.90.1317545666630; Sun, 02 Oct 2011 01:54:26 -0700 (PDT) Received: from localhost.localdomain ([114.216.151.253]) by mx.google.com with ESMTPS id u1sm39795119pbr.9.2011.10.02.01.54.19 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Oct 2011 01:54:26 -0700 (PDT) From: Shawn Guo To: Russell King - ARM Linux Cc: Marc Zyngier , linux-arm-kernel@lists.infradead.org, patches@linaro.org, Shawn Guo Subject: [PATCH 2/2] ARM: smp: Add a localtimer handler callable from C code Date: Sun, 2 Oct 2011 16:57:01 +0800 Message-Id: <1317545821-23194-3-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> In order to be able to handle localtimer directly from C code instead of assembly code, introduce handle_local_timer(), which is modeled after handle_IRQ(). Signed-off-by: Shawn Guo --- arch/arm/include/asm/localtimer.h | 4 ++++ arch/arm/kernel/smp.c | 5 +++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h index 080d74f..3306f28 100644 --- a/arch/arm/include/asm/localtimer.h +++ b/arch/arm/include/asm/localtimer.h @@ -22,6 +22,10 @@ void percpu_timer_setup(void); */ asmlinkage void do_local_timer(struct pt_regs *); +/* + * Called from C code + */ +void handle_local_timer(struct pt_regs *); #ifdef CONFIG_LOCAL_TIMERS diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 2e49f18..0949007 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -480,6 +480,11 @@ static void ipi_timer(void) #ifdef CONFIG_LOCAL_TIMERS asmlinkage void __exception_irq_entry do_local_timer(struct pt_regs *regs) { + handle_local_timer(regs); +} + +void handle_local_timer(struct pt_regs *regs) +{ struct pt_regs *old_regs = set_irq_regs(regs); int cpu = smp_processor_id();