aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2008-04-23 17:07:29 -0400
committerBryan Wu <cooloney@kernel.org>2008-04-23 17:07:29 -0400
commit764cb81cdc0620711d2cef5d06e9ef03c9d84184 (patch)
tree2a42b808807ed8690bb7b106b428744349ed54ce /include
parent8cab0288c6376b9c00155b0802cbe84118d1ba89 (diff)
[Blackfin] arch: actually implement get_cycles function
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-blackfin/timex.h17
1 files changed, 11 insertions, 6 deletions
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
11typedef unsigned long cycles_t; 14typedef unsigned long long cycles_t;
12 15
13static inline cycles_t get_cycles(void) 16static 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