patch-2.4.22 linux-2.4.22/arch/mips/galileo-boards/ev96100/time.c

Next file: linux-2.4.22/arch/mips/galileo-boards/generic/Makefile
Previous file: linux-2.4.22/arch/mips/galileo-boards/ev96100/setup.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/arch/mips/galileo-boards/ev96100/time.c linux-2.4.22/arch/mips/galileo-boards/ev96100/time.c
@@ -54,7 +54,7 @@
 
 static inline void ack_r4ktimer(unsigned long newval)
 {
-	write_32bit_cp0_register(CP0_COMPARE, newval);
+	write_c0_compare(newval);
 }
 
 static int set_rtc_mmss(unsigned long nowtime)
@@ -109,12 +109,11 @@
 	est_freq -= est_freq%10000;
 	printk("CPU frequency %d.%02d MHz\n", est_freq/1000000,
 	       (est_freq%1000000)*100/1000000);
-	r4k_cur = (read_32bit_cp0_register(CP0_COUNT) + r4k_offset);
+	r4k_cur = (read_c0_count() + r4k_offset);
 
-	write_32bit_cp0_register(CP0_COMPARE, r4k_cur);
+	write_c0_compare(r4k_cur);
 
-        /* FIX ME */
-	change_cp0_status(ST0_IM, IE_IRQ5);
+	change_c0_status(ST0_IM, IE_IRQ5);		/* FIX ME */
 }
 
 /* This is for machines which generate the exact clock. */
@@ -172,7 +171,7 @@
 	}
 
 	/* Get last timer tick in absolute kernel time */
-	count = read_32bit_cp0_register(CP0_COUNT);
+	count = read_c0_count();
 
 	/* .. relative to previous jiffy (32 bits is enough) */
 	count -= timerlo;
@@ -195,7 +194,7 @@
 
 void do_gettimeofday(struct timeval *tv)
 {
-	unsigned int flags;
+	unsigned long flags;
 
 	read_lock_irqsave (&xtime_lock, flags);
 	*tv = xtime;
@@ -221,7 +220,7 @@
 	write_lock_irq (&xtime_lock);
 
 	/* This is revolting. We need to set the xtime.tv_usec correctly.
-	 * However, the value in this location is is value at the last tick.
+	 * However, the value in this location is value at the last tick.
 	 * Discover what correction gettimeofday would have done, and then
 	 * undo it!
 	 */
@@ -260,7 +259,7 @@
 		r4k_cur += r4k_offset;
 		ack_r4ktimer(r4k_cur);
 
-	} while (((unsigned long)read_32bit_cp0_register(CP0_COUNT)
+	} while (((unsigned long)read_c0_count()
                     - r4k_cur) < 0x7fffffff);
 	return;
 

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