MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / include / asm-x86_64 / timex.h
blob895294a7cd3f3c7fdd06555da1decb58f33730e7
1 /*
2 * linux/include/asm-x86_64/timex.h
4 * x86-64 architecture timex specifications
5 */
6 #ifndef _ASMx8664_TIMEX_H
7 #define _ASMx8664_TIMEX_H
9 #include <linux/config.h>
10 #include <asm/8253pit.h>
11 #include <asm/msr.h>
12 #include <asm/vsyscall.h>
13 #include <asm/hpet.h>
15 #define CLOCK_TICK_RATE PIT_TICK_RATE /* Underlying HZ */
16 #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */
17 #define FINETUNE ((((((int)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
18 (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
19 << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
21 typedef unsigned long long cycles_t;
23 extern cycles_t cacheflush_time;
25 static inline cycles_t get_cycles (void)
27 unsigned long long ret;
29 rdtscll(ret);
30 return ret;
33 extern unsigned int cpu_khz;
35 extern struct vxtime_data vxtime;
37 #endif