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 | |
| 13 | struct clock_event_device; |
| 14 | |
| 15 | /* |
| 16 | * Setup a per-cpu timer, whether it be a local timer or dummy broadcast |
| 17 | */ |
| 18 | void percpu_timer_setup(void); |
| 19 | |
| 20 | /* |
| 21 | * Called from assembly, this is the local timer IRQ handler |
| 22 | */ |
| 23 | asmlinkage void do_local_timer(struct pt_regs *); |
| 24 | |
| 25 | |
| 26 | #ifdef CONFIG_LOCAL_TIMERS |
Russell King | f32f4ce | 2009-05-16 12:14:21 +0100 | [diff] [blame] | 27 | |
| 28 | #ifdef CONFIG_HAVE_ARM_TWD |
| 29 | |
| 30 | #include "smp_twd.h" |
| 31 | |
| 32 | #define local_timer_ack() twd_timer_ack() |
| 33 | #define local_timer_stop() twd_timer_stop() |
| 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 | |
| 43 | /* |
| 44 | * Stop a local timer interrupt. |
| 45 | */ |
| 46 | void local_timer_stop(void); |
| 47 | |
Russell King | f32f4ce | 2009-05-16 12:14:21 +0100 | [diff] [blame] | 48 | #endif |
| 49 | |
Russell King | bc28248 | 2009-05-17 18:58:34 +0100 | [diff] [blame] | 50 | /* |
| 51 | * Setup a local timer interrupt for a CPU. |
| 52 | */ |
| 53 | void local_timer_setup(struct clock_event_device *); |
| 54 | |
| 55 | #else |
| 56 | |
| 57 | static inline void local_timer_stop(void) |
| 58 | { |
| 59 | } |
| 60 | |
| 61 | #endif |
| 62 | |
| 63 | #endif |