提交 764cb81c 编写于 作者: M Mike Frysinger 提交者: Bryan Wu

[Blackfin] arch: actually implement get_cycles function

Signed-off-by: NMike Frysinger <vapier.adi@gmail.com>
Signed-off-by: NBryan Wu <cooloney@kernel.org>
上级 8cab0288
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/profile.h> #include <linux/profile.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/timex.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
#include <linux/clockchips.h> #include <linux/clockchips.h>
...@@ -35,9 +36,7 @@ static inline unsigned long long cycles_2_ns(cycle_t cyc) ...@@ -35,9 +36,7 @@ static inline unsigned long long cycles_2_ns(cycle_t cyc)
static cycle_t read_cycles(void) static cycle_t read_cycles(void)
{ {
unsigned long tmp, tmp2; return get_cycles();
asm("%0 = cycles; %1 = cycles2;" : "=d"(tmp), "=d"(tmp2));
return tmp | ((cycle_t)tmp2 << 32);
} }
unsigned long long sched_clock(void) unsigned long long sched_clock(void)
......
/* blackfin architecture timex specifications: Lineo Inc. 2001 /*
* asm-blackfin/timex.h: cpu cycles!
* *
* Based on: include/asm-m68knommu/timex.h * Copyright 2004-2008 Analog Devices Inc.
*
* Licensed under the GPL-2 or later.
*/ */
#ifndef _ASMBLACKFIN_TIMEX_H #ifndef _ASM_BLACKFIN_TIMEX_H
#define _ASMBLACKFIN_TIMEX_H #define _ASM_BLACKFIN_TIMEX_H
#define CLOCK_TICK_RATE 1000000 /* Underlying HZ */ #define CLOCK_TICK_RATE 1000000 /* Underlying HZ */
typedef unsigned long cycles_t; typedef unsigned long long cycles_t;
static inline cycles_t get_cycles(void) static inline cycles_t get_cycles(void)
{ {
return 0; unsigned long tmp, tmp2;
__asm__("%0 = cycles; %1 = cycles2;" : "=d"(tmp), "=d"(tmp2));
return tmp | ((cycles_t)tmp2 << 32);
} }
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册