Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:46

0001 /*  Init
0002  *
0003  *  This routine is the initialization task for this test program.
0004  *  It is a user initialization task and has the responsibility for creating
0005  *  and starting the tasks that make up the test.  If the time of day
0006  *  clock is required for the test, it should also be set to a known
0007  *  value by this function.
0008  *
0009  *  Input parameters:
0010  *    argument - task argument
0011  *
0012  *  Output parameters:  NONE
0013  *
0014  *  The license and distribution terms for this file may be
0015  *  found in the file LICENSE in this distribution or at
0016  *  http://www.rtems.org/license/LICENSE.
0017  */
0018 
0019 #ifdef HAVE_CONFIG_H
0020 #include "config.h"
0021 #endif
0022 
0023 #define CONFIGURE_INIT
0024 #include "system.h"
0025 
0026 #include "cbsparams.h"
0027 
0028 const char rtems_test_name[] = "SPCBSSCHED 3";
0029 
0030 rtems_task Init(
0031   rtems_task_argument argument
0032 )
0033 {
0034   uint32_t    index;
0035   rtems_status_code status;
0036 
0037   TEST_BEGIN();
0038 
0039   build_task_name();
0040 
0041   for ( index = 1 ; index <= NUM_TASKS ; index++ ) {
0042     status = rtems_task_create(
0043       Task_name[ index ],
0044       Priorities[ index ],
0045       RTEMS_MINIMUM_STACK_SIZE * 4,
0046       RTEMS_DEFAULT_MODES,
0047       RTEMS_DEFAULT_ATTRIBUTES,
0048       &Task_id[ index ]
0049     );
0050     directive_failed( status, "rtems_task_create loop" );
0051   }
0052 
0053   rtems_cbs_initialize();
0054 
0055   for ( index = 1 ; index <= NUM_PERIODIC_TASKS ; index++ ) {
0056     status = rtems_task_start( Task_id[ index ], Tasks_Periodic, index );
0057     directive_failed( status, "rtems_task_start loop" );
0058   }
0059 
0060   for ( index = NUM_PERIODIC_TASKS+1 ; index <= NUM_TASKS ; index++ ) {
0061     status = rtems_task_start( Task_id[ index ], Tasks_Aperiodic, index );
0062     directive_failed( status, "rtems_task_start loop" );
0063   }
0064 
0065   rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
0066 
0067   rtems_task_exit();
0068 }