diff options
author | jdl@freescale.com <jdl@freescale.com> | 2005-09-07 16:59:48 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-09-09 08:11:35 -0400 |
commit | dd56fdf23dfa0127d512b73d4238dbd2b5a7c1eb (patch) | |
tree | 59f952b87d4bec5f11c578a384c3aaa2ddf5860d /include/asm-powerpc/timex.h | |
parent | 64807081e38703617cf9a5d71db14ea2b3e1cb04 (diff) |
[PATCH] powerpc: Merge a few more include files
Merge a few asm-ppc and asm-ppc64 header files.
Note: the merge of setup.h intentionally does not carry
forward the m68k cruft. That means this patch continues
to break the already broken amiga on the ppc32.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/timex.h')
-rw-r--r-- | include/asm-powerpc/timex.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/include/asm-powerpc/timex.h b/include/asm-powerpc/timex.h new file mode 100644 index 000000000000..51c5b316be55 --- /dev/null +++ b/include/asm-powerpc/timex.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef _ASM_POWERPC_TIMEX_H | ||
2 | #define _ASM_POWERPC_TIMEX_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | /* | ||
7 | * PowerPC architecture timex specifications | ||
8 | */ | ||
9 | |||
10 | #include <linux/config.h> | ||
11 | #include <asm/cputable.h> | ||
12 | |||
13 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ | ||
14 | |||
15 | typedef unsigned long cycles_t; | ||
16 | |||
17 | static inline cycles_t get_cycles(void) | ||
18 | { | ||
19 | cycles_t ret; | ||
20 | |||
21 | #ifdef __powerpc64__ | ||
22 | |||
23 | __asm__ __volatile__("mftb %0" : "=r" (ret) : ); | ||
24 | |||
25 | #else | ||
26 | /* | ||
27 | * For the "cycle" counter we use the timebase lower half. | ||
28 | * Currently only used on SMP. | ||
29 | */ | ||
30 | |||
31 | ret = 0; | ||
32 | |||
33 | __asm__ __volatile__( | ||
34 | "98: mftb %0\n" | ||
35 | "99:\n" | ||
36 | ".section __ftr_fixup,\"a\"\n" | ||
37 | " .long %1\n" | ||
38 | " .long 0\n" | ||
39 | " .long 98b\n" | ||
40 | " .long 99b\n" | ||
41 | ".previous" | ||
42 | : "=r" (ret) : "i" (CPU_FTR_601)); | ||
43 | #endif | ||
44 | |||
45 | return ret; | ||
46 | } | ||
47 | |||
48 | #endif /* __KERNEL__ */ | ||
49 | #endif /* _ASM_POWERPC_TIMEX_H */ | ||