You need to sign in or sign up before continuing.
提交 7e48c0b9 编写于 作者: R Rob Herring

ARM: make sched_clock just call a function pointer

This converts sched_clock to simply a call to a function pointer in order
to allow overriding it. This will allow for use with 64-bit counters where
overflow handling is not needed.
Signed-off-by: NRob Herring <rob.herring@calxeda.com>
上级 c115739d
...@@ -11,4 +11,6 @@ ...@@ -11,4 +11,6 @@
extern void sched_clock_postinit(void); extern void sched_clock_postinit(void);
extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate); extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);
extern unsigned long long (*sched_clock_func)(void);
#endif #endif
...@@ -165,12 +165,19 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate) ...@@ -165,12 +165,19 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate)
pr_debug("Registered %pF as sched_clock source\n", read); pr_debug("Registered %pF as sched_clock source\n", read);
} }
unsigned long long notrace sched_clock(void) static unsigned long long notrace sched_clock_32(void)
{ {
u32 cyc = read_sched_clock(); u32 cyc = read_sched_clock();
return cyc_to_sched_clock(cyc, sched_clock_mask); return cyc_to_sched_clock(cyc, sched_clock_mask);
} }
unsigned long long __read_mostly (*sched_clock_func)(void) = sched_clock_32;
unsigned long long notrace sched_clock(void)
{
return sched_clock_func();
}
void __init sched_clock_postinit(void) void __init sched_clock_postinit(void)
{ {
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册