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