blob: 5c8acb4c4040c3493d3b6623c50fbaac0928c8d5 [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
22/*
Marc Zyngier292b2932011-07-20 16:24:14 +010023 * Per-cpu timer IRQ handler
Russell Kingbc282482009-05-17 18:58:34 +010024 */
Marc Zyngier292b2932011-07-20 16:24:14 +010025irqreturn_t percpu_timer_handler(int irq, void *dev_id);
Russell Kingbc282482009-05-17 18:58:34 +010026
27#ifdef CONFIG_LOCAL_TIMERS
Russell Kingf32f4ce2009-05-16 12:14:21 +010028
29#ifdef CONFIG_HAVE_ARM_TWD
30
31#include "smp_twd.h"
32
33#define local_timer_ack() twd_timer_ack()
Russell Kingf32f4ce2009-05-16 12:14:21 +010034
35#else
36
Russell Kingbc282482009-05-17 18:58:34 +010037/*
38 * Platform provides this to acknowledge a local timer IRQ.
39 * Returns true if the local timer IRQ is to be processed.
40 */
41int local_timer_ack(void);
42
Russell Kingf32f4ce2009-05-16 12:14:21 +010043#endif
44
Russell Kingbc282482009-05-17 18:58:34 +010045/*
46 * Setup a local timer interrupt for a CPU.
47 */
Santosh Shilimkaraf90f102011-02-23 18:53:15 +010048int local_timer_setup(struct clock_event_device *);
Russell Kingbc282482009-05-17 18:58:34 +010049
Santosh Shilimkaraf90f102011-02-23 18:53:15 +010050#else
51
52static inline int local_timer_setup(struct clock_event_device *evt)
53{
54 return -ENXIO;
55}
Russell Kingbc282482009-05-17 18:58:34 +010056#endif
57
58#endif