Changeset b734b9e8 in rtems


Ignore:
Timestamp:
May 21, 2013, 2:42:12 PM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
10fd9533
Parents:
db0cede1
git-author:
Sebastian Huber <sebastian.huber@…> (05/21/13 14:42:12)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/27/13 10:49:14)
Message:

smptests/smp01: Do not assume CPU 0 runs Init

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/smptests/smp01/init.c

    rdb0cede1 rb734b9e8  
    2727  int                i;
    2828  char               ch;
    29   int                cpu_num;
     29  int                cpu_self;
    3030  rtems_id           id;
    3131  rtems_status_code  status;
    3232  bool               allDone;
     33
     34  cpu_self = bsp_smp_processor_id();
    3335
    3436  /* XXX - Delay a bit to allow debug messages from
     
    4850
    4951  /* Create and start tasks for each processor */
    50   for ( i=1; i< rtems_smp_get_number_of_processors() ; i++ ) {
    51     ch = '0' + i;
     52  for ( i=0; i< rtems_smp_get_number_of_processors() ; i++ ) {
     53    if ( i != cpu_self ) {
     54      ch = '0' + i;
    5255
    53     status = rtems_task_create(
    54       rtems_build_name( 'T', 'A', ch, ' ' ),
    55       1,
    56       RTEMS_MINIMUM_STACK_SIZE,
    57       RTEMS_DEFAULT_MODES,
    58       RTEMS_DEFAULT_ATTRIBUTES,
    59       &id
    60     );
    61     directive_failed( status, "task create" );
     56      status = rtems_task_create(
     57        rtems_build_name( 'T', 'A', ch, ' ' ),
     58        1,
     59        RTEMS_MINIMUM_STACK_SIZE,
     60        RTEMS_DEFAULT_MODES,
     61        RTEMS_DEFAULT_ATTRIBUTES,
     62        &id
     63      );
     64      directive_failed( status, "task create" );
    6265
    63     cpu_num = bsp_smp_processor_id();
    64     locked_printf(" CPU %d start task TA%c\n", cpu_num, ch);
    65     status = rtems_task_start( id, Test_task, i+1 );
    66     directive_failed( status, "task start" );
     66      locked_printf(" CPU %d start task TA%c\n", cpu_self, ch);
     67      status = rtems_task_start( id, Test_task, i+1 );
     68      directive_failed( status, "task start" );
    6769
    68     Loop();
     70      Loop();
     71    }
    6972  }
    7073 
     
    7275  while (1) {
    7376    allDone = true;
    74     for ( i=1; i<rtems_smp_get_number_of_processors() ; i++ ) {
    75       if (TaskRan[i] == false)
     77    for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) {
     78      if ( i != cpu_self && TaskRan[i] == false)
    7679        allDone = false;
    7780    }
Note: See TracChangeset for help on using the changeset viewer.