source: rtems/testsuites/sptests/spcbssched03/init.c @ bd1b8de

4.115
Last change on this file since bd1b8de was bd1b8de, checked in by Joel Sherrill <joel.sherrill@…>, on 09/15/11 at 15:56:01

2011-09-15 Petr Benes <benesp16@…>

PR 1907/testing

  • Makefile.am, configure.ac: Add tests for the CBS (Constant Bandwidth Server) scheduler.
  • spcbssched01/.cvsignore, spcbssched01/Makefile.am, spcbssched01/init.c, spcbssched01/spcbssched01.doc, spcbssched01/spcbssched01.scn, spcbssched01/system.h, spcbssched01/task1.c, spcbssched02/.cvsignore, spcbssched02/Makefile.am, spcbssched02/init.c, spcbssched02/spcbssched02.doc, spcbssched02/spcbssched02.scn, spcbssched02/system.h, spcbssched02/task_periodic.c, spcbssched03/.cvsignore, spcbssched03/Makefile.am, spcbssched03/cbsparams.h, spcbssched03/init.c, spcbssched03/spcbssched03.doc, spcbssched03/spcbssched03.scn, spcbssched03/system.h, spcbssched03/tasks_aperiodic.c, spcbssched03/tasks_periodic.c: New files.
  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*  Init
2 *
3 *  This routine is the initialization task for this test program.
4 *  It is a user initialization task and has the responsibility for creating
5 *  and starting the tasks that make up the test.  If the time of day
6 *  clock is required for the test, it should also be set to a known
7 *  value by this function.
8 *
9 *  Input parameters:
10 *    argument - task argument
11 *
12 *  Output parameters:  NONE
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.com/license/LICENSE.
17 *
18 *  $Id$
19 */
20
21#define CONFIGURE_INIT
22#include "system.h"
23
24#include "cbsparams.h"
25
26rtems_task Init(
27  rtems_task_argument argument
28)
29{
30  uint32_t    index;
31  rtems_status_code status;
32
33  puts( "\n\n*** TEST CBS SCHEDULER 3 ***" );
34
35  build_task_name();
36
37  for ( index = 1 ; index <= NUM_TASKS ; index++ ) {
38    status = rtems_task_create(
39      Task_name[ index ],
40      Priorities[ index ],
41      RTEMS_MINIMUM_STACK_SIZE * 4,
42      RTEMS_DEFAULT_MODES,
43      RTEMS_DEFAULT_ATTRIBUTES,
44      &Task_id[ index ]
45    );
46    directive_failed( status, "rtems_task_create loop" );
47  }
48
49  rtems_cbs_initialize();
50
51  for ( index = 1 ; index <= NUM_PERIODIC_TASKS ; index++ ) {
52    status = rtems_task_start( Task_id[ index ], Tasks_Periodic, index );
53    directive_failed( status, "rtems_task_start loop" );
54  }
55
56  for ( index = NUM_PERIODIC_TASKS+1 ; index <= NUM_TASKS ; index++ ) {
57    status = rtems_task_start( Task_id[ index ], Tasks_Aperiodic, index );
58    directive_failed( status, "rtems_task_start loop" );
59  }
60
61  status = rtems_task_delete( RTEMS_SELF );
62  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
63}
Note: See TracBrowser for help on using the repository browser.