patch-2.4.23 linux-2.4.23/arch/i386/kernel/time.c
Next file: linux-2.4.23/arch/i386/mm/ioremap.c
Previous file: linux-2.4.23/arch/i386/kernel/smpboot.c
Back to the patch index
Back to the overall index
-  Lines: 26
-  Date:
2003-11-28 10:26:19.000000000 -0800
-  Orig file: 
linux-2.4.22/arch/i386/kernel/time.c
-  Orig date: 
2003-06-13 07:51:29.000000000 -0700
diff -urN linux-2.4.22/arch/i386/kernel/time.c linux-2.4.23/arch/i386/kernel/time.c
@@ -279,6 +279,7 @@
 static inline void mark_timeoffset_cyclone(void)
 {
 	int count;
+	unsigned long lost;
 	unsigned long delta = last_cyclone_timer;
 	spin_lock(&i8253_lock);
 	/* quickly read the cyclone timer */
@@ -293,11 +294,12 @@
 	spin_unlock(&i8253_lock);
 
 	/*lost tick compensation*/
-	delta = last_cyclone_timer - delta;
-	if(delta > loops_per_jiffy+2000){
-		delta = (delta/loops_per_jiffy)-1;
-		jiffies += delta;
-	}
+	delta = last_cyclone_timer - delta;	
+	delta /= (CYCLONE_TIMER_FREQ/1000000);
+	delta += delay_at_last_interrupt;
+	lost = delta/(1000000/HZ);
+	if (lost >= 2)
+		jiffies += lost-1;
                
 	count = ((LATCH-1) - count) * TICK_SIZE;
 	delay_at_last_interrupt = (count + LATCH/2) / LATCH;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)