summaryrefslogtreecommitdiff
path: root/arch/xtensa
diff options
context:
space:
mode:
authorBaruch Siach <baruch@tkos.co.il>2013-06-17 11:29:46 +0300
committerChris Zankel <chris@zankel.net>2013-07-08 01:11:38 -0700
commite3f432919feb4f26fe837472669e397ba8e8fccb (patch)
tree8d9555828ab0739290f63f696cf88ca2d26def8b /arch/xtensa
parent925f5532e83bfe236b4f69ba4265c19663cfa9c7 (diff)
xtensa: ccount based sched_clock
Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/Kconfig1
-rw-r--r--arch/xtensa/kernel/time.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index dadcf824a5cb..8852c0d35834 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -11,6 +11,7 @@ config XTENSA
select VIRT_TO_BUS
select GENERIC_IRQ_SHOW
select GENERIC_CPU_DEVICES
+ select GENERIC_SCHED_CLOCK
select MODULES_USE_ELF_RELA
select GENERIC_PCI_IOMAP
select ARCH_WANT_IPC_PARSE_VERSION
diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c
index ece4f9588625..bdbb17312526 100644
--- a/arch/xtensa/kernel/time.c
+++ b/arch/xtensa/kernel/time.c
@@ -24,6 +24,7 @@
#include <linux/profile.h>
#include <linux/delay.h>
#include <linux/irqdomain.h>
+#include <linux/sched_clock.h>
#include <asm/timex.h>
#include <asm/platform.h>
@@ -37,6 +38,11 @@ static cycle_t ccount_read(struct clocksource *cs)
return (cycle_t)get_ccount();
}
+static u32 notrace ccount_sched_clock_read(void)
+{
+ return get_ccount();
+}
+
static struct clocksource ccount_clocksource = {
.name = "ccount",
.rating = 200,
@@ -134,6 +140,8 @@ void __init time_init(void)
0xffffffff);
setup_irq(ccount_timer.evt.irq, &timer_irqaction);
ccount_timer.irq_enabled = 1;
+
+ setup_sched_clock(ccount_sched_clock_read, 32, ccount_freq);
}
/*