mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 21:33:00 +00:00
112f48716d
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>
30 lines
628 B
C
30 lines
628 B
C
/* $Id: timer.h,v 1.3 2000/05/09 17:40:15 davem Exp $
|
|
* timer.h: System timer definitions for sun5.
|
|
*
|
|
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
|
|
*/
|
|
|
|
#ifndef _SPARC64_TIMER_H
|
|
#define _SPARC64_TIMER_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
|
struct sparc64_tick_ops {
|
|
unsigned long (*get_tick)(void);
|
|
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;
|
|
|
|
extern unsigned long sparc64_get_clock_tick(unsigned int cpu);
|
|
|
|
#endif /* _SPARC64_TIMER_H */
|