1 #ifndef _ASMi386_TIMER_H
2 #define _ASMi386_TIMER_H
5 * struct timer_ops - used to define a timer source
7 * @init: Probes and initializes the timer. Takes clock= override
8 * string as an argument. Returns 0 on success, anything else on failure.
9 * @mark_offset: called by the timer interrupt
10 * @get_offset: called by gettimeofday(). Returns the number of ms since the
11 * last timer intruupt.
15 int (*init)(char *override);
16 void (*mark_offset)(void);
17 unsigned long (*get_offset)(void);
18 unsigned long long (*monotonic_clock)(void);
19 void (*delay)(unsigned long);
22 #define TICK_SIZE (tick_nsec / 1000)
24 extern struct timer_opts* select_timer(void);
25 extern void clock_fallback(void);
27 /* Modifiers for buggy PIT handling */
29 extern int pit_latch_buggy;
31 extern struct timer_opts *cur_timer;
34 /* list of externed timers */
35 extern struct timer_opts timer_none;
36 extern struct timer_opts timer_pit;
37 extern struct timer_opts timer_tsc;
38 #ifdef CONFIG_X86_CYCLONE_TIMER
39 extern struct timer_opts timer_cyclone;
42 extern unsigned long calibrate_tsc(void);
43 extern void init_cpu_khz(void);
44 #ifdef CONFIG_HPET_TIMER
45 extern struct timer_opts timer_hpet;
46 extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr);
49 #ifdef CONFIG_X86_PM_TIMER
50 extern struct timer_opts timer_pmtmr;