summaryrefslogtreecommitdiffstats
path: root/include/asm-mips/timex.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
commit86464aed71025541805e7b1515541aee89879e33 (patch)
treee01a457a4912a8553bc65524aa3125d51f29f810 /include/asm-mips/timex.h
parent88f99939ecc6a95a79614574cb7d95ffccfc3466 (diff)
Merge with Linux 2.2.1.
Diffstat (limited to 'include/asm-mips/timex.h')
-rw-r--r--include/asm-mips/timex.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/include/asm-mips/timex.h b/include/asm-mips/timex.h
index dd4aea511..2bec751a4 100644
--- a/include/asm-mips/timex.h
+++ b/include/asm-mips/timex.h
@@ -1,10 +1,10 @@
-/* $Id: timex.h,v 1.1 1998/08/17 10:20:18 ralf Exp $
+/* $Id: timex.h,v 1.1 1998/08/25 09:22:03 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 1998 by Ralf Baechle
+ * Copyright (C) 1998, 1999 by Ralf Baechle
*
* FIXME: For some of the supported machines this is dead wrong.
*/
@@ -17,4 +17,23 @@
(1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
<< (SHIFT_SCALE-SHIFT_HZ)) / HZ)
+/*
+ * Standard way to access the cycle counter.
+ * Currently only used on SMP for scheduling.
+ *
+ * Only the low 32 bits are available as a continuously counting entity.
+ * But this only means we'll force a reschedule every 8 seconds or so,
+ * which isn't an evil thing.
+ *
+ * We know that all SMP capable CPUs have cycle counters.
+ */
+
+typedef unsigned int cycles_t;
+extern cycles_t cacheflush_time;
+
+static inline cycles_t get_cycles (void)
+{
+ return read_32bit_cp0_register(CP0_COUNT);
+}
+
#endif /* __ASM_MIPS_TIMEX_H */