diff options
author | Baruch Siach <baruch@tkos.co.il> | 2013-06-17 04:29:46 -0400 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2013-07-08 04:11:38 -0400 |
commit | e3f432919feb4f26fe837472669e397ba8e8fccb (patch) | |
tree | 8d9555828ab0739290f63f696cf88ca2d26def8b /arch/xtensa | |
parent | 925f5532e83bfe236b4f69ba4265c19663cfa9c7 (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/Kconfig | 1 | ||||
-rw-r--r-- | arch/xtensa/kernel/time.c | 8 |
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 | |||
11 | select VIRT_TO_BUS | 11 | select VIRT_TO_BUS |
12 | select GENERIC_IRQ_SHOW | 12 | select GENERIC_IRQ_SHOW |
13 | select GENERIC_CPU_DEVICES | 13 | select GENERIC_CPU_DEVICES |
14 | select GENERIC_SCHED_CLOCK | ||
14 | select MODULES_USE_ELF_RELA | 15 | select MODULES_USE_ELF_RELA |
15 | select GENERIC_PCI_IOMAP | 16 | select GENERIC_PCI_IOMAP |
16 | select ARCH_WANT_IPC_PARSE_VERSION | 17 | 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 @@ | |||
24 | #include <linux/profile.h> | 24 | #include <linux/profile.h> |
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <linux/irqdomain.h> | 26 | #include <linux/irqdomain.h> |
27 | #include <linux/sched_clock.h> | ||
27 | 28 | ||
28 | #include <asm/timex.h> | 29 | #include <asm/timex.h> |
29 | #include <asm/platform.h> | 30 | #include <asm/platform.h> |
@@ -37,6 +38,11 @@ static cycle_t ccount_read(struct clocksource *cs) | |||
37 | return (cycle_t)get_ccount(); | 38 | return (cycle_t)get_ccount(); |
38 | } | 39 | } |
39 | 40 | ||
41 | static u32 notrace ccount_sched_clock_read(void) | ||
42 | { | ||
43 | return get_ccount(); | ||
44 | } | ||
45 | |||
40 | static struct clocksource ccount_clocksource = { | 46 | static struct clocksource ccount_clocksource = { |
41 | .name = "ccount", | 47 | .name = "ccount", |
42 | .rating = 200, | 48 | .rating = 200, |
@@ -134,6 +140,8 @@ void __init time_init(void) | |||
134 | 0xffffffff); | 140 | 0xffffffff); |
135 | setup_irq(ccount_timer.evt.irq, &timer_irqaction); | 141 | setup_irq(ccount_timer.evt.irq, &timer_irqaction); |
136 | ccount_timer.irq_enabled = 1; | 142 | ccount_timer.irq_enabled = 1; |
143 | |||
144 | setup_sched_clock(ccount_sched_clock_read, 32, ccount_freq); | ||
137 | } | 145 | } |
138 | 146 | ||
139 | /* | 147 | /* |