Changeset cf288c38 in rtems


Ignore:
Timestamp:
Jul 29, 2011, 12:29:34 PM (10 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.11, 5, master
Children:
d4a0934
Parents:
602b1f61
Message:

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

  • 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 some print statement problems.
  • smp04/tasks.c: Removed.
Location:
testsuites/smptests
Files:
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • testsuites/smptests/ChangeLog

    r602b1f61 rcf288c38  
     12011-07-29      Jennifer Averett <Jennifer.Averett@OARcorp.com>
     2
     3        * smp01/init.c, smp02/init.c, smp02/tasks.c, smp03/init.c,
     4        smp03/tasks.c, smp04/Makefile.am, smp04/init.c, smp05/init.c,
     5        smp06/init.c, smp07/init.c, smp08/init.c: Cleaned up tests and fixed
     6        some print statement problems.
     7        * smp04/tasks.c: Removed.
     8
    192011-06-29      Joel Sherrill <joel.sherrill@oarcorp.com>
    210
  • testsuites/smptests/smp01/init.c

    r602b1f61 rcf288c38  
    6464
    6565    cpu_num = bsp_smp_processor_id();
    66     (" CPU %d start task TA%c\n", cpu_num, ch);
     66    locked_printf(" CPU %d start task TA%c\n", cpu_num, ch);
    6767    status = rtems_task_start( id, Test_task, i+1 );
    6868    directive_failed( status, "task start" );
     
    7979    }
    8080    if (allDone) {
    81       Loop();
    82       locked_printf( "*** END OF TEST SMP01 ***" );
     81      locked_printf( "*** END OF TEST SMP01 ***\n" );
    8382      rtems_test_exit( 0 );
    8483    }
  • testsuites/smptests/smp02/init.c

    r602b1f61 rcf288c38  
    4848  directive_failed( status,"rtems_semaphore_obtain of SEM1\n");
    4949
    50   for ( i=1; i < CONFIGURE_SMP_MAXIMUM_PROCESSORS; i++ ){
     50  for ( i=1; i < rtems_smp_get_number_of_processors(); i++ ){
    5151
    5252    /* Create and start tasks for each CPU */
     
    6565    locked_printf(" CPU %d start task TA%c\n", cpu_num, ch);
    6666    status = rtems_task_start( id, Test_task, i+1 );
    67     locked_printf(str, "rtems_task_start TA%d", i+1);
    6867    directive_failed( status, str );
    6968  }
  • testsuites/smptests/smp02/tasks.c

    r602b1f61 rcf288c38  
    1616#include "system.h"
    1717
    18 void Loop() {
     18void Loop(void) {
    1919  volatile int i;
    2020
     
    2727  uint32_t  task_index
    2828){
    29   int i;
    30 
    3129  if (Log_index < LOG_SIZE) {
    3230    /* Log the information */
     
    5856 
    5957    rtems_semaphore_release( Semaphore );
    60   }
    61 
    62   while(1);
     58  } while(1);
    6359}
  • testsuites/smptests/smp03/init.c

    r602b1f61 rcf288c38  
    3030{
    3131  int               cpu_num;
    32   rtems_status_code sc;
    3332
    3433  cpu_num = bsp_smp_processor_id();
     
    4241{
    4342  int               i;
    44   char              ch;
     43  char              ch = '0';
    4544  rtems_id          id;
    4645  rtems_status_code status;
     
    4948  locked_print_initialize();
    5049
    51   locked_printf( "\n\n***  SMP03 TEST ***" );
     50  locked_printf( "\n\n***  SMP03 TEST ***\n" );
    5251
    5352
     
    5655
    5756  /* for each remaining cpu create and start a task */
    58   for ( i=1; i < CONFIGURE_SMP_MAXIMUM_PROCESSORS; i++ ){
     57  for ( i=1; i < rtems_smp_get_number_of_processors(); i++ ){
    5958
    6059    ch = '0' + i;
     
    8382  );
    8483  TestFinished = false;
    85   status = rtems_task_start( id, Test_task, CONFIGURE_SMP_MAXIMUM_PROCESSORS );
     84  status = rtems_task_start(id,Test_task,rtems_smp_get_number_of_processors());
    8685
    8786  /* Wait on the last task to run */
     
    9089
    9190  /* End the test */
    92   locked_printf( "*** END OF TEST SMP03 ***" );
     91  Loop();
     92  locked_printf( "*** END OF TEST SMP03 ***\n" );
     93  Loop();
    9394  rtems_test_exit( 0 );   
    9495}
  • testsuites/smptests/smp03/tasks.c

    r602b1f61 rcf288c38  
    2929   * test to end.
    3030   */
    31   if ( task_index  == CONFIGURE_SMP_MAXIMUM_PROCESSORS ) {
     31  if ( task_index  == rtems_smp_get_number_of_processors() ) {
    3232    TestFinished = true;
    3333  }
  • testsuites/smptests/smp04/Makefile.am

    r602b1f61 rcf288c38  
    66
    77rtems_tests_PROGRAMS = smp04
    8 smp04_SOURCES = init.c tasks.c system.h ../../support/src/locked_print.c
     8smp04_SOURCES = init.c system.h ../../support/src/locked_print.c
    99
    1010dist_rtems_tests_DATA = smp04.scn
  • testsuites/smptests/smp04/init.c

    r602b1f61 rcf288c38  
    2626}
    2727
    28 void PrintTaskInfo(
    29   const char *task_name
     28rtems_task Test_task(
     29  rtems_task_argument task_index
    3030)
    3131{
     
    3333
    3434  cpu_num = bsp_smp_processor_id();
     35  locked_printf("  CPU %d running task TA%" PRIu32 "\n", cpu_num, task_index );
     36  Loop();
     37  TaskRan[task_index] = true;
    3538
    36   locked_printf("  CPU %d running task %s\n", cpu_num, task_name );
     39  while(1);
    3740}
    3841
     
    4649  rtems_status_code status;
    4750  bool              allDone;
     51  int               cpu_num;
    4852
    4953  Loop();
     
    5155  locked_printf( "\n\n***  SMP04 TEST ***\n" );
    5256
    53   PrintTaskInfo( "Init" );
     57  /* Display which cpu is running this init thread. */
     58  cpu_num = bsp_smp_processor_id();
     59  locked_printf("  CPU %d running task Init\n", cpu_num );
    5460
     61  /* Set all Tasks to not ran except for the init task */
    5562  TaskRan[0] = true;
    5663  for ( i=1; i <= rtems_smp_get_number_of_processors() ; i++ )
    5764    TaskRan[i] = false;
    5865 
     66
     67  /*
     68   * For each processor create and start a task alternating
     69   * between  RTEMS_PREEMPT and RTEMS_NO_PREEMPT.
     70   */
    5971  for ( i=1; i < rtems_smp_get_number_of_processors() ; i++ ){
    6072
     
    7688      &id
    7789    );
    78   }
    7990
    80   for ( i=1; i < rtems_smp_get_number_of_processors() ; i++ ){
     91    locked_printf(
     92      "Start TA%c a %s task\n",
     93      ch,
     94      ((i%2) ? "RTEMS_PREEMPT" : "RTEMS_NO_PREEMPT" )
     95    );
    8196    status = rtems_task_start( id, Test_task, i );
    8297
    83     /* Force a wait on the task to run in order to synchronize on
     98    /*
     99     * Force a wait on the task to run in order to synchronize on
    84100     * simulated systems.
    85101     */   
     
    88104  }
    89105
     106  /*
     107   * Create and start one more task.  This task
     108   * should preempt the longest running PREEMPTABLE
     109   * task and run on that cpu.
     110   */
    90111  ch = '0' + rtems_smp_get_number_of_processors() ;
    91 
     112  locked_printf(
     113    "Create a TA%c a %s task\n",
     114    ch,
     115    "RTEMS_PREEMPT" 
     116  );
    92117  status = rtems_task_create(
    93118    rtems_build_name( 'T', 'A', ch, ' ' ),
     
    98123    &id
    99124  );
     125  locked_printf(
     126    "Start TA%c a %s task\n",
     127    ch,
     128    "RTEMS_PREEMPT"
     129  );
    100130  status = rtems_task_start(
    101131    id,
     
    104134  );
    105135 
    106   /* Wait on the all tasks to run */
     136  /*
     137   * Wait on the all tasks to run
     138   */
    107139  while (1) {
    108140    allDone = true;
     
    113145    if (allDone) {
    114146      Loop();
    115       locked_printf( "*** END OF TEST SMP04 ***" );
     147      locked_printf( "*** END OF TEST SMP04 ***\n" );
    116148      rtems_test_exit( 0 );
    117149    }
  • testsuites/smptests/smp05/init.c

    r602b1f61 rcf288c38  
    1818{
    1919  locked_printf( "Shut down from CPU %d\n", bsp_smp_processor_id() );
    20   locked_printf( "*** END OF TEST SMP05 ***" );
     20  locked_printf( "*** END OF TEST SMP05 ***\n" );
    2121  rtems_test_exit(0);
    2222}
  • testsuites/smptests/smp06/init.c

    r602b1f61 rcf288c38  
    3232
    3333  if ( do_exit ) {
    34     locked_printf( "*** END OF TEST SMP06 ***" );
     34    locked_printf( "*** END OF TEST SMP06 ***\n" );
    3535    rtems_test_exit(0);
    3636  }
     
    4343)
    4444{
    45   int                i;
    46   char               ch;
    4745  int                cpu_num;
    4846  rtems_id           id;
     
    116114
    117115#define CONFIGURE_INIT_TASK_PRIORITY      2
    118 #define CONFIGURE_INIT_TASK_MODES        RTEMS_PREEMPT
     116#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_PREEMPT
    119117#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    120118
  • testsuites/smptests/smp07/init.c

    r602b1f61 rcf288c38  
    4545
    4646  /* Print that the task is up and running. */
    47   locked_printf(" CPU %d running Task %s after semaphore release\n", cpu_num, name);
     47  locked_printf(
     48    " CPU %d running Task %s after semaphore release\n",
     49    cpu_num,
     50    name
     51  );
    4852
    4953  (void) rtems_task_delete( RTEMS_SELF );
  • testsuites/smptests/smp08/init.c

    r602b1f61 rcf288c38  
    2323{
    2424  int               cpu_num;
    25   rtems_status_code sc;
    2625
    2726  cpu_num = bsp_smp_processor_id();
     
    4645  rtems_time_of_day time;
    4746  int               i;
    48   char              ch;
     47  char              ch[4];
    4948  rtems_id          id;
    5049 
     
    7877
    7978  for ( i=1; i <= rtems_smp_get_number_of_processors() *3; i++ ) {
    80     ch = '0' + i;
    8179
     80    sprintf(ch, "%02" PRId32, i );
    8281    status = rtems_task_create(
    83       rtems_build_name( 'T', 'A', ch, ' ' ),
     82      rtems_build_name( 'T', 'A', ch[0], ch[1] ),
    8483      1,
    8584      RTEMS_MINIMUM_STACK_SIZE,
Note: See TracChangeset for help on using the changeset viewer.