aboutsummaryrefslogtreecommitdiffstats
path: root/arch/h8300/kernel/time.c
diff options
context:
space:
mode:
authorjohn stultz <johnstul@us.ibm.com>2007-05-06 17:50:34 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:12:58 -0400
commitaeecf3142d82414d511135cc85f86caddfb58338 (patch)
tree46b10252750729120ec15f03aaad773f7da80258 /arch/h8300/kernel/time.c
parenta5f6abd4f7558fea97bc4021fd0eb7dcc5d16a77 (diff)
Convert h8/300 to generic timekeeping
Currently h8/300 does not implement sub-jiffy timekeeping, so there is no benefit to having arch specific timekeeping code. This patch simply removes those functions and enables the generic timekeeping code. Signed-off-by: John Stultz <johnstul@us.ibm.com> Acked-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/h8300/kernel/time.c')
-rw-r--r--arch/h8300/kernel/time.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/arch/h8300/kernel/time.c b/arch/h8300/kernel/time.c
index d1ef615ba895..91d3b56ddc68 100644
--- a/arch/h8300/kernel/time.c
+++ b/arch/h8300/kernel/time.c
@@ -66,55 +66,3 @@ void time_init(void)
66 66
67 platform_timer_setup(timer_interrupt); 67 platform_timer_setup(timer_interrupt);
68} 68}
69
70/*
71 * This version of gettimeofday has near microsecond resolution.
72 */
73void do_gettimeofday(struct timeval *tv)
74{
75 unsigned long flags;
76 unsigned long usec, sec;
77
78 read_lock_irqsave(&xtime_lock, flags);
79 usec = 0;
80 sec = xtime.tv_sec;
81 usec += (xtime.tv_nsec / 1000);
82 read_unlock_irqrestore(&xtime_lock, flags);
83
84 while (usec >= 1000000) {
85 usec -= 1000000;
86 sec++;
87 }
88
89 tv->tv_sec = sec;
90 tv->tv_usec = usec;
91}
92
93EXPORT_SYMBOL(do_gettimeofday);
94
95int do_settimeofday(struct timespec *tv)
96{
97 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
98 return -EINVAL;
99
100 write_lock_irq(&xtime_lock);
101 /* This is revolting. We need to set the xtime.tv_usec
102 * correctly. However, the value in this location is
103 * is value at the last tick.
104 * Discover what correction gettimeofday
105 * would have done, and then undo it!
106 */
107 while (tv->tv_nsec < 0) {
108 tv->tv_nsec += NSEC_PER_SEC;
109 tv->tv_sec--;
110 }
111
112 xtime.tv_sec = tv->tv_sec;
113 xtime.tv_nsec = tv->tv_nsec;
114 ntp_clear();
115 write_sequnlock_irq(&xtime_lock);
116 clock_was_set();
117 return 0;
118}
119
120EXPORT_SYMBOL(do_settimeofday);