Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is subject to the terms and conditions of the GNU General Public |
| 3 | * License. See the file "COPYING" in the main directory of this archive |
| 4 | * for more details. |
| 5 | * |
| 6 | * Copyright (C) 1998, 1999, 2003 by Ralf Baechle |
| 7 | */ |
| 8 | #ifndef _ASM_TIMEX_H |
| 9 | #define _ASM_TIMEX_H |
| 10 | |
Atsushi Nemoto | 8f9a2b3 | 2006-09-07 01:00:22 +0900 | [diff] [blame] | 11 | #ifdef __KERNEL__ |
| 12 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #include <asm/mipsregs.h> |
| 14 | |
| 15 | /* |
Ralf Baechle | 72fc19f | 2007-11-01 15:45:37 +0000 | [diff] [blame] | 16 | * This is the clock rate of the i8253 PIT. A MIPS system may not have |
| 17 | * a PIT by the symbol is used all over the kernel including some APIs. |
| 18 | * So keeping it defined to the number for the PIT is the only sane thing |
| 19 | * for now. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | */ |
Ralf Baechle | 72fc19f | 2007-11-01 15:45:37 +0000 | [diff] [blame] | 21 | #define CLOCK_TICK_RATE 1193182 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | |
| 23 | /* |
| 24 | * Standard way to access the cycle counter. |
| 25 | * Currently only used on SMP for scheduling. |
| 26 | * |
| 27 | * Only the low 32 bits are available as a continuously counting entity. |
| 28 | * But this only means we'll force a reschedule every 8 seconds or so, |
| 29 | * which isn't an evil thing. |
| 30 | * |
| 31 | * We know that all SMP capable CPUs have cycle counters. |
| 32 | */ |
| 33 | |
| 34 | typedef unsigned int cycles_t; |
| 35 | |
Ralf Baechle | 49a89ef | 2007-10-11 23:46:15 +0100 | [diff] [blame] | 36 | static inline cycles_t get_cycles(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | { |
Ralf Baechle | efb9ca0 | 2007-11-08 11:37:47 +0000 | [diff] [blame] | 38 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | } |
| 40 | |
Atsushi Nemoto | 8f9a2b3 | 2006-09-07 01:00:22 +0900 | [diff] [blame] | 41 | #endif /* __KERNEL__ */ |
| 42 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | #endif /* _ASM_TIMEX_H */ |