提交 e3f43291 编写于 作者: B Baruch Siach 提交者: Chris Zankel

xtensa: ccount based sched_clock

Signed-off-by: NBaruch Siach <baruch@tkos.co.il>
Signed-off-by: NChris Zankel <chris@zankel.net>
上级 925f5532
...@@ -11,6 +11,7 @@ config XTENSA ...@@ -11,6 +11,7 @@ config XTENSA
select VIRT_TO_BUS select VIRT_TO_BUS
select GENERIC_IRQ_SHOW select GENERIC_IRQ_SHOW
select GENERIC_CPU_DEVICES select GENERIC_CPU_DEVICES
select GENERIC_SCHED_CLOCK
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select GENERIC_PCI_IOMAP select GENERIC_PCI_IOMAP
select ARCH_WANT_IPC_PARSE_VERSION select ARCH_WANT_IPC_PARSE_VERSION
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/profile.h> #include <linux/profile.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/irqdomain.h> #include <linux/irqdomain.h>
#include <linux/sched_clock.h>
#include <asm/timex.h> #include <asm/timex.h>
#include <asm/platform.h> #include <asm/platform.h>
...@@ -37,6 +38,11 @@ static cycle_t ccount_read(struct clocksource *cs) ...@@ -37,6 +38,11 @@ static cycle_t ccount_read(struct clocksource *cs)
return (cycle_t)get_ccount(); return (cycle_t)get_ccount();
} }
static u32 notrace ccount_sched_clock_read(void)
{
return get_ccount();
}
static struct clocksource ccount_clocksource = { static struct clocksource ccount_clocksource = {
.name = "ccount", .name = "ccount",
.rating = 200, .rating = 200,
...@@ -134,6 +140,8 @@ void __init time_init(void) ...@@ -134,6 +140,8 @@ void __init time_init(void)
0xffffffff); 0xffffffff);
setup_irq(ccount_timer.evt.irq, &timer_irqaction); setup_irq(ccount_timer.evt.irq, &timer_irqaction);
ccount_timer.irq_enabled = 1; ccount_timer.irq_enabled = 1;
setup_sched_clock(ccount_sched_clock_read, 32, ccount_freq);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册