diff options
Diffstat (limited to 'include/asm-powerpc/timex.h')
-rw-r--r-- | include/asm-powerpc/timex.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/asm-powerpc/timex.h b/include/asm-powerpc/timex.h index e3f08cf91486..92dedde761d1 100644 --- a/include/asm-powerpc/timex.h +++ b/include/asm-powerpc/timex.h | |||
@@ -8,6 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <asm/cputable.h> | 10 | #include <asm/cputable.h> |
11 | #include <asm/reg.h> | ||
11 | 12 | ||
12 | #define CLOCK_TICK_RATE 1024000 /* Underlying HZ */ | 13 | #define CLOCK_TICK_RATE 1024000 /* Underlying HZ */ |
13 | 14 | ||
@@ -15,13 +16,11 @@ typedef unsigned long cycles_t; | |||
15 | 16 | ||
16 | static inline cycles_t get_cycles(void) | 17 | static inline cycles_t get_cycles(void) |
17 | { | 18 | { |
18 | cycles_t ret; | ||
19 | |||
20 | #ifdef __powerpc64__ | 19 | #ifdef __powerpc64__ |
21 | 20 | return mftb(); | |
22 | __asm__ __volatile__("mftb %0" : "=r" (ret) : ); | ||
23 | |||
24 | #else | 21 | #else |
22 | cycles_t ret; | ||
23 | |||
25 | /* | 24 | /* |
26 | * For the "cycle" counter we use the timebase lower half. | 25 | * For the "cycle" counter we use the timebase lower half. |
27 | * Currently only used on SMP. | 26 | * Currently only used on SMP. |
@@ -41,9 +40,8 @@ static inline cycles_t get_cycles(void) | |||
41 | " .long 99b-98b\n" | 40 | " .long 99b-98b\n" |
42 | ".previous" | 41 | ".previous" |
43 | : "=r" (ret) : "i" (CPU_FTR_601)); | 42 | : "=r" (ret) : "i" (CPU_FTR_601)); |
44 | #endif | ||
45 | |||
46 | return ret; | 43 | return ret; |
44 | #endif | ||
47 | } | 45 | } |
48 | 46 | ||
49 | #endif /* __KERNEL__ */ | 47 | #endif /* __KERNEL__ */ |