change log for rtems (2011-03-04)

rtems-vc at rtems.org rtems-vc at rtems.org
Fri Mar 4 22:10:15 UTC 2011


 *joel*:
2011-03-04	Joel Sherrill <joel.sherrilL at OARcorp.com>

	* timer/timer.c: Retry up to 5 times when the calibration loop fails.

M  1.269  c/src/lib/libbsp/i386/pc386/ChangeLog
M   1.33  c/src/lib/libbsp/i386/pc386/timer/timer.c

diff -u rtems/c/src/lib/libbsp/i386/pc386/ChangeLog:1.268 rtems/c/src/lib/libbsp/i386/pc386/ChangeLog:1.269
--- rtems/c/src/lib/libbsp/i386/pc386/ChangeLog:1.268	Fri Feb 11 06:04:30 2011
+++ rtems/c/src/lib/libbsp/i386/pc386/ChangeLog	Fri Mar  4 15:56:44 2011
@@ -1,3 +1,7 @@
+2011-03-04	Joel Sherrill <joel.sherrilL at OARcorp.com>
+
+	* timer/timer.c: Retry up to 5 times when the calibration loop fails.
+
 2011-02-11	Ralf Corsépius <ralf.corsepius at rtems.org>
 
 	* include/bsp.h, include/tm27.h:

diff -u rtems/c/src/lib/libbsp/i386/pc386/timer/timer.c:1.32 rtems/c/src/lib/libbsp/i386/pc386/timer/timer.c:1.33
--- rtems/c/src/lib/libbsp/i386/pc386/timer/timer.c:1.32	Wed Feb  9 02:22:58 2011
+++ rtems/c/src/lib/libbsp/i386/pc386/timer/timer.c	Fri Mar  4 15:56:45 2011
@@ -334,13 +334,19 @@
   unsigned int targetClockBits, currentClockBits;
   unsigned int slowLoopGranularity, fastLoopGranularity;
   rtems_interrupt_level  level;
+  int retries = 0;
 
+  rtems_interrupt_disable(level);
+
+retry:
+  if ( ++retries >= 5 ) {
+    printk( "Calibrate_loop_1ms: too many attempts. giving up!!\n" );
+    while (1);
+  }
 #ifdef DEBUG_CALIBRATE
   printk("Calibrate_loop_1ms is starting,  please wait (but not too long.)\n");
 #endif
   targetClockBits = US_TO_TICK(1000);
-
-  rtems_interrupt_disable(level);
   /*
    * Fill up the cache to get a correct offset
    */
@@ -384,8 +390,11 @@
   fastLoop (10000);
   res = readTimer0() - offset;
   if (res < emptyCall) {
-     printk("Problem #1 in offset computation in Calibrate_loop_1ms in file libbsp/i386/pc386/timer/timer.c\n");
-    while (1);
+    printk(
+      "Problem #1 in offset computation in Calibrate_loop_1ms "
+        " in file libbsp/i386/pc386/timer/timer.c\n"
+    );
+    goto retry;
   }
   fastLoopGranularity = (res - emptyCall) / 10000;
   /*
@@ -395,14 +404,20 @@
   slowLoop(10);
   res = readTimer0();
   if (res < offset + emptyCall) {
-     printk("Problem #2 in offset computation in Calibrate_loop_1ms in file libbsp/i386/pc386/timer/timer.c\n");
-    while (1);
+    printk(
+      "Problem #2 in offset computation in Calibrate_loop_1ms "
+        " in file libbsp/i386/pc386/timer/timer.c\n"
+    );
+    goto retry;
   }
   slowLoopGranularity = (res - offset - emptyCall)/ 10;
 
   if (slowLoopGranularity == 0) {
-    printk("Problem #3 in Calibrate_loop_1ms in file libbsp/i386/pc386/timer/timer.c\n");
-    while (1);
+    printk(
+      "Problem #3 in offset computation in Calibrate_loop_1ms "
+        " in file libbsp/i386/pc386/timer/timer.c\n"
+    );
+    goto retry;
   }
 
   targetClockBits += offset;



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110304/a3fd1f04/attachment-0001.html>


More information about the vc mailing list