Commit ee17b36fd0dc2af37ea92548595e30964674ded8

Authored by john stultz
Committed by Linus Torvalds
1 parent c2f239d93e

v850: generic timekeeping conversion

Convert an arch that does not currently implement sub-jiffy timekeeping to
use the generic timekeeping code.

v850 looks like it has some intent to implement sub-jiffy timekeeping, so
it may not yet be appropriate to try to convert, but I figured I'd get the
maintainer's input and submit the patch for comment.

Signed-off-by: John Stultz <johnstul@us.ibm.com>
Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 2 changed files with 4 additions and 75 deletions Side-by-side Diff

... ... @@ -37,6 +37,10 @@
37 37 bool
38 38 default y
39 39  
  40 +config GENERIC_TIME
  41 + bool
  42 + default y
  43 +
40 44 config TIME_LOW_RES
41 45 bool
42 46 default y
arch/v850/kernel/time.c
... ... @@ -90,81 +90,6 @@
90 90 return IRQ_HANDLED;
91 91 }
92 92  
93   -/*
94   - * This version of gettimeofday has near microsecond resolution.
95   - */
96   -void do_gettimeofday (struct timeval *tv)
97   -{
98   -#if 0 /* DAVIDM later if possible */
99   - extern volatile unsigned long lost_ticks;
100   - unsigned long lost;
101   -#endif
102   - unsigned long flags;
103   - unsigned long usec, sec;
104   - unsigned long seq;
105   -
106   - do {
107   - seq = read_seqbegin_irqsave(&xtime_lock, flags);
108   -
109   -#if 0
110   - usec = mach_gettimeoffset ? mach_gettimeoffset () : 0;
111   -#else
112   - usec = 0;
113   -#endif
114   -#if 0 /* DAVIDM later if possible */
115   - lost = lost_ticks;
116   - if (lost)
117   - usec += lost * (1000000/HZ);
118   -#endif
119   - sec = xtime.tv_sec;
120   - usec += xtime.tv_nsec / 1000;
121   - } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
122   -
123   - while (usec >= 1000000) {
124   - usec -= 1000000;
125   - sec++;
126   - }
127   -
128   - tv->tv_sec = sec;
129   - tv->tv_usec = usec;
130   -}
131   -
132   -EXPORT_SYMBOL(do_gettimeofday);
133   -
134   -int do_settimeofday(struct timespec *tv)
135   -{
136   - if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
137   - return -EINVAL;
138   -
139   - write_seqlock_irq (&xtime_lock);
140   -
141   - /* This is revolting. We need to set the xtime.tv_nsec
142   - * correctly. However, the value in this location is
143   - * is value at the last tick.
144   - * Discover what correction gettimeofday
145   - * would have done, and then undo it!
146   - */
147   -#if 0
148   - tv->tv_nsec -= mach_gettimeoffset() * 1000;
149   -#endif
150   -
151   - while (tv->tv_nsec < 0) {
152   - tv->tv_nsec += NSEC_PER_SEC;
153   - tv->tv_sec--;
154   - }
155   -
156   - xtime.tv_sec = tv->tv_sec;
157   - xtime.tv_nsec = tv->tv_nsec;
158   -
159   - ntp_clear();
160   -
161   - write_sequnlock_irq (&xtime_lock);
162   - clock_was_set();
163   - return 0;
164   -}
165   -
166   -EXPORT_SYMBOL(do_settimeofday);
167   -
168 93 static int timer_dev_id;
169 94 static struct irqaction timer_irqaction = {
170 95 timer_interrupt,