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 | |
| 22 | /* |
Marc Zyngier | 292b293 | 2011-07-20 16:24:14 +0100 | [diff] [blame^] | 23 | * Per-cpu timer IRQ handler |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 24 | */ |
Marc Zyngier | 292b293 | 2011-07-20 16:24:14 +0100 | [diff] [blame^] | 25 | irqreturn_t percpu_timer_handler(int irq, void *dev_id); |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 26 | |
| 27 | #ifdef CONFIG_LOCAL_TIMERS |
Russell King | f32f4ce | 2009-05-16 12:14:21 +0100 | [diff] [blame] | 28 | |
| 29 | #ifdef CONFIG_HAVE_ARM_TWD |
| 30 | |
| 31 | #include "smp_twd.h" |
| 32 | |
| 33 | #define local_timer_ack() twd_timer_ack() |
Russell King | f32f4ce | 2009-05-16 12:14:21 +0100 | [diff] [blame] | 34 | |
| 35 | #else |
| 36 | |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 37 | /* |
| 38 | * Platform provides this to acknowledge a local timer IRQ. |
| 39 | * Returns true if the local timer IRQ is to be processed. |
| 40 | */ |
| 41 | int local_timer_ack(void); |
| 42 | |
Russell King | f32f4ce | 2009-05-16 12:14:21 +0100 | [diff] [blame] | 43 | #endif |
| 44 | |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 45 | /* |
| 46 | * Setup a local timer interrupt for a CPU. |
| 47 | */ |
Santosh Shilimkar | af90f10 | 2011-02-23 18:53:15 +0100 | [diff] [blame] | 48 | int local_timer_setup(struct clock_event_device *); |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 49 | |
Santosh Shilimkar | af90f10 | 2011-02-23 18:53:15 +0100 | [diff] [blame] | 50 | #else |
| 51 | |
| 52 | static inline int local_timer_setup(struct clock_event_device *evt) |
| 53 | { |
| 54 | return -ENXIO; |
| 55 | } |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 56 | #endif |
| 57 | |
| 58 | #endif |