patch-2.4.20 linux-2.4.20/arch/ppc/kernel/time.c

Next file: linux-2.4.20/arch/ppc/kernel/todc_time.c
Previous file: linux-2.4.20/arch/ppc/kernel/sleep.S
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/arch/ppc/kernel/time.c linux-2.4.20/arch/ppc/kernel/time.c
@@ -1,5 +1,5 @@
 /*
- * BK Id: SCCS/s.time.c 1.29 12/11/01 11:40:45 trini
+ * BK Id: %F% %I% %G% %U% %#%
  */
 /*
  * Common time routines among all ppc machines.
@@ -157,7 +157,12 @@
 		jiffy_stamp += tb_ticks_per_jiffy;
 		if (!user_mode(regs))
 			ppc_do_profile(instruction_pointer(regs));
-	  	if (smp_processor_id())
+		if (unlikely(!heartbeat_count(cpu)--) 
+				&& heartbeat_reset(cpu)) {
+			ppc_md.heartbeat();
+			heartbeat_count(cpu) = heartbeat_reset(cpu);
+		}
+	  	if (cpu)
 			continue;
 
 		/* We are in an interrupt, no need to save/restore flags */
@@ -192,8 +197,10 @@
 				last_rtc_update += 60;
 		}
 		write_unlock(&xtime_lock);
+		
+
 	}
-	if ( !disarm_decr[smp_processor_id()] )
+	if (!disarm_decr[cpu])
 		set_dec(next_dec);
 	last_jiffy_stamp(cpu) = jiffy_stamp;
 
@@ -201,9 +208,6 @@
 	smp_local_timer_interrupt(regs);
 #endif /* CONFIG_SMP */
 
-	if (ppc_md.heartbeat && !ppc_md.heartbeat_count--)
-		ppc_md.heartbeat();
-
 	hardirq_exit(cpu);
 
 	if (softirq_pending(cpu))

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)