Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 May 2007 21:36:22 GMT
From:      Bruce M Simpson <bms@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 119125 for review
Message-ID:  <200705012136.l41LaMHb089205@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=119125

Change 119125 by bms@bms_anglepoise on 2007/05/01 21:35:29

	align both reads of cop0 timer with falling edge of rtc

Affected files ...

.. //depot/projects/mips2/src/sys/mips/mips/tick.c#10 edit

Differences ...

==== //depot/projects/mips2/src/sys/mips/mips/tick.c#10 (text+ko) ====

@@ -137,8 +137,6 @@
 		/*
 		 * Determine clock frequency from hardware.
 		 */
-		counterval[0] = mips_rd_count();
-
 #ifdef TICK_USE_MALTA_RTC
 		/* Set RTC to binary mode. */
 		writertc(RTC_STATUSB, (rtcin(RTC_STATUSB) | RTCSB_BCD));
@@ -149,6 +147,15 @@
 		while (((rtcin(RTC_STATUSA)& RTCSA_TUP) != 0))
 			;
 #endif
+		counterval[0] = mips_rd_count();
+
+#ifdef TICK_USE_MALTA_RTC
+		/* Busy-wait for falling edge of RTC update. */
+		while (((rtcin(RTC_STATUSA) & RTCSA_TUP) == 0))
+			;
+		while (((rtcin(RTC_STATUSA)& RTCSA_TUP) != 0))
+			;
+#endif
 
 		counterval[1] = mips_rd_count();
 		counter_freq = counterval[1] - counterval[0];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705012136.l41LaMHb089205>