V4L/DVB (4030): Minor code cleanup on the genpix-module
[linux-2.6/x86.git] / include / asm-powerpc / timex.h
blob3b9a8e78680646f3ee64f2582b0c14b26d0a08c9
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>
12 #define CLOCK_TICK_RATE 1024000 /* Underlying HZ */
14 typedef unsigned long cycles_t;
16 static inline cycles_t get_cycles(void)
18 cycles_t ret;
20 #ifdef __powerpc64__
22 __asm__ __volatile__("mftb %0" : "=r" (ret) : );
24 #else
26 * For the "cycle" counter we use the timebase lower half.
27 * Currently only used on SMP.
30 ret = 0;
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
44 return ret;
47 #endif /* __KERNEL__ */
48 #endif /* _ASM_POWERPC_TIMEX_H */