diff options
-rw-r--r-- | arch/blackfin/kernel/time-ts.c | 5 | ||||
-rw-r--r-- | include/asm-blackfin/timex.h | 17 |
2 files changed, 13 insertions, 9 deletions
diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c index 3aad6d710726..1ce8cb1e4982 100644 --- a/arch/blackfin/kernel/time-ts.c +++ b/arch/blackfin/kernel/time-ts.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/profile.h> | 12 | #include <linux/profile.h> |
13 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
14 | #include <linux/time.h> | 14 | #include <linux/time.h> |
15 | #include <linux/timex.h> | ||
15 | #include <linux/irq.h> | 16 | #include <linux/irq.h> |
16 | #include <linux/clocksource.h> | 17 | #include <linux/clocksource.h> |
17 | #include <linux/clockchips.h> | 18 | #include <linux/clockchips.h> |
@@ -35,9 +36,7 @@ static inline unsigned long long cycles_2_ns(cycle_t cyc) | |||
35 | 36 | ||
36 | static cycle_t read_cycles(void) | 37 | static cycle_t read_cycles(void) |
37 | { | 38 | { |
38 | unsigned long tmp, tmp2; | 39 | return get_cycles(); |
39 | asm("%0 = cycles; %1 = cycles2;" : "=d"(tmp), "=d"(tmp2)); | ||
40 | return tmp | ((cycle_t)tmp2 << 32); | ||
41 | } | 40 | } |
42 | 41 | ||
43 | unsigned long long sched_clock(void) | 42 | unsigned long long sched_clock(void) |
diff --git a/include/asm-blackfin/timex.h b/include/asm-blackfin/timex.h index 828590117f51..22b0806161bb 100644 --- a/include/asm-blackfin/timex.h +++ b/include/asm-blackfin/timex.h | |||
@@ -1,18 +1,23 @@ | |||
1 | /* blackfin architecture timex specifications: Lineo Inc. 2001 | 1 | /* |
2 | * asm-blackfin/timex.h: cpu cycles! | ||
2 | * | 3 | * |
3 | * Based on: include/asm-m68knommu/timex.h | 4 | * Copyright 2004-2008 Analog Devices Inc. |
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
4 | */ | 7 | */ |
5 | 8 | ||
6 | #ifndef _ASMBLACKFIN_TIMEX_H | 9 | #ifndef _ASM_BLACKFIN_TIMEX_H |
7 | #define _ASMBLACKFIN_TIMEX_H | 10 | #define _ASM_BLACKFIN_TIMEX_H |
8 | 11 | ||
9 | #define CLOCK_TICK_RATE 1000000 /* Underlying HZ */ | 12 | #define CLOCK_TICK_RATE 1000000 /* Underlying HZ */ |
10 | 13 | ||
11 | typedef unsigned long cycles_t; | 14 | typedef unsigned long long cycles_t; |
12 | 15 | ||
13 | static inline cycles_t get_cycles(void) | 16 | static inline cycles_t get_cycles(void) |
14 | { | 17 | { |
15 | return 0; | 18 | unsigned long tmp, tmp2; |
19 | __asm__("%0 = cycles; %1 = cycles2;" : "=d"(tmp), "=d"(tmp2)); | ||
20 | return tmp | ((cycles_t)tmp2 << 32); | ||
16 | } | 21 | } |
17 | 22 | ||
18 | #endif | 23 | #endif |