Merge branch 'upstream' of git://lost.foo-projects.org/~ahkok/git/netdev-2.6 into...
[deliverable/linux.git] / include / asm-powerpc / timex.h
1 #ifndef _ASM_POWERPC_TIMEX_H
2 #define _ASM_POWERPC_TIMEX_H
3
4 #ifdef __KERNEL__
5
6 /*
7 * PowerPC architecture timex specifications
8 */
9
10 #include <asm/cputable.h>
11
12 #define CLOCK_TICK_RATE 1024000 /* Underlying HZ */
13
14 typedef unsigned long cycles_t;
15
16 static inline cycles_t get_cycles(void)
17 {
18 cycles_t ret;
19
20 #ifdef __powerpc64__
21
22 __asm__ __volatile__("mftb %0" : "=r" (ret) : );
23
24 #else
25 /*
26 * For the "cycle" counter we use the timebase lower half.
27 * Currently only used on SMP.
28 */
29
30 ret = 0;
31
32 __asm__ __volatile__(
33 "98: mftb %0\n"
34 "99:\n"
35 ".section __ftr_fixup,\"a\"\n"
36 " .long %1\n"
37 " .long 0\n"
38 " .long 98b\n"
39 " .long 99b\n"
40 ".previous"
41 : "=r" (ret) : "i" (CPU_FTR_601));
42 #endif
43
44 return ret;
45 }
46
47 #endif /* __KERNEL__ */
48 #endif /* _ASM_POWERPC_TIMEX_H */
This page took 0.032107 seconds and 6 git commands to generate.