vserver 1.9.5.x5
[linux-2.6.git] / include / asm-ppc / timex.h
1 /*
2  * include/asm-ppc/timex.h
3  *
4  * ppc architecture timex specifications
5  */
6 #ifdef __KERNEL__
7 #ifndef _ASMppc_TIMEX_H
8 #define _ASMppc_TIMEX_H
9
10 #include <linux/config.h>
11 #include <asm/cputable.h>
12
13 #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
14
15 typedef unsigned long cycles_t;
16
17 /*
18  * For the "cycle" counter we use the timebase lower half.
19  * Currently only used on SMP.
20  */
21
22 extern cycles_t cacheflush_time;
23
24 static inline cycles_t get_cycles(void)
25 {
26         cycles_t ret = 0;
27
28         __asm__ __volatile__(
29                 "98:    mftb %0\n"
30                 "99:\n"
31                 ".section __ftr_fixup,\"a\"\n"
32                 "       .long %1\n"
33                 "       .long 0\n"
34                 "       .long 98b\n"
35                 "       .long 99b\n"
36                 ".previous"
37                 : "=r" (ret) : "i" (CPU_FTR_601));
38         return ret;
39 }
40
41 #endif
42 #endif /* __KERNEL__ */