blob: 7e1b2c5f7d17291f90bb10c3795dfb735c8ce9d1 [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 Zyngierabde7102012-01-10 19:07:28 +000029#endif
Russell Kingf32f4ce2009-05-16 12:14:21 +010030
Russell Kingbc282482009-05-17 18:58:34 +010031/*
Marc Zyngier28af6902011-07-22 12:52:37 +010032 * Stop the local timer
Russell Kingbc282482009-05-17 18:58:34 +010033 */
Marc Zyngier28af6902011-07-22 12:52:37 +010034void local_timer_stop(struct clock_event_device *);
Russell Kingbc282482009-05-17 18:58:34 +010035
Russell Kingbc282482009-05-17 18:58:34 +010036/*
37 * Setup a local timer interrupt for a CPU.
38 */
Santosh Shilimkaraf90f102011-02-23 18:53:15 +010039int local_timer_setup(struct clock_event_device *);
Russell Kingbc282482009-05-17 18:58:34 +010040
Santosh Shilimkaraf90f102011-02-23 18:53:15 +010041#else
42
43static inline int local_timer_setup(struct clock_event_device *evt)
44{
45 return -ENXIO;
46}
Marc Zyngier28af6902011-07-22 12:52:37 +010047
48static inline void local_timer_stop(struct clock_event_device *evt)
49{
50}
Russell Kingbc282482009-05-17 18:58:34 +010051#endif
52
53#endif