1 #ifndef _ASMi386_TIMER_H
2 #define _ASMi386_TIMER_H
5 * struct timer_ops - used to define a timer source
7 * @name: name of the timer.
8 * @init: Probes and initializes the timer. Takes clock= override
9 * string as an argument. Returns 0 on success, anything else
11 * @mark_offset: called by the timer interrupt.
12 * @get_offset: called by gettimeofday(). Returns the number of microseconds
13 * since the last timer interupt.
14 * @monotonic_clock: returns the number of nanoseconds since the init of the
16 * @delay: delays this many clock cycles.
20 int (*init
)(char *override
);
21 void (*mark_offset
)(void);
22 unsigned long (*get_offset
)(void);
23 unsigned long long (*monotonic_clock
)(void);
24 void (*delay
)(unsigned long);
27 #define TICK_SIZE (tick_nsec / 1000)
29 extern struct timer_opts
* select_timer(void);
30 extern void clock_fallback(void);
31 void setup_pit_timer(void);
33 /* Modifiers for buggy PIT handling */
35 extern int pit_latch_buggy
;
37 extern struct timer_opts
*cur_timer
;
40 /* list of externed timers */
41 extern struct timer_opts timer_none
;
42 extern struct timer_opts timer_pit
;
43 extern struct timer_opts timer_tsc
;
44 #ifdef CONFIG_X86_CYCLONE_TIMER
45 extern struct timer_opts timer_cyclone
;
48 extern unsigned long calibrate_tsc(void);
49 extern void init_cpu_khz(void);
50 #ifdef CONFIG_HPET_TIMER
51 extern struct timer_opts timer_hpet
;
52 extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr
);
55 #ifdef CONFIG_X86_PM_TIMER
56 extern struct timer_opts timer_pmtmr
;