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

Next file: linux/arch/ppc/kernel/traps.c
Previous file: linux/arch/ppc/kernel/softemu8xx.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.100/linux/arch/ppc/kernel/time.c linux/arch/ppc/kernel/time.c
@@ -1,5 +1,5 @@
 /*
- * $Id: time.c,v 1.28 1998/04/07 18:49:49 cort Exp $
+ * $Id: time.c,v 1.32 1998/04/24 12:29:38 davem Exp $
  * Common time routines among all ppc machines.
  *
  * Written by Cort Dougan (cort@cs.nmt.edu) to merge
@@ -31,6 +31,7 @@
 #include <linux/kernel_stat.h>
 #include <linux/mc146818rtc.h>
 #include <linux/time.h>
+#include <linux/init.h>
 
 #include <asm/segment.h>
 #include <asm/io.h>
@@ -76,7 +77,6 @@
 	 * this hack should leave for a better solution -- Cort */
 	unsigned dcache_locked = unlock_dcache();
 	
-if ( smp_processor_id() ) printk("SMP 1: timer intr\n");	
 	hardirq_enter(cpu);
 	
 	while ((dval = get_dec()) < 0) {
@@ -116,6 +116,7 @@
 */
 void timebase_interrupt(int irq, void * dev, struct pt_regs * regs)
 {
+	printk("timebase_interrupt()\n");
 }
 
 /* The RTC on the MPC8xx is an internal register.
@@ -168,8 +169,7 @@
 }
 
 
-void
-time_init(void)
+__initfunc(void time_init(void))
 {
 #ifndef CONFIG_MBX
 	if ((_get_PVR() >> 16) == 1) {
@@ -181,8 +181,7 @@
 
 	switch (_machine) {
 	case _MACH_Pmac:
-		/* can't call pmac_get_rtc_time() yet,
-		   because via-cuda isn't initialized yet. */
+		xtime.tv_sec = pmac_get_rtc_time();
 		if ( (_get_PVR() >> 16) != 1 && (!smp_processor_id()) )
 			pmac_calibrate_decr();
 		if ( !smp_processor_id() )
@@ -212,8 +211,7 @@
 #endif
 	}
 	xtime.tv_usec = 0;
-	set_dec(decrementer_count);
-#else
+#else /* CONFIG_MBX */
 	mbx_calibrate_decr();
 	set_rtc_time = mbx_set_rtc_time;
 
@@ -249,7 +247,7 @@
 	xtime.tv_usec = 0;
 
 #endif /* CONFIG_MBX */
-	
+	set_dec(decrementer_count);
 	/* mark the rtc/on-chip timer as in sync
 	 * so we don't update right away
 	 */
@@ -265,7 +263,7 @@
  */
 int calibrate_done = 0;
 volatile int *done_ptr = &calibrate_done;
-void prep_calibrate_decr(void)
+__initfunc(void prep_calibrate_decr(void))
 {
 	unsigned long flags;
 
@@ -308,7 +306,7 @@
 	free_irq( 0, NULL);
 }
 
-void prep_calibrate_decr_handler(int irq, void *dev, struct pt_regs * regs)
+__initfunc(void prep_calibrate_decr_handler(int irq, void *dev, struct pt_regs * regs))
 {
 	unsigned long freq, divisor;
 	static unsigned long t1 = 0, t2 = 0;
@@ -337,8 +335,9 @@
  * sixteen, or external oscillator divided by four.  Currently, we only
  * support the MBX, which is system clock divided by sixteen.
  */
-void mbx_calibrate_decr(void)
+__initfunc(void mbx_calibrate_decr(void))
 {
+	bd_t	*binfo = (bd_t *)&res;
 	int freq, fp, divisor;
 
 	if ((((immap_t *)MBX_IMAP_ADDR)->im_clkrst.car_sccr & 0x02000000) == 0)
@@ -348,7 +347,7 @@
 	 * as MHz.  The value 'fp' is the number of decrementer ticks
 	 * per second.
 	 */
-	/*fp = (mbx_board_info.bi_intfreq * 1000000) / 16;*/
+	fp = (binfo->bi_intfreq * 1000000) / 16;
 	freq = fp*60;	/* try to make freq/1e6 an integer */
         divisor = 60;
         printk("time_init: decrementer frequency = %d/%d\n", freq, divisor);
@@ -432,3 +431,6 @@
 	/* Days are what is left over (+1) from all that. */
 	tm->tm_mday = day + 1;
 }
+
+
+

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov