diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-03-06 00:28:37 +0100 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 10:54:15 +0200 |
commit | 112f48716d9f292c92a033cff9e3ce7405ed4280 (patch) | |
tree | 5be2952ca83adb519df5995c10e0686447fea88f /include/asm-sparc64/timer.h | |
parent | [SPARC64]: Add tick_nohz_{stop,restart}_sched_tick() calls to cpu_idle(). (diff) | |
download | linux-112f48716d9f292c92a033cff9e3ce7405ed4280.tar.xz linux-112f48716d9f292c92a033cff9e3ce7405ed4280.zip |
[SPARC64]: Add clocksource/clockevents support.
I'd like to thank John Stul and others for helping
me along the way.
A lot of cleanups fell out of this. For example, the get_compare()
tick_op was totally unused, so was deleted. And the most often used
tick_op members were grouped together for cache-friendlyness.
The sparc64 TSC is given to the kernel as a one-shot timer.
tick_ops->init_timer() simply turns off the privileged bit in
the tick register (when possible), and disables the interrupt
by setting bit 63 in the compare register. The ->disable_irq()
op also sets this bit.
tick_ops->add_compare() is changed to:
1) Add the given delta to "tick" not to "compare"
2) Return a boolean which, if true, means that the tick
value read after writing the compare value was found
to have incremented past the initial tick value. This
mirrors logic used in the HPET driver's ->next_event()
method.
Each tick_ops implementation also now provides a name string.
And we feed this into the clocksource and clockevents layers.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64/timer.h')
-rw-r--r-- | include/asm-sparc64/timer.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/include/asm-sparc64/timer.h b/include/asm-sparc64/timer.h index d435594df786..ccbd69448866 100644 --- a/include/asm-sparc64/timer.h +++ b/include/asm-sparc64/timer.h @@ -11,22 +11,19 @@ struct sparc64_tick_ops { - void (*init_tick)(unsigned long); unsigned long (*get_tick)(void); - unsigned long (*get_compare)(void); - unsigned long (*add_tick)(unsigned long, unsigned long); - unsigned long (*add_compare)(unsigned long); + int (*add_compare)(unsigned long); unsigned long softint_mask; + void (*disable_irq)(void); + + void (*init_tick)(void); + unsigned long (*add_tick)(unsigned long); + + char *name; }; extern struct sparc64_tick_ops *tick_ops; -#ifdef CONFIG_SMP -extern unsigned long timer_tick_offset; -struct pt_regs; -extern void timer_tick_interrupt(struct pt_regs *); -#endif - extern unsigned long sparc64_get_clock_tick(unsigned int cpu); #endif /* _SPARC64_TIMER_H */ |