Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/include/asm/localtimer.h |
| 3 | * |
| 4 | * Copyright (C) 2004-2005 ARM Ltd. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | */ |
| 10 | #ifndef __ASM_ARM_LOCALTIMER_H |
| 11 | #define __ASM_ARM_LOCALTIMER_H |
| 12 | |
Shawn Guo | bb1ac3e | 2011-10-06 14:57:24 +0100 | [diff] [blame^] | 13 | #include <linux/errno.h> |
| 14 | |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 15 | struct clock_event_device; |
| 16 | |
| 17 | /* |
| 18 | * Setup a per-cpu timer, whether it be a local timer or dummy broadcast |
| 19 | */ |
| 20 | void percpu_timer_setup(void); |
| 21 | |
| 22 | /* |
| 23 | * Called from assembly, this is the local timer IRQ handler |
| 24 | */ |
| 25 | asmlinkage void do_local_timer(struct pt_regs *); |
| 26 | |
| 27 | |
| 28 | #ifdef CONFIG_LOCAL_TIMERS |
Russell King | f32f4ce | 2009-05-16 12:14:21 +0100 | [diff] [blame] | 29 | |
| 30 | #ifdef CONFIG_HAVE_ARM_TWD |
| 31 | |
| 32 | #include "smp_twd.h" |
| 33 | |
| 34 | #define local_timer_ack() twd_timer_ack() |
Russell King | f32f4ce | 2009-05-16 12:14:21 +0100 | [diff] [blame] | 35 | |
| 36 | #else |
| 37 | |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 38 | /* |
| 39 | * Platform provides this to acknowledge a local timer IRQ. |
| 40 | * Returns true if the local timer IRQ is to be processed. |
| 41 | */ |
| 42 | int local_timer_ack(void); |
| 43 | |
Russell King | f32f4ce | 2009-05-16 12:14:21 +0100 | [diff] [blame] | 44 | #endif |
| 45 | |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 46 | /* |
| 47 | * Setup a local timer interrupt for a CPU. |
| 48 | */ |
Santosh Shilimkar | af90f10 | 2011-02-23 18:53:15 +0100 | [diff] [blame] | 49 | int local_timer_setup(struct clock_event_device *); |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 50 | |
Santosh Shilimkar | af90f10 | 2011-02-23 18:53:15 +0100 | [diff] [blame] | 51 | #else |
| 52 | |
| 53 | static inline int local_timer_setup(struct clock_event_device *evt) |
| 54 | { |
| 55 | return -ENXIO; |
| 56 | } |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 57 | #endif |
| 58 | |
| 59 | #endif |