diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-10-04 00:21:45 -0400 |
---|---|---|
committer | Paul Mundt <pmundt@dysnomia.hsdv.com> | 2006-10-06 02:26:21 -0400 |
commit | 458821452642fd5dc2377b73cd1323fd4a9653e7 (patch) | |
tree | 7071b0a85f28c29bd6a2e4c45f38ec6993ff3fbc | |
parent | 49f19ce401edfff937c448dd74c22497da361889 (diff) |
sh: First step at generic timeofday support.
At the moment we wrap GENERIC_TIME around our existing timer API.
As boards start providing their own clocksources, they're able to
select GENERIC_TIME accordingly and optimize out most of the timer
API.
Once the current timers have been reworked as proper clocksource
drivers, the rest of the place holders for the timer API can go
away and we can flip on GENERIC_TIME unconditionally.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/Kconfig | 4 | ||||
-rw-r--r-- | arch/sh/kernel/time.c | 2 | ||||
-rw-r--r-- | include/asm-sh/timer.h | 4 |
3 files changed, 10 insertions, 0 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index f6a0c4436168..6a461d4caeff 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -45,6 +45,9 @@ config GENERIC_CALIBRATE_DELAY | |||
45 | config GENERIC_IOMAP | 45 | config GENERIC_IOMAP |
46 | bool | 46 | bool |
47 | 47 | ||
48 | config GENERIC_TIME | ||
49 | def_bool n | ||
50 | |||
48 | config ARCH_MAY_HAVE_PC_FDC | 51 | config ARCH_MAY_HAVE_PC_FDC |
49 | bool | 52 | bool |
50 | 53 | ||
@@ -357,6 +360,7 @@ config CPU_HAS_SR_RB | |||
357 | endmenu | 360 | endmenu |
358 | 361 | ||
359 | menu "Timer support" | 362 | menu "Timer support" |
363 | depends on !GENERIC_TIME | ||
360 | 364 | ||
361 | config SH_TMU | 365 | config SH_TMU |
362 | bool "TMU timer support" | 366 | bool "TMU timer support" |
diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index 450c68f1df05..1fbb83c665dd 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c | |||
@@ -47,6 +47,7 @@ unsigned long long __attribute__ ((weak)) sched_clock(void) | |||
47 | return (unsigned long long)jiffies * (1000000000 / HZ); | 47 | return (unsigned long long)jiffies * (1000000000 / HZ); |
48 | } | 48 | } |
49 | 49 | ||
50 | #ifndef CONFIG_GENERIC_TIME | ||
50 | void do_gettimeofday(struct timeval *tv) | 51 | void do_gettimeofday(struct timeval *tv) |
51 | { | 52 | { |
52 | unsigned long seq; | 53 | unsigned long seq; |
@@ -99,6 +100,7 @@ int do_settimeofday(struct timespec *tv) | |||
99 | return 0; | 100 | return 0; |
100 | } | 101 | } |
101 | EXPORT_SYMBOL(do_settimeofday); | 102 | EXPORT_SYMBOL(do_settimeofday); |
103 | #endif /* !CONFIG_GENERIC_TIME */ | ||
102 | 104 | ||
103 | /* last time the RTC clock got updated */ | 105 | /* last time the RTC clock got updated */ |
104 | static long last_rtc_update; | 106 | static long last_rtc_update; |
diff --git a/include/asm-sh/timer.h b/include/asm-sh/timer.h index c7ab28095ba0..ebc78db1a9ea 100644 --- a/include/asm-sh/timer.h +++ b/include/asm-sh/timer.h | |||
@@ -8,7 +8,9 @@ struct sys_timer_ops { | |||
8 | int (*init)(void); | 8 | int (*init)(void); |
9 | int (*start)(void); | 9 | int (*start)(void); |
10 | int (*stop)(void); | 10 | int (*stop)(void); |
11 | #ifndef CONFIG_GENERIC_TIME | ||
11 | unsigned long (*get_offset)(void); | 12 | unsigned long (*get_offset)(void); |
13 | #endif | ||
12 | unsigned long (*get_frequency)(void); | 14 | unsigned long (*get_frequency)(void); |
13 | }; | 15 | }; |
14 | 16 | ||
@@ -24,10 +26,12 @@ struct sys_timer { | |||
24 | extern struct sys_timer tmu_timer; | 26 | extern struct sys_timer tmu_timer; |
25 | extern struct sys_timer *sys_timer; | 27 | extern struct sys_timer *sys_timer; |
26 | 28 | ||
29 | #ifndef CONFIG_GENERIC_TIME | ||
27 | static inline unsigned long get_timer_offset(void) | 30 | static inline unsigned long get_timer_offset(void) |
28 | { | 31 | { |
29 | return sys_timer->ops->get_offset(); | 32 | return sys_timer->ops->get_offset(); |
30 | } | 33 | } |
34 | #endif | ||
31 | 35 | ||
32 | static inline unsigned long get_timer_frequency(void) | 36 | static inline unsigned long get_timer_frequency(void) |
33 | { | 37 | { |