diff options
Diffstat (limited to 'arch/cris')
-rw-r--r-- | arch/cris/arch-v10/kernel/time.c | 10 | ||||
-rw-r--r-- | arch/cris/kernel/time.c | 11 |
2 files changed, 6 insertions, 15 deletions
diff --git a/arch/cris/arch-v10/kernel/time.c b/arch/cris/arch-v10/kernel/time.c index bcffcb6a9415..fce7c541d70d 100644 --- a/arch/cris/arch-v10/kernel/time.c +++ b/arch/cris/arch-v10/kernel/time.c | |||
@@ -55,9 +55,9 @@ unsigned long get_ns_in_jiffie(void) | |||
55 | return ns; | 55 | return ns; |
56 | } | 56 | } |
57 | 57 | ||
58 | unsigned long do_slow_gettimeoffset(void) | 58 | static u32 cris_v10_gettimeoffset(void) |
59 | { | 59 | { |
60 | unsigned long count; | 60 | u32 count; |
61 | 61 | ||
62 | /* The timer interrupt comes from Etrax timer 0. In order to get | 62 | /* The timer interrupt comes from Etrax timer 0. In order to get |
63 | * better precision, we check the current value. It might have | 63 | * better precision, we check the current value. It might have |
@@ -65,8 +65,8 @@ unsigned long do_slow_gettimeoffset(void) | |||
65 | */ | 65 | */ |
66 | count = *R_TIMER0_DATA; | 66 | count = *R_TIMER0_DATA; |
67 | 67 | ||
68 | /* Convert timer value to usec */ | 68 | /* Convert timer value to nsec */ |
69 | return (TIMER0_DIV - count) * ((NSEC_PER_SEC/1000)/HZ)/TIMER0_DIV; | 69 | return (TIMER0_DIV - count) * (NSEC_PER_SEC/HZ)/TIMER0_DIV; |
70 | } | 70 | } |
71 | 71 | ||
72 | /* Excerpt from the Etrax100 HSDD about the built-in watchdog: | 72 | /* Excerpt from the Etrax100 HSDD about the built-in watchdog: |
@@ -191,6 +191,8 @@ static struct irqaction irq2 = { | |||
191 | void __init | 191 | void __init |
192 | time_init(void) | 192 | time_init(void) |
193 | { | 193 | { |
194 | arch_gettimeoffset = cris_v10_gettimeoffset; | ||
195 | |||
194 | /* probe for the RTC and read it if it exists | 196 | /* probe for the RTC and read it if it exists |
195 | * Before the RTC can be probed the loops_per_usec variable needs | 197 | * Before the RTC can be probed the loops_per_usec variable needs |
196 | * to be initialized to make usleep work. A better value for | 198 | * to be initialized to make usleep work. A better value for |
diff --git a/arch/cris/kernel/time.c b/arch/cris/kernel/time.c index 277ffc459e4b..fe6acdabbc8d 100644 --- a/arch/cris/kernel/time.c +++ b/arch/cris/kernel/time.c | |||
@@ -39,17 +39,6 @@ | |||
39 | extern unsigned long loops_per_jiffy; /* init/main.c */ | 39 | extern unsigned long loops_per_jiffy; /* init/main.c */ |
40 | unsigned long loops_per_usec; | 40 | unsigned long loops_per_usec; |
41 | 41 | ||
42 | |||
43 | #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET | ||
44 | extern unsigned long do_slow_gettimeoffset(void); | ||
45 | static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset; | ||
46 | |||
47 | u32 arch_gettimeoffset(void) | ||
48 | { | ||
49 | return do_gettimeoffset() * 1000; | ||
50 | } | ||
51 | #endif | ||
52 | |||
53 | int set_rtc_mmss(unsigned long nowtime) | 42 | int set_rtc_mmss(unsigned long nowtime) |
54 | { | 43 | { |
55 | D(printk(KERN_DEBUG "set_rtc_mmss(%lu)\n", nowtime)); | 44 | D(printk(KERN_DEBUG "set_rtc_mmss(%lu)\n", nowtime)); |