PERFORCE change 119125 for review
Bruce M Simpson
bms at FreeBSD.org
Tue May 1 21:36:24 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=119125
Change 119125 by bms at 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];
More information about the p4-projects
mailing list