aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m32r
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-11-07 19:58:54 -0500
committerStephen Warren <swarren@nvidia.com>2012-12-24 11:36:07 -0500
commit7b1f62076bba10786d2118006ae68ac120cd6c56 (patch)
tree9af9f556fc331c77644c2e1c4eafdddad60019b1 /arch/m32r
parent547046f2f09f1837d39619afbc7a6e35673d7c98 (diff)
time: convert arch_gettimeoffset to a pointer
Currently, whenever CONFIG_ARCH_USES_GETTIMEOFFSET is enabled, each arch core provides a single implementation of arch_gettimeoffset(). In many cases, different sub-architectures, different machines, or different timer providers exist, and so the arch ends up implementing arch_gettimeoffset() as a call-through-pointer anyway. Examples are ARM, Cris, M68K, and it's arguable that the remaining architectures, M32R and Blackfin, should be doing this anyway. Modify arch_gettimeoffset so that it itself is a function pointer, which the arch initializes. This will allow later changes to move the initialization of this function into individual machine support or timer drivers. This is particularly useful for code in drivers/clocksource which should rely on an arch-independant mechanism to register their implementation of arch_gettimeoffset(). This patch also converts the Cris architecture to set arch_gettimeoffset directly to the final implementation in time_init(), because Cris already had separate time_init() functions per sub-architecture. M68K and ARM are converted to set arch_gettimeoffset to the final implementation in later patches, because they already have function pointers in place for this purpose. Cc: Russell King <linux@arm.linux.org.uk> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Mikael Starvik <starvik@axis.com> Cc: Hirokazu Takata <takata@linux-m32r.org> Cc: Thomas Gleixner <tglx@linutronix.de> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> Acked-by: John Stultz <johnstul@us.ibm.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/m32r')
-rw-r--r--arch/m32r/kernel/time.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c
index 84dd04048db9..1a15f81ea1bd 100644
--- a/arch/m32r/kernel/time.c
+++ b/arch/m32r/kernel/time.c
@@ -57,7 +57,7 @@ extern void smp_local_timer_interrupt(void);
57 57
58static unsigned long latch; 58static unsigned long latch;
59 59
60u32 arch_gettimeoffset(void) 60static u32 m32r_gettimeoffset(void)
61{ 61{
62 unsigned long elapsed_time = 0; /* [us] */ 62 unsigned long elapsed_time = 0; /* [us] */
63 63
@@ -165,6 +165,8 @@ void read_persistent_clock(struct timespec *ts)
165 165
166void __init time_init(void) 166void __init time_init(void)
167{ 167{
168 arch_gettimeoffset = m32r_gettimeoffset;
169
168#if defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_XNUX2) \ 170#if defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_XNUX2) \
169 || defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_M32700) \ 171 || defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_M32700) \
170 || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104) 172 || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104)