blob: c6a18424888ed4992ed05913e77e262eb3126723 [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
Shawn Guobb1ac3e2011-10-06 14:57:24 +010013#include <linux/errno.h>
Marc Zyngier292b2932011-07-20 16:24:14 +010014#include <linux/interrupt.h>
Shawn Guobb1ac3e2011-10-06 14:57:24 +010015
Russell Kingbc282482009-05-17 18:58:34 +010016struct clock_event_device;
17
18/*
19 * Setup a per-cpu timer, whether it be a local timer or dummy broadcast
20 */
21void percpu_timer_setup(void);
22
Russell Kingbc282482009-05-17 18:58:34 +010023#ifdef CONFIG_LOCAL_TIMERS
Russell Kingf32f4ce2009-05-16 12:14:21 +010024
25#ifdef CONFIG_HAVE_ARM_TWD
26
27#include "smp_twd.h"
28
Marc Zyngier28af6902011-07-22 12:52:37 +010029#define local_timer_stop(c) twd_timer_stop((c))
Russell Kingf32f4ce2009-05-16 12:14:21 +010030
31#else
32
Russell Kingbc282482009-05-17 18:58:34 +010033/*
Marc Zyngier28af6902011-07-22 12:52:37 +010034 * Stop the local timer
Russell Kingbc282482009-05-17 18:58:34 +010035 */
Marc Zyngier28af6902011-07-22 12:52:37 +010036void local_timer_stop(struct clock_event_device *);
Russell Kingbc282482009-05-17 18:58:34 +010037
Russell Kingf32f4ce2009-05-16 12:14:21 +010038#endif
39
Russell Kingbc282482009-05-17 18:58:34 +010040/*
41 * Setup a local timer interrupt for a CPU.
42 */
Santosh Shilimkaraf90f102011-02-23 18:53:15 +010043int local_timer_setup(struct clock_event_device *);
Russell Kingbc282482009-05-17 18:58:34 +010044
Santosh Shilimkaraf90f102011-02-23 18:53:15 +010045#else
46
47static inline int local_timer_setup(struct clock_event_device *evt)
48{
49 return -ENXIO;
50}
Marc Zyngier28af6902011-07-22 12:52:37 +010051
52static inline void local_timer_stop(struct clock_event_device *evt)
53{
54}
Russell Kingbc282482009-05-17 18:58:34 +010055#endif
56
57#endif