* better
[mascara-docs.git] / i386 / linux-2.3.21 / include / asm-mips / timex.h
blob76b5998cf00f97ee489736e3e14bd7a5bf9ab510
1 /* $Id: timex.h,v 1.2 1999/02/15 02:22:14 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_MIPS_TIMEX_H
12 #define __ASM_MIPS_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 return read_32bit_cp0_register(CP0_COUNT);
39 #endif /* __ASM_MIPS_TIMEX_H */