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 | |
---|
19 | #ifdef HAVE_CONFIG_H |
---|
20 | #include "config.h" |
---|
21 | #endif |
---|
22 | |
---|
23 | #define CONFIGURE_INIT |
---|
24 | #include "system.h" |
---|
25 | |
---|
26 | #include "edfparams.h" |
---|
27 | |
---|
28 | rtems_task Init( |
---|
29 | rtems_task_argument argument |
---|
30 | ) |
---|
31 | { |
---|
32 | uint32_t index; |
---|
33 | rtems_status_code status; |
---|
34 | |
---|
35 | puts( "\n\n*** TEST EDF SCHEDULER 3 ***" ); |
---|
36 | |
---|
37 | build_task_name(); |
---|
38 | |
---|
39 | for ( index = 1 ; index <= NUM_TASKS ; index++ ) { |
---|
40 | status = rtems_task_create( |
---|
41 | Task_name[ index ], |
---|
42 | Priorities[ index ], |
---|
43 | RTEMS_MINIMUM_STACK_SIZE * 4, |
---|
44 | RTEMS_DEFAULT_MODES, |
---|
45 | RTEMS_DEFAULT_ATTRIBUTES, |
---|
46 | &Task_id[ index ] |
---|
47 | ); |
---|
48 | directive_failed( status, "rtems_task_create loop" ); |
---|
49 | } |
---|
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 | rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); |
---|
62 | |
---|
63 | status = rtems_task_delete( RTEMS_SELF ); |
---|
64 | directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); |
---|
65 | } |
---|