xtensa: ccount based sched_clock
authorBaruch Siach <baruch@tkos.co.il>
Mon, 17 Jun 2013 08:29:46 +0000 (11:29 +0300)
committerChris Zankel <chris@zankel.net>
Mon, 8 Jul 2013 08:11:38 +0000 (01:11 -0700)
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Chris Zankel <chris@zankel.net>
arch/xtensa/Kconfig
arch/xtensa/kernel/time.c

index dadcf824a5cb91ca9d37bb51050d0ee3eb895abd..8852c0d358349217431b6f50513fbda391704de7 100644 (file)
@@ -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
index ece4f95886252528e3115a9ef16632d3ff758f22..bdbb173125269afdf9a0bff5981a27e995fa05dc 100644 (file)
@@ -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);
 }
 
 /*