MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / include / asm-ppc64 / timex.h
blobcb7149a8f5c6c433358899d227c0023f875a3f76
1 /*
2 * linux/include/asm-ppc/timex.h
4 * PPC64 architecture timex specifications
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
11 #ifndef _ASMPPC64_TIMEX_H
12 #define _ASMPPC64_TIMEX_H
14 #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
15 #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */
16 #define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
17 (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
18 << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
20 typedef unsigned long cycles_t;
22 static inline cycles_t get_cycles(void)
24 cycles_t ret;
26 __asm__ __volatile__("mftb %0" : "=r" (ret) : );
27 return ret;
30 #endif