summaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/time.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-07-18 23:31:08 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-07-18 23:31:08 +0000
commite8f9b6396e79654ea5932f64131cafbe8caadfb1 (patch)
tree90cf8b3a2475a774369eda22247cab7874fd7bbf /arch/ia64/kernel/time.c
parentd4c419dfaa853f5db107973976d4215ae648e976 (diff)
Merge with Linux 2.4.0-test5-pre2.
Diffstat (limited to 'arch/ia64/kernel/time.c')
-rw-r--r--arch/ia64/kernel/time.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index d14ba0031..95b2b3fc3 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -24,7 +24,7 @@
#include <asm/system.h>
extern rwlock_t xtime_lock;
-extern volatile unsigned long lost_ticks;
+extern unsigned long wall_jiffies;
#ifdef CONFIG_IA64_DEBUG_IRQ
@@ -80,7 +80,7 @@ gettimeoffset (void)
return 0;
#else
unsigned long now = ia64_get_itc(), last_tick;
- unsigned long elapsed_cycles, lost = lost_ticks;
+ unsigned long elapsed_cycles, lost = jiffies - wall_jiffies;
last_tick = (itm.next[smp_processor_id()].count - (lost+1)*itm.delta);
# if 1
@@ -101,13 +101,15 @@ do_settimeofday (struct timeval *tv)
write_lock_irq(&xtime_lock);
{
/*
- * This is revolting. We need to set the xtime.tv_usec
+ * This is revolting. We need to set "xtime"
* correctly. However, the value in this location is
- * is value at the last tick. Discover what
- * correction gettimeofday would have done, and then
- * undo it!
+ * the value at the most recent update of wall time.
+ * Discover what correction gettimeofday would have
+ * done, and then undo it!
*/
tv->tv_usec -= gettimeoffset();
+ tv->tv_usec -= (jiffies - wall_jiffies) * (1000000 / HZ);
+
while (tv->tv_usec < 0) {
tv->tv_usec += 1000000;
tv->tv_sec--;