Changeset 5c283458 in rtems


Ignore:
Timestamp:
Jul 29, 2011, 6:14:49 PM (10 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.11, 5, master
Children:
6662754
Parents:
4f6cc11d
Message:

2011-07-29 Jennifer Averett <Jennifer.Averett@…>

  • 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.
Location:
testsuites/smptests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • testsuites/smptests/ChangeLog

    r4f6cc11d r5c283458  
     12011-07-29      Jennifer Averett <Jennifer.Averett@OARcorp.com>
     2
     3        * smp03/init.c, smp03/system.h, smp03/tasks.c: Modified test to force a
     4        task to run prior to starting the next task. This allows the last
     5        task to always preempt, where if the tasks started in an odd order
     6        the last task could run prior the the task it was supposed to
     7        preempt.
     8
    192011-07-29      Jennifer Averett <Jennifer.Averett@OARcorp.com>
    210
  • testsuites/smptests/smp03/init.c

    r4f6cc11d r5c283458  
    5050  locked_printf( "\n\n***  SMP03 TEST ***\n" );
    5151
     52  /* Initialize the TaskRan array */
     53  TaskRan[0] = true;
     54  for ( i=1; i<rtems_smp_get_number_of_processors() ; i++ ) {
     55    TaskRan[i] = false;
     56  }
    5257
    5358  /* Show that the init task is running on this cpu */
     
    6873    );
    6974    status = rtems_task_start( id, Test_task, i );
    70 
    71     Loop();
     75   
     76    /* Allow task to start before starting next task.
     77     * This is necessary on some simulators.
     78     */
     79    while (TaskRan[i] == false)
     80      ;
    7281  }
    7382
     
    8190    &id
    8291  );
    83   TestFinished = false;
    8492  status = rtems_task_start(id,Test_task,rtems_smp_get_number_of_processors());
    8593
    86   /* Wait on the last task to run */
    87   while(!TestFinished)
    88     ;
     94  /* Wait on all tasks to run */
     95  while (1) {
     96    TestFinished = true;
     97    for ( i=1; i < (rtems_smp_get_number_of_processors()+1) ; i++ ) {
     98      if (TaskRan[i] == false)
     99        TestFinished = false;
     100    }
     101    if (TestFinished) {
     102      locked_printf( "*** END OF TEST SMP03 ***\n" );
     103      rtems_test_exit( 0 );
     104    }
     105  }
    89106
    90   /* End the test */
    91   Loop();
    92   locked_printf( "*** END OF TEST SMP03 ***\n" );
    93   Loop();
    94107  rtems_test_exit( 0 );   
    95108}
  • testsuites/smptests/smp03/system.h

    r4f6cc11d r5c283458  
    5151 *  Keep the names and IDs in global variables so another task can use them.
    5252 */
     53
     54TEST_EXTERN volatile bool TaskRan[ CONFIGURE_SMP_MAXIMUM_PROCESSORS + 1 ];
     55
     56/*
     57 *  Keep the names and IDs in global variables so another task can use them.
     58 */
    5359void Loop(void);
    5460void PrintTaskInfo(
  • testsuites/smptests/smp03/tasks.c

    r4f6cc11d r5c283458  
    2626  PrintTaskInfo( task_name );
    2727
    28   /* If this is the last task created set a flag for the
    29    * test to end.
    30    */
    31   if ( task_index  == rtems_smp_get_number_of_processors() ) {
    32     TestFinished = true;
    33   }
     28  TaskRan[task_index] = true;
    3429
    3530  /* Wait for the test to end without giving up this processor */
Note: See TracChangeset for help on using the changeset viewer.