Merge git://git.linux-nfs.org/pub/linux/nfs-2.6
[pv_ops_mirror.git] / include / asm-powerpc / timex.h
blob92dedde761d183a0109dfd7173c37ec1f3a1d43b
1 #ifndef _ASM_POWERPC_TIMEX_H
2 #define _ASM_POWERPC_TIMEX_H
4 #ifdef __KERNEL__
6 /*
7 * PowerPC architecture timex specifications
8 */
10 #include <asm/cputable.h>
11 #include <asm/reg.h>
13 #define CLOCK_TICK_RATE 1024000 /* Underlying HZ */
15 typedef unsigned long cycles_t;
17 static inline cycles_t get_cycles(void)
19 #ifdef __powerpc64__
20 return mftb();
21 #else
22 cycles_t ret;
25 * For the "cycle" counter we use the timebase lower half.
26 * Currently only used on SMP.
29 ret = 0;
31 __asm__ __volatile__(
32 "97: mftb %0\n"
33 "99:\n"
34 ".section __ftr_fixup,\"a\"\n"
35 ".align 2\n"
36 "98:\n"
37 " .long %1\n"
38 " .long 0\n"
39 " .long 97b-98b\n"
40 " .long 99b-98b\n"
41 ".previous"
42 : "=r" (ret) : "i" (CPU_FTR_601));
43 return ret;
44 #endif
47 #endif /* __KERNEL__ */
48 #endif /* _ASM_POWERPC_TIMEX_H */