コード例 #1
0
ファイル: task1.c プロジェクト: AlexShiLucky/rtems
rtems_task Init(
  rtems_task_argument argument
)
{
  rtems_status_code status;

  Print_Warning();

  TEST_BEGIN();

  status = rtems_task_create(
    1,
    (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u,
    RTEMS_MINIMUM_STACK_SIZE * 2,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &Task_id[ 1 ]
  );
  directive_failed( status, "rtems_task_create" );

  status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
  directive_failed( status, "rtems_task_start" );

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #2
0
ファイル: task1.c プロジェクト: gedare/rtems
void Init(
  rtems_task_argument argument
)
{
  rtems_status_code status;
  rtems_id id;

  Print_Warning();

  TEST_BEGIN();

  status = rtems_task_create(
    1,
    RTEMS_MAXIMUM_PRIORITY - 1u,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &id
  );
  directive_failed( status, "rtems_task_create" );

  status = rtems_task_start( id, test_init, 0 );
  directive_failed( status, "rtems_task_start" );

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #3
0
rtems_task Init(
  rtems_task_argument argument
)
{
  rtems_id          id;
  rtems_status_code status;

  /*
   *  Tell the Timer Driver what we are doing
   */

  benchmark_timer_disable_subtracting_average_overhead( 1 );

  Print_Warning();

  puts( "\n\n*** TIME CHECKER ***" );

  Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ),

  status = rtems_task_create(
    1,
    5,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &id
  );
  directive_failed( status, "rtems_task_create of TA1" );

  status = rtems_task_start( id, Task_1, 0 );
  directive_failed( status, "rtems_task_start of TA1" );

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #4
0
ファイル: testtask.c プロジェクト: Avanznow/rtems
rtems_task Init(
  rtems_task_argument argument
)
{ rtems_id id;
  rtems_status_code status;

  benchmark_timer_disable_subtracting_average_overhead( TRUE );

  Print_Warning();

  TEST_BEGIN();

  status = rtems_task_create(
    rtems_build_name( 'T', 'A', '1', ' ' ),
    RTEMS_MAXIMUM_PRIORITY - 1,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &id
  );
  directive_failed( status, "rtems_task_create of TA1" );

  status = rtems_task_start( id, Task_1, 0 );
  directive_failed( status, "rtems_task_start of TA1" );

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #5
0
rtems_task Init(
  rtems_task_argument argument
)
{
  rtems_id          task_id;
  rtems_status_code status;

  Print_Warning();

  puts( "\n\n*** TIME TEST 12 ***" );

  status = rtems_task_create(
    1,
    RTEMS_MAXIMUM_PRIORITY - 1u,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &task_id
  );
  directive_failed( status, "rtems_task_create" );

  status = rtems_task_start( task_id, test_init, 0 );
  directive_failed( status, "rtems_task_start" );

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #6
0
ファイル: task1.c プロジェクト: AlexShiLucky/rtems
rtems_task Init(
  rtems_task_argument argument
)
{
  rtems_status_code status;
  rtems_id          task_id;

  Print_Warning();

  TEST_BEGIN();
  status = rtems_task_create(
    rtems_build_name( 'T', 'A', '1', ' ' ),
    RTEMS_MAXIMUM_PRIORITY - 1u,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &task_id
  );
  directive_failed( status, "rtems_task_create of test_init" );

  status = rtems_task_start( task_id, test_init, 0 );
  directive_failed( status, "rtems_task_start of test_init" );

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #7
0
rtems_task Init(
    rtems_task_argument argument
)
{
    rtems_status_code status;

    Print_Warning();

    puts( "\n\n*** TIME TEST 28 ***" );

    status = rtems_task_create(
                 rtems_build_name( 'T', 'I', 'M', 'E' ),
                 (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u,
                 RTEMS_MINIMUM_STACK_SIZE,
                 RTEMS_DEFAULT_MODES,
                 RTEMS_DEFAULT_ATTRIBUTES,
                 &Task_id[ 1 ]
             );
    directive_failed( status, "rtems_task_create" );

    status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
    directive_failed( status, "rtems_task_start" );

    status = rtems_task_delete( RTEMS_SELF );
    directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #8
0
ファイル: task1.c プロジェクト: Avanznow/rtems
rtems_task Init(
  rtems_task_argument argument
)
{
  rtems_status_code status;

  Print_Warning();

  TEST_BEGIN();

  if (
    _Scheduler_Table[ 0 ].Operations.initialize
      != _Scheduler_priority_Initialize
  ) {
    puts("  Error ==> " );
    puts("Test only supported for deterministic priority scheduler\n" );
    TEST_END();
    rtems_test_exit( 0 );
  }

#define LOW_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 1u)
  status = rtems_task_create(
    rtems_build_name( 'T', 'A', '1', ' ' ),
    LOW_PRIORITY,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &Task_id[ 1 ]
  );
  directive_failed( status, "rtems_task_create Task_1" );

  status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
  directive_failed( status, "rtems_task_start Task_1" );

  status = rtems_task_create(
    rtems_build_name( 'T', 'A', '2', ' ' ),
    LOW_PRIORITY,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &Task_id[ 2 ]
  );
  directive_failed( status, "rtems_task_create of Task_2" );

  status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
  directive_failed( status, "rtems_task_start of Task_2" );

  benchmark_timer_initialize();
  benchmark_timer_read();
  benchmark_timer_initialize();
  timer_overhead = benchmark_timer_read();

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #9
0
ファイル: mlatency.c プロジェクト: AlexShiLucky/rtems
void Init(
  rtems_task_argument argument
)
{
  rtems_status_code status;

  Print_Warning();

  TEST_BEGIN();

  status = rtems_message_queue_create(
    rtems_build_name( 'M', 'Q', '1', ' '  ),
    1,
    MESSAGE_SIZE,
    RTEMS_DEFAULT_ATTRIBUTES,
    &Queue_id
  );
  directive_failed( status, "rtems_message_queue_create" );

  Task_name[0] = rtems_build_name( 'T','A','0','1' );
  status = rtems_task_create(
    Task_name[0],
    30,               /* TA01 is low priority task */
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &Task_id[0]
  );
  directive_failed( status, "rtems_task_create of TA01");

  Task_name[1] = rtems_build_name( 'T','A','0','2' );
  status = rtems_task_create(
    Task_name[1],
    28,               /* High priority task */
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &Task_id[1]
  );
  directive_failed( status, "rtems_task_create of TA01" );

  benchmark_timer_initialize();
  for ( count = 0; count < BENCHMARKS - 1; count++ ) {
    /* message send/recieve */
  }
  tloop_overhead = benchmark_timer_read();

  status = rtems_task_start( Task_id[0], Task01, 0 );
  directive_failed( status, "rtems_task_start of TA01" );

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #10
0
rtems_task Init(
    rtems_task_argument argument
)
{
    rtems_id          id;
    rtems_status_code status;

    Print_Warning();

    puts( "\n\n*** TIME TEST 22 ***" );

    status = rtems_message_queue_create(
                 rtems_build_name( 'M', 'Q', '1', ' '),
                 100,
                 MESSAGE_SIZE,
                 RTEMS_DEFAULT_ATTRIBUTES,
                 &Queue_id
             );
    directive_failed( status, "rtems_message_queue_create" );

    status = rtems_task_create(
                 rtems_build_name( 'L', 'O', 'W', ' ' ),
                 10,
                 RTEMS_MINIMUM_STACK_SIZE,
                 RTEMS_NO_PREEMPT,
                 RTEMS_DEFAULT_ATTRIBUTES,
                 &id
             );
    directive_failed( status, "rtems_task_create" );

    status = rtems_task_start( id, Low_task, 0 );
    directive_failed( status, "rtems_task_start LOW" );

    status = rtems_task_create(
                 1,
                 11,
                 RTEMS_MINIMUM_STACK_SIZE,
                 RTEMS_DEFAULT_MODES,
                 RTEMS_DEFAULT_ATTRIBUTES,
                 &id
             );
    directive_failed( status, "rtems_task_create RTEMS_PREEMPT" );

    status = rtems_task_start( id, Preempt_task, 0 );
    directive_failed( status, "rtems_task_start RTEMS_PREEMPT" );

    status = rtems_task_delete( RTEMS_SELF );
    directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #11
0
rtems_task Init(
  rtems_task_argument argument
)
{
  rtems_status_code status;

  Print_Warning();

  puts( "\n\n*** TIME TEST 7 ***" );

  test_init();

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #12
0
ファイル: task1.c プロジェクト: Fyleo/rtems
rtems_task Init(
  rtems_task_argument argument
)
{
  rtems_status_code status;

  Print_Warning();

  TEST_BEGIN();

  test_init();

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete" );
}
コード例 #13
0
ファイル: task1.c プロジェクト: AlexShiLucky/rtems
rtems_task Init(
  rtems_task_argument argument
)
{

  rtems_task_priority priority;
  int                 index;
  rtems_id            id;
  rtems_task_entry    task_entry;
  rtems_status_code   status;

  Print_Warning();

  TEST_BEGIN();

  benchmark_timer_initialize();
    for ( index=1 ; index <= OPERATION_COUNT ; index++ )
      (void) benchmark_timer_empty_function();
  overhead = benchmark_timer_read();

  priority = 2;
  if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2 )
    operation_count =  RTEMS_MAXIMUM_PRIORITY - 2;

  for( index=1 ; index <= operation_count ; index++ ) {
    status = rtems_task_create(
      rtems_build_name( 'T', 'I', 'M', 'E' ),
      priority,
      RTEMS_MINIMUM_STACK_SIZE,
      RTEMS_DEFAULT_MODES,
      RTEMS_DEFAULT_ATTRIBUTES,
      &id
    );
    directive_failed( status, "rtems_task_create LOOP" );

    if ( index == 1 )                    task_entry = High_task;
    else if ( index == operation_count ) task_entry = Low_task;
    else                                 task_entry = Middle_tasks;

    status = rtems_task_start( id, task_entry, 0 );
    directive_failed( status, "rtems_task_start LOOP" );

    priority++;
  }

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #14
0
rtems_task Init(
  rtems_task_argument argument
)
{
  rtems_status_code status;

  Print_Warning();

  puts( "\n\n*** TIME TEST 27 ***" );

  status = rtems_task_create(
    rtems_build_name( 'T', 'A', '1', ' ' ),
    254,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &Task_id[ 1 ]
  );
  directive_failed( status, "rtems_task_create Task_1" );

  status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
  directive_failed( status, "rtems_task_start Task_1" );

  status = rtems_task_create(
    rtems_build_name( 'T', 'A', '2', ' ' ),
    254,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &Task_id[ 2 ]
  );
  directive_failed( status, "rtems_task_create of Task_2" );

  status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
  directive_failed( status, "rtems_task_start of Task_2" );

  Timer_initialize();
  Timer_read();
  Timer_initialize();
  timer_overhead = Timer_read();

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #15
0
ファイル: taskpreempt.c プロジェクト: goetzpf/rtems
rtems_task Init( rtems_task_argument ignored )
{
    Print_Warning();

    TEST_BEGIN();

    Task_name[0] = rtems_build_name( 'T','A','0','1' );
    status = rtems_task_create(
                 Task_name[0],
                 30,               /* TA01 is low priority task */
                 RTEMS_MINIMUM_STACK_SIZE,
                 RTEMS_DEFAULT_MODES,
                 RTEMS_DEFAULT_ATTRIBUTES,
                 &Task_id[0]
             );
    directive_failed( status, "rtems_task_create of TA01");

    Task_name[1] = rtems_build_name( 'T','A','0','2' );
    status = rtems_task_create(
                 Task_name[1],
                 28,               /* TA02 is high priority task */
                 RTEMS_MINIMUM_STACK_SIZE,
                 RTEMS_DEFAULT_MODES,
                 RTEMS_DEFAULT_ATTRIBUTES,
                 &Task_id[1]
             );
    directive_failed( status, "rtems_task_create of TA02");

    /* Find loop overhead */
    benchmark_timer_initialize();
    for ( count1 = 0; count1 < ( BENCHMARKS * 2 ) - 1; count1++ );
    {
        /* rtems_task_resume( Task_id[1] ); */
    }
    tloop_overhead = benchmark_timer_read();

    status = rtems_task_start( Task_id[0], Task01, 0 );
    directive_failed( status, "rtems_task_start of TA01");

    status = rtems_task_delete( RTEMS_SELF );
    directive_failed( status, "rtems_task_delete of INIT");
}
コード例 #16
0
ファイル: task1.c プロジェクト: AlexShiLucky/rtems
rtems_task Init(
  rtems_task_argument argument
)
{
  rtems_task_entry  task_entry;
  int               index;
  rtems_status_code status;

  Print_Warning();

  TEST_BEGIN();

  Task_priority = RTEMS_MAXIMUM_PRIORITY - 1u;
  if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u )
    operation_count =  (int) (RTEMS_MAXIMUM_PRIORITY - 2u);

  for( index = 0; index < operation_count ; index++ ) {
    status = rtems_task_create(
      rtems_build_name( 'T', 'I', 'M', 'E' ),
      Task_priority,
      RTEMS_MINIMUM_STACK_SIZE,
      RTEMS_DEFAULT_MODES,
      RTEMS_DEFAULT_ATTRIBUTES,
      &Task_id[ index ]
    );
    directive_failed( status, "rtems_task_create loop" );

    if ( index == operation_count-1 ) task_entry = Last_task;
    else if ( index == 0 )            task_entry = First_task;
    else                              task_entry = Middle_tasks;

    status = rtems_task_start( Task_id[ index ], task_entry, 0 );
    directive_failed( status, "rtems_task_start loop" );
  }

  Task_count = 1;
  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #17
0
rtems_task Init(
  rtems_task_argument argument
)
{
  rtems_id          id;
  uint32_t    index;
  rtems_status_code status;

  Print_Warning();

  puts( "\n\n*** TIME TEST 29 ***" );

  Period_name = rtems_build_name( 'P', 'R', 'D', ' ' );

  benchmark_timer_initialize();
    (void) rtems_rate_monotonic_create( Period_name, &id );
  end_time = benchmark_timer_read();

  put_time(
    "rtems_rate_monotonic_create",
    end_time,
    1,
    0,
    CALLING_OVERHEAD_RATE_MONOTONIC_CREATE
  );

  benchmark_timer_initialize();
    (void) rtems_rate_monotonic_period( id, 10 );
  end_time = benchmark_timer_read();

  put_time(
    "rtems_rate_monotonic_period: initiate period -- returns to caller",
    end_time,
    1,
    0,
    CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD
  );

  benchmark_timer_initialize();
    (void) rtems_rate_monotonic_period( id, RTEMS_PERIOD_STATUS );
  end_time = benchmark_timer_read();

  put_time(
    "rtems_rate_monotonic_period: obtain status",
    end_time,
    1,
    0,
    CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD
  );

  benchmark_timer_initialize();
    (void) rtems_rate_monotonic_cancel( id );
  end_time = benchmark_timer_read();

  put_time(
    "rtems_rate_monotonic_cancel",
    end_time,
    1,
    0,
    CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL
  );

  benchmark_timer_initialize();
    (void) rtems_rate_monotonic_delete( id );
  end_time = benchmark_timer_read();

  put_time(
    "rtems_rate_monotonic_delete: inactive",
    end_time,
    1,
    0,
    CALLING_OVERHEAD_RATE_MONOTONIC_DELETE
  );

  status = rtems_rate_monotonic_create( Period_name, &id );
  directive_failed( status, "rtems_rate_monotonic_create" );

  status = rtems_rate_monotonic_period( id, 10 );
  directive_failed( status, "rtems_rate_monotonic_period" );

  benchmark_timer_initialize();
    rtems_rate_monotonic_delete( id );
  end_time = benchmark_timer_read();

  put_time(
    "rtems_rate_monotonic_delete: active",
    end_time,
    1,
    0,
    CALLING_OVERHEAD_RATE_MONOTONIC_DELETE
  );

#define LOOP_TASK_PRIORITY ((RTEMS_MAXIMUM_PRIORITY / 2u) + 1u)
  for ( index=1 ; index <= OPERATION_COUNT ; index++ ) {
    status = rtems_task_create(
      rtems_build_name( 'T', 'E', 'S', 'T' ),
      LOOP_TASK_PRIORITY,
      RTEMS_MINIMUM_STACK_SIZE,
      RTEMS_DEFAULT_MODES,
      RTEMS_DEFAULT_ATTRIBUTES,
      &id
    );
    directive_failed( status, "rtems_task_create LOOP" );

    status = rtems_task_start( id, Tasks, 0 );
    directive_failed( status, "rtems_task_start LOOP" );
  }

#define MIDDLE_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 2u)
  status = rtems_task_create(
    rtems_build_name( 'L', 'O', 'W', ' ' ),
    MIDDLE_PRIORITY,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &id
  );
  directive_failed( status, "rtems_task_create LOW" );

  status = rtems_task_start( id, Low_task, 0 );
  directive_failed( status, "rtems_task_start LOW" );

  Task_count = 0;

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #18
0
ファイル: task1.c プロジェクト: greenmeent/rtems
rtems_task Init(
  rtems_task_argument argument
)
{
  uint32_t    index;
  rtems_id          task_id;
  rtems_status_code status;

  Print_Warning();

  TEST_BEGIN();

  if (
    _Scheduler_Table[ 0 ].Operations.initialize
      != _Scheduler_priority_Initialize
  ) {
    puts("  Error ==> " );
    puts("Test only supported for deterministic priority scheduler\n" );
    TEST_END();
    rtems_test_exit( 0 );
  }

#define FP1_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 3u)      /* 201, */
  status = rtems_task_create(
    rtems_build_name( 'F', 'P', '1', ' ' ),
    FP1_PRIORITY,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_FLOATING_POINT,
    &task_id
  );
  directive_failed( status, "rtems_task_create of FP1" );

  status = rtems_task_start( task_id, Floating_point_task_1, 0 );
  directive_failed( status, "rtems_task_start of FP1" );

#define FP2_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 2u)      /* 202, */
  status = rtems_task_create(
    rtems_build_name( 'F', 'P', '2', ' ' ),
    FP2_PRIORITY,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_FLOATING_POINT,
    &task_id
  );
  directive_failed( status, "rtems_task_create of FP2" );

  status = rtems_task_start( task_id, Floating_point_task_2, 0 );
  directive_failed( status, "rtems_task_start of FP2" );

#define LOW_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 4u)   /*  200, */
  status = rtems_task_create(
    rtems_build_name( 'L', 'O', 'W', ' ' ),
    LOW_PRIORITY,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &task_id
  );
  directive_failed( status, "rtems_task_create of LOW" );

  status = rtems_task_start( task_id, Low_task, 0 );
  directive_failed( status, "rtems_task_start of LOW" );

#define MIDDLE_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 5u)   /*  128, */
  status = rtems_task_create(
    rtems_build_name( 'M', 'I', 'D', ' ' ),
    MIDDLE_PRIORITY,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &task_id
  );
  directive_failed( status, "rtems_task_create of MIDDLE" );

  status = rtems_task_start( task_id, Middle_task, 0 );
  directive_failed( status, "rtems_task_start of MIDDLE" );

  status = rtems_task_create(
    rtems_build_name( 'H', 'I', 'G', 'H' ),
    5,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &task_id
  );
  directive_failed( status, "rtems_task_create of HIGH" );

  status = rtems_task_start( task_id, High_task, 0 );
  directive_failed( status, "rtems_task_start of HIGH" );

  status = rtems_semaphore_create(
    rtems_build_name( 'S', 'E', 'M', '1' ),
    OPERATION_COUNT,
    RTEMS_DEFAULT_ATTRIBUTES,
    RTEMS_NO_PRIORITY,
    &Semaphore_id
  );
  directive_failed( status, "rtems_semaphore_create" );

  for ( index = 1 ; index <= OPERATION_COUNT ; index++ ) {
    status = rtems_task_create(
      rtems_build_name( 'N', 'U', 'L', 'L' ),
      RTEMS_MAXIMUM_PRIORITY - 1u,      /* 254, */
      RTEMS_MINIMUM_STACK_SIZE,
      RTEMS_DEFAULT_MODES,
      RTEMS_DEFAULT_ATTRIBUTES,
      &task_id
    );
    directive_failed( status, "rtems_task_create LOOP" );

    status = rtems_task_start( task_id, null_task, 0 );
    directive_failed( status, "rtems_task_start LOOP" );
  }

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #19
0
rtems_task Init(
  rtems_task_argument argument
)
{
  uint32_t    index;
  rtems_id          task_id;
  rtems_status_code status;

  Print_Warning();

  puts( "\n\n*** TIME TEST 26 ***" );

#define FP1_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 3u)      /* 201, */
  status = rtems_task_create(
    rtems_build_name( 'F', 'P', '1', ' ' ),
    FP1_PRIORITY,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_FLOATING_POINT,
    &task_id
  );
  directive_failed( status, "rtems_task_create of FP1" );

  status = rtems_task_start( task_id, Floating_point_task_1, 0 );
  directive_failed( status, "rtems_task_start of FP1" );

#define FP2_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 2u)      /* 202, */
  status = rtems_task_create(
    rtems_build_name( 'F', 'P', '2', ' ' ),
    FP2_PRIORITY,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_FLOATING_POINT,
    &task_id
  );
  directive_failed( status, "rtems_task_create of FP2" );

  status = rtems_task_start( task_id, Floating_point_task_2, 0 );
  directive_failed( status, "rtems_task_start of FP2" );

#define LOW_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 4u)   /*  200, */
  status = rtems_task_create(
    rtems_build_name( 'L', 'O', 'W', ' ' ),
    LOW_PRIORITY,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &task_id
  );
  directive_failed( status, "rtems_task_create of LOW" );

  status = rtems_task_start( task_id, Low_task, 0 );
  directive_failed( status, "rtems_task_start of LOW" );

#define MIDDLE_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 5u)   /*  128, */
  status = rtems_task_create(
    rtems_build_name( 'M', 'I', 'D', ' ' ),
    MIDDLE_PRIORITY,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &task_id
  );
  directive_failed( status, "rtems_task_create of MIDDLE" );

  status = rtems_task_start( task_id, Middle_task, 0 );
  directive_failed( status, "rtems_task_start of MIDDLE" );

  status = rtems_task_create(
    rtems_build_name( 'H', 'I', 'G', 'H' ),
    5,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &task_id
  );
  directive_failed( status, "rtems_task_create of HIGH" );

  status = rtems_task_start( task_id, High_task, 0 );
  directive_failed( status, "rtems_task_start of HIGH" );

  status = rtems_semaphore_create(
    rtems_build_name( 'S', 'E', 'M', '1' ),
    OPERATION_COUNT,
    RTEMS_DEFAULT_ATTRIBUTES,
    RTEMS_NO_PRIORITY,
    &Semaphore_id
  );
  directive_failed( status, "rtems_semaphore_create" );

  for ( index = 1 ; index <= OPERATION_COUNT ; index++ ) {
    status = rtems_task_create(
      rtems_build_name( 'N', 'U', 'L', 'L' ),
      RTEMS_MAXIMUM_PRIORITY - 1u,      /* 254, */
      RTEMS_MINIMUM_STACK_SIZE,
      RTEMS_DEFAULT_MODES,
      RTEMS_DEFAULT_ATTRIBUTES,
      &task_id
    );
    directive_failed( status, "rtems_task_create LOOP" );

    status = rtems_task_start( task_id, null_task, 0 );
    directive_failed( status, "rtems_task_start LOOP" );
  }

  status = rtems_task_delete( RTEMS_SELF );
  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
コード例 #20
0
ファイル: semshuffle.c プロジェクト: AlexShiLucky/rtems
rtems_task Init( rtems_task_argument ignored )
{
  rtems_status_code    status;
  rtems_attribute      sem_attr;
  rtems_task_priority  pri;
  rtems_mode           prev_mode;

  Print_Warning();

  TEST_BEGIN();

  sem_attr =  RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY;

  sem_name = rtems_build_name( 'S','0',' ',' ' );
  status = rtems_semaphore_create(
    sem_name,
    1,
    sem_attr,
    0,
    &sem_id
  );
  directive_failed( status, "rtems_semaphore_create of S0" );

  Task_name[0] = rtems_build_name( 'T','A','0','1' );
  status = rtems_task_create(
    Task_name[0],
    30,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &Task_id[0]
  );
  directive_failed( status, "rtems_task_create of TA01" );

  Task_name[1] = rtems_build_name( 'T','A','0','2' );
  status = rtems_task_create(
    Task_name[1],
    30,
    RTEMS_MINIMUM_STACK_SIZE,
    RTEMS_DEFAULT_MODES,
    RTEMS_DEFAULT_ATTRIBUTES,
    &Task_id[1]
  );
  directive_failed( status , "rtems_task_create of TA02\n" );

  rtems_task_mode( RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &prev_mode );
  /* Lower own priority so TA01 can start up and run */
  rtems_task_set_priority( RTEMS_SELF, 40, &pri);

  /* Get time of benchmark with no semaphore shuffling */
  sem_exe = 0;
  status = rtems_task_start( Task_id[0], Task01, 0 );
  directive_failed( status, "rtems_task_start of TA01" );

  /* Get time of benchmark with semaphore shuffling */
  sem_exe = 1;
  status = rtems_task_restart( Task_id[0], 0 );
  directive_failed( status, "rtems_task_restart of TA01" );

  /* Should never reach here */
  rtems_test_assert( false );
}