change log for rtems (2011-07-29)

rtems-vc at rtems.org rtems-vc at rtems.org
Fri Jul 29 19:10:30 UTC 2011


 *jennifer*:
2011-07-29	Jennifer Averett <Jennifer.Averett at OARcorp.com>

	* smp03/init.c, smp03/system.h, smp03/tasks.c: Modified test to force a
	task to run prior to starting the next task. This allows the last
	task to always preempt, where if the tasks started in an odd order
	the last task could run prior the the task it was supposed to
	preempt.

M    1.5  testsuites/smptests/ChangeLog
M    1.3  testsuites/smptests/smp03/init.c
M    1.2  testsuites/smptests/smp03/system.h
M    1.3  testsuites/smptests/smp03/tasks.c

diff -u rtems/testsuites/smptests/ChangeLog:1.4 rtems/testsuites/smptests/ChangeLog:1.5
--- rtems/testsuites/smptests/ChangeLog:1.4	Fri Jul 29 07:29:33 2011
+++ rtems/testsuites/smptests/ChangeLog	Fri Jul 29 13:14:49 2011
@@ -1,5 +1,13 @@
 2011-07-29	Jennifer Averett <Jennifer.Averett at OARcorp.com>
 
+	* smp03/init.c, smp03/system.h, smp03/tasks.c: Modified test to force a
+	task to run prior to starting the next task. This allows the last
+	task to always preempt, where if the tasks started in an odd order
+	the last task could run prior the the task it was supposed to
+	preempt.
+
+2011-07-29	Jennifer Averett <Jennifer.Averett at OARcorp.com>
+
 	* smp01/init.c, smp02/init.c, smp02/tasks.c, smp03/init.c,
 	smp03/tasks.c, smp04/Makefile.am, smp04/init.c, smp05/init.c,
 	smp06/init.c, smp07/init.c, smp08/init.c: Cleaned up tests and fixed

diff -u rtems/testsuites/smptests/smp03/init.c:1.2 rtems/testsuites/smptests/smp03/init.c:1.3
--- rtems/testsuites/smptests/smp03/init.c:1.2	Fri Jul 29 07:29:34 2011
+++ rtems/testsuites/smptests/smp03/init.c	Fri Jul 29 13:14:49 2011
@@ -49,6 +49,11 @@
 
   locked_printf( "\n\n***  SMP03 TEST ***\n" );
 
+  /* Initialize the TaskRan array */
+  TaskRan[0] = true;
+  for ( i=1; i<rtems_smp_get_number_of_processors() ; i++ ) {
+    TaskRan[i] = false;
+  }
 
   /* Show that the init task is running on this cpu */
   PrintTaskInfo( "Init" );
@@ -67,8 +72,12 @@
       &id
     );
     status = rtems_task_start( id, Test_task, i );
-
-    Loop();
+    
+    /* Allow task to start before starting next task.
+     * This is necessary on some simulators.
+     */ 
+    while (TaskRan[i] == false)
+      ;
   }
 
   /* Create/Start an aditional task with the highest priority */
@@ -80,16 +89,20 @@
     RTEMS_DEFAULT_ATTRIBUTES,
     &id
   );
-  TestFinished = false;
   status = rtems_task_start(id,Test_task,rtems_smp_get_number_of_processors());
 
-  /* Wait on the last task to run */
-  while(!TestFinished)
-    ;
-
-  /* End the test */
-  Loop();
-  locked_printf( "*** END OF TEST SMP03 ***\n" );
-  Loop();
+  /* Wait on all tasks to run */
+  while (1) {
+    TestFinished = true;
+    for ( i=1; i < (rtems_smp_get_number_of_processors()+1) ; i++ ) {
+      if (TaskRan[i] == false)
+        TestFinished = false;
+    }
+    if (TestFinished) {
+      locked_printf( "*** END OF TEST SMP03 ***\n" );
+      rtems_test_exit( 0 );
+    }
+  }
+
   rtems_test_exit( 0 );    
 }

diff -u rtems/testsuites/smptests/smp03/system.h:1.1 rtems/testsuites/smptests/smp03/system.h:1.2
--- rtems/testsuites/smptests/smp03/system.h:1.1	Tue Jun 28 16:08:47 2011
+++ rtems/testsuites/smptests/smp03/system.h	Fri Jul 29 13:14:49 2011
@@ -50,6 +50,12 @@
 /*
  *  Keep the names and IDs in global variables so another task can use them.
  */
+
+TEST_EXTERN volatile bool TaskRan[ CONFIGURE_SMP_MAXIMUM_PROCESSORS + 1 ];
+
+/*
+ *  Keep the names and IDs in global variables so another task can use them.
+ */
 void Loop(void);
 void PrintTaskInfo(
   const char *task_name

diff -u rtems/testsuites/smptests/smp03/tasks.c:1.2 rtems/testsuites/smptests/smp03/tasks.c:1.3
--- rtems/testsuites/smptests/smp03/tasks.c:1.2	Fri Jul 29 07:29:34 2011
+++ rtems/testsuites/smptests/smp03/tasks.c	Fri Jul 29 13:14:49 2011
@@ -25,12 +25,7 @@
   sprintf( task_name, "TA%" PRIu32, task_index );
   PrintTaskInfo( task_name );
 
-  /* If this is the last task created set a flag for the
-   * test to end.
-   */
-  if ( task_index  == rtems_smp_get_number_of_processors() ) {
-    TestFinished = true;
-  }
+  TaskRan[task_index] = true;
 
   /* Wait for the test to end without giving up this processor */
   while(1)



--

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/20110729/e2f5f30d/attachment.html>


More information about the vc mailing list