ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-x86_64 / timex.h
1 /*
2  * linux/include/asm-x86_64/timex.h
3  *
4  * x86-64 architecture timex specifications
5  */
6 #ifndef _ASMx8664_TIMEX_H
7 #define _ASMx8664_TIMEX_H
8
9 #include <linux/config.h>
10 #include <asm/msr.h>
11 #include <asm/vsyscall.h>
12 #include <asm/hpet.h>
13
14 #define CLOCK_TICK_RATE 1193182 /* Underlying HZ */
15 #define CLOCK_TICK_FACTOR       20      /* Factor of both 1000000 and CLOCK_TICK_RATE */
16 #define FINETUNE ((((((int)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
17         (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
18                 << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
19
20 typedef unsigned long long cycles_t;
21
22 extern cycles_t cacheflush_time;
23
24 static inline cycles_t get_cycles (void)
25 {
26         unsigned long long ret;
27
28         rdtscll(ret);
29         return ret;
30 }
31
32 extern unsigned int cpu_khz;
33
34 extern struct vxtime_data vxtime;
35
36 #endif