blob: f5e1cec7e35cb58d4aeaaf505424b8231bcaebd5 [file] [log] [blame]
Russell Kingbc282482009-05-17 18:58:34 +01001/*
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 Zyngier292b2932011-07-20 16:24:14 +010013#include <linux/interrupt.h>
14
Russell Kingbc282482009-05-17 18:58:34 +010015struct clock_event_device;
16
17/*
18 * Setup a per-cpu timer, whether it be a local timer or dummy broadcast
19 */
20void percpu_timer_setup(void);
21
Russell Kingbc282482009-05-17 18:58:34 +010022#ifdef CONFIG_LOCAL_TIMERS
Russell Kingf32f4ce2009-05-16 12:14:21 +010023
24#ifdef CONFIG_HAVE_ARM_TWD
25
26#include "smp_twd.h"
27
Marc Zyngier28af6902011-07-22 12:52:37 +010028#define local_timer_stop(c) twd_timer_stop((c))
Russell Kingf32f4ce2009-05-16 12:14:21 +010029
30#else
31
Russell Kingbc282482009-05-17 18:58:34 +010032/*
Marc Zyngier28af6902011-07-22 12:52:37 +010033 * Stop the local timer
Russell Kingbc282482009-05-17 18:58:34 +010034 */
Marc Zyngier28af6902011-07-22 12:52:37 +010035void local_timer_stop(struct clock_event_device *);
Russell Kingbc282482009-05-17 18:58:34 +010036
Russell Kingf32f4ce2009-05-16 12:14:21 +010037#endif
38
Russell Kingbc282482009-05-17 18:58:34 +010039/*
40 * Setup a local timer interrupt for a CPU.
41 */
Santosh Shilimkaraf90f102011-02-23 18:53:15 +010042int local_timer_setup(struct clock_event_device *);
Russell Kingbc282482009-05-17 18:58:34 +010043
Santosh Shilimkaraf90f102011-02-23 18:53:15 +010044#else
45
46static inline int local_timer_setup(struct clock_event_device *evt)
47{
48 return -ENXIO;
49}
Marc Zyngier28af6902011-07-22 12:52:37 +010050
51static inline void local_timer_stop(struct clock_event_device *evt)
52{
53}
Russell Kingbc282482009-05-17 18:58:34 +010054#endif
55
56#endif