Revert last change. Bug noticed by Linus.
[linux-2.6/linux-mips.git] / include / asm-mips64 / timex.h
blob1642f30bef931ec37edd48b8b3f6f8696aabd1f0
1 /* $Id: timex.h,v 1.1 1999/08/18 23:37:53 ralf Exp $
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
7 * Copyright (C) 1998, 1999 by Ralf Baechle
9 * FIXME: For some of the supported machines this is dead wrong.
11 #ifndef _ASM_TIMEX_H
12 #define _ASM_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)
21 * Standard way to access the cycle counter.
22 * Currently only used on SMP for scheduling.
24 * Only the low 32 bits are available as a continuously counting entity.
25 * But this only means we'll force a reschedule every 8 seconds or so,
26 * which isn't an evil thing.
28 * We know that all SMP capable CPUs have cycle counters.
31 typedef unsigned int cycles_t;
32 extern cycles_t cacheflush_time;
34 static inline cycles_t get_cycles (void)
36 cycles_t val;
38 __asm__ __volatile__(
39 ".set noreorder\n\t"
40 "mfc0 %0, $9\n\t"
41 ".set reorder"
42 : "=r" (val));
44 return val;
47 #endif /* _ASM_TIMEX_H */