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> |
Marc Zyngier | 292b293 | 2011-07-20 16:24:14 +0100 | [diff] [blame] | 14 | #include <linux/interrupt.h> |
Shawn Guo | bb1ac3e | 2011-10-06 14:57:24 +0100 | [diff] [blame] | 15 | |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 16 | struct clock_event_device; |
| 17 | |
| 18 | /* |
| 19 | * Setup a per-cpu timer, whether it be a local timer or dummy broadcast |
| 20 | */ |
| 21 | void percpu_timer_setup(void); |
| 22 | |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 23 | #ifdef CONFIG_LOCAL_TIMERS |
Russell King | f32f4ce | 2009-05-16 12:14:21 +0100 | [diff] [blame] | 24 | |
| 25 | #ifdef CONFIG_HAVE_ARM_TWD |
| 26 | |
| 27 | #include "smp_twd.h" |
| 28 | |
Marc Zyngier | 28af690 | 2011-07-22 12:52:37 +0100 | [diff] [blame] | 29 | #define local_timer_stop(c) twd_timer_stop((c)) |
Russell King | f32f4ce | 2009-05-16 12:14:21 +0100 | [diff] [blame] | 30 | |
| 31 | #else |
| 32 | |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 33 | /* |
Marc Zyngier | 28af690 | 2011-07-22 12:52:37 +0100 | [diff] [blame] | 34 | * Stop the local timer |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 35 | */ |
Marc Zyngier | 28af690 | 2011-07-22 12:52:37 +0100 | [diff] [blame] | 36 | void local_timer_stop(struct clock_event_device *); |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 37 | |
Russell King | f32f4ce | 2009-05-16 12:14:21 +0100 | [diff] [blame] | 38 | #endif |
| 39 | |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 40 | /* |
| 41 | * Setup a local timer interrupt for a CPU. |
| 42 | */ |
Santosh Shilimkar | af90f10 | 2011-02-23 18:53:15 +0100 | [diff] [blame] | 43 | int local_timer_setup(struct clock_event_device *); |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 44 | |
Santosh Shilimkar | af90f10 | 2011-02-23 18:53:15 +0100 | [diff] [blame] | 45 | #else |
| 46 | |
| 47 | static inline int local_timer_setup(struct clock_event_device *evt) |
| 48 | { |
| 49 | return -ENXIO; |
| 50 | } |
Marc Zyngier | 28af690 | 2011-07-22 12:52:37 +0100 | [diff] [blame] | 51 | |
| 52 | static inline void local_timer_stop(struct clock_event_device *evt) |
| 53 | { |
| 54 | } |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 55 | #endif |
| 56 | |
| 57 | #endif |