From patchwork Sun Oct 2 08:46:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 4462 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 7DA2023EF9 for ; Sun, 2 Oct 2011 08:43:36 +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 6D431A181B8 for ; Sun, 2 Oct 2011 08:43:36 +0000 (UTC) Received: by mail-bw0-f52.google.com with SMTP id 5so5301748bke.11 for ; Sun, 02 Oct 2011 01:43:36 -0700 (PDT) Received: by 10.223.94.134 with SMTP id z6mr3340009fam.8.1317545016173; Sun, 02 Oct 2011 01:43:36 -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 f10cs18157laf; Sun, 2 Oct 2011 01:43:36 -0700 (PDT) Received: by 10.68.15.70 with SMTP id v6mr53391699pbc.85.1317545015171; Sun, 02 Oct 2011 01:43:35 -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.34 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Oct 2011 01:43:35 -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:34 -0700 (PDT) Received: by 10.68.38.169 with SMTP id h9mr65350368pbk.113.1317545014023; Sun, 02 Oct 2011 01:43:34 -0700 (PDT) Received: from localhost.localdomain ([114.216.151.253]) by mx.google.com with ESMTPS id ji3sm39771071pbc.2.2011.10.02.01.43.29 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Oct 2011 01:43:33 -0700 (PDT) From: Shawn Guo To: Russell King - ARM Linux Cc: Marc Zyngier , 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:46:31 +0800 Message-Id: <1317545191-22976-3-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> 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();