aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu/kernel
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2008-02-01 02:40:39 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-02-01 05:02:03 -0500
commit2d8815ba82ef5048806d36529f3e385450ba6e60 (patch)
tree1c3795a516ad13762b5dbe907e96198807cf3114 /arch/m68knommu/kernel
parentde0cc4e2830434c44131232fd953dee895be43a2 (diff)
m68knommu: remove local gettimeofday code
Remove unused local gettimeofday functions, now that we are using GENERIC_TIME. Signed-off-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68knommu/kernel')
-rw-r--r--arch/m68knommu/kernel/time.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c
index 207a55bdde98..89cdbcaeb45f 100644
--- a/arch/m68knommu/kernel/time.c
+++ b/arch/m68knommu/kernel/time.c
@@ -88,60 +88,3 @@ void time_init(void)
88 hw_timer_init(); 88 hw_timer_init();
89} 89}
90 90
91/*
92 * This version of gettimeofday has near microsecond resolution.
93 */
94void do_gettimeofday(struct timeval *tv)
95{
96 unsigned long flags;
97 unsigned long seq;
98 unsigned long usec, sec;
99
100 do {
101 seq = read_seqbegin_irqsave(&xtime_lock, flags);
102 usec = hw_timer_offset();
103 sec = xtime.tv_sec;
104 usec += (xtime.tv_nsec / 1000);
105 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
106
107 while (usec >= 1000000) {
108 usec -= 1000000;
109 sec++;
110 }
111
112 tv->tv_sec = sec;
113 tv->tv_usec = usec;
114}
115
116EXPORT_SYMBOL(do_gettimeofday);
117
118int do_settimeofday(struct timespec *tv)
119{
120 time_t wtm_sec, sec = tv->tv_sec;
121 long wtm_nsec, nsec = tv->tv_nsec;
122
123 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
124 return -EINVAL;
125
126 write_seqlock_irq(&xtime_lock);
127 /*
128 * This is revolting. We need to set the xtime.tv_usec
129 * correctly. However, the value in this location is
130 * is value at the last tick.
131 * Discover what correction gettimeofday
132 * would have done, and then undo it!
133 */
134 nsec -= (hw_timer_offset() * 1000);
135
136 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
137 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
138
139 set_normalized_timespec(&xtime, sec, nsec);
140 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
141
142 ntp_clear();
143 write_sequnlock_irq(&xtime_lock);
144 clock_was_set();
145 return 0;
146}
147EXPORT_SYMBOL(do_settimeofday);