blob: 710537c13a2f62539d6637bbb289c6bb2c99982e [file] [log] [blame]
From 3a88e40dec05b0d5d376ba18a7f6833b3f6d7be5 Mon Sep 17 00:00:00 2001
From: Shawn Guo <shawn.guo@linaro.org>
Date: Thu, 6 Oct 2011 15:19:14 +0100
Subject: ARM: 7124/1: smp: Add a localtimer handler callable from C code
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 <shawn.guo@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
(cherry picked from commit 0af8aa0069e43f90d59666510342c05e97d8c4b8)
Signed-off-by: Simon Horman <horms@verge.net.au>
---
arch/arm/include/asm/localtimer.h | 4 ++++
arch/arm/kernel/smp.c | 5 +++++
2 files changed, 9 insertions(+)
--- 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
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -477,6 +477,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();