aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/timer.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-11-30 23:23:47 -0500
committerPaul Mundt <lethal@linux-sh.org>2006-12-05 20:45:40 -0500
commitbd156147eb63ae525e0ac67868e41a808f03c532 (patch)
tree8774cf4f3297c94c10583f6331b5b17e0322f0db /include/asm-sh/timer.h
parent1d118562c2067a42d0e8f70671a4ce27d7c6ffee (diff)
sh: dyntick infrastructure.
This adds basic NO_IDLE_HZ support to the SH timer API so timers are able to wire it up. Taken from the ARM version, as it fit in to our API with very few changes needed. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/timer.h')
-rw-r--r--include/asm-sh/timer.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/asm-sh/timer.h b/include/asm-sh/timer.h
index 5a014bca9d58..17b5e76a4c31 100644
--- a/include/asm-sh/timer.h
+++ b/include/asm-sh/timer.h
@@ -18,8 +18,29 @@ struct sys_timer {
18 18
19 struct sys_device dev; 19 struct sys_device dev;
20 struct sys_timer_ops *ops; 20 struct sys_timer_ops *ops;
21
22#ifdef CONFIG_NO_IDLE_HZ
23 struct dyn_tick_timer *dyn_tick;
24#endif
21}; 25};
22 26
27#ifdef CONFIG_NO_IDLE_HZ
28#define DYN_TICK_ENABLED (1 << 1)
29
30struct dyn_tick_timer {
31 spinlock_t lock;
32 unsigned int state; /* Current state */
33 int (*enable)(void); /* Enables dynamic tick */
34 int (*disable)(void); /* Disables dynamic tick */
35 void (*reprogram)(unsigned long); /* Reprograms the timer */
36 int (*handler)(int, void *);
37};
38
39void timer_dyn_reprogram(void);
40#else
41#define timer_dyn_reprogram() do { } while (0)
42#endif
43
23#define TICK_SIZE (tick_nsec / 1000) 44#define TICK_SIZE (tick_nsec / 1000)
24 45
25extern struct sys_timer tmu_timer, cmt_timer, mtu2_timer; 46extern struct sys_timer tmu_timer, cmt_timer, mtu2_timer;