aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v10/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris/arch-v10/kernel/time.c')
-rw-r--r--arch/cris/arch-v10/kernel/time.c10
1 files changed, 6 insertions, 4 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
58unsigned long do_slow_gettimeoffset(void) 58static 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 = {
191void __init 191void __init
192time_init(void) 192time_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