1 /*
2 * linux/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
12 #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
13 #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */
14 #define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
15 (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
16 << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
17
18 typedef unsigned long cycles_t;
19
20 /*
21 * For the "cycle" counter we use the timebase lower half.
22 * Currently only used on SMP.
23 *
24 * Since SMP kernels won't run on the PPC601 CPU (which doesn't have
25 * the timebase register) anyway, we don't bother checking the CPU version.
26 */
27
28 extern cycles_t cacheflush_time;
29
30 static inline cycles_t get_cycles(void)
31 {
32 #ifdef CONFIG_SMP
33 cycles_t ret;
34
35 __asm__("mftb %0" : "=r" (ret) : );
36 return ret;
37 #else
38 return 0;
39 #endif
40 }
41
42 #endif
43 #endif /* __KERNEL__ */
44
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.