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 | * COPYRIGHT (c) 1989-1997. |
---|
15 | * On-Line Applications Research Corporation (OAR). |
---|
16 | * Copyright assigned to U.S. Government, 1994. |
---|
17 | * |
---|
18 | * The license and distribution terms for this file may in |
---|
19 | * the file LICENSE in this distribution or at |
---|
20 | * http://www.OARcorp.com/rtems/license.html. |
---|
21 | * |
---|
22 | * $Id$ |
---|
23 | */ |
---|
24 | |
---|
25 | #define TEST_INIT |
---|
26 | #include "system.h" |
---|
27 | |
---|
28 | rtems_task Init( |
---|
29 | rtems_task_argument argument |
---|
30 | ) |
---|
31 | { |
---|
32 | rtems_time_of_day time; |
---|
33 | rtems_status_code status; |
---|
34 | |
---|
35 | puts( "\n\n*** MALLOC TEST ***" ); |
---|
36 | |
---|
37 | build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); |
---|
38 | status = rtems_clock_set( &time ); |
---|
39 | directive_failed( status, "rtems_clock_set" ); |
---|
40 | |
---|
41 | Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); |
---|
42 | Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); |
---|
43 | Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' ); |
---|
44 | Task_name[ 4 ] = rtems_build_name( 'T', 'A', '4', ' ' ); |
---|
45 | Task_name[ 5 ] = rtems_build_name( 'T', 'A', '5', ' ' ); |
---|
46 | |
---|
47 | status = rtems_task_create( |
---|
48 | Task_name[ 1 ], |
---|
49 | 1, |
---|
50 | TASK_STACK_SIZE, |
---|
51 | RTEMS_DEFAULT_MODES, |
---|
52 | RTEMS_DEFAULT_ATTRIBUTES, |
---|
53 | &Task_id[ 1 ] |
---|
54 | ); |
---|
55 | directive_failed( status, "rtems_task_create of TA1" ); |
---|
56 | |
---|
57 | status = rtems_task_create( |
---|
58 | Task_name[ 2 ], |
---|
59 | 1, |
---|
60 | TASK_STACK_SIZE, |
---|
61 | RTEMS_DEFAULT_MODES, |
---|
62 | RTEMS_DEFAULT_ATTRIBUTES, |
---|
63 | &Task_id[ 2 ] |
---|
64 | ); |
---|
65 | directive_failed( status, "rtems_task_create of TA2" ); |
---|
66 | |
---|
67 | status = rtems_task_create( |
---|
68 | Task_name[ 3 ], |
---|
69 | 1, |
---|
70 | TASK_STACK_SIZE, |
---|
71 | RTEMS_DEFAULT_MODES, |
---|
72 | RTEMS_DEFAULT_ATTRIBUTES, |
---|
73 | &Task_id[ 3 ] |
---|
74 | ); |
---|
75 | directive_failed( status, "rtems_task_create of TA3" ); |
---|
76 | |
---|
77 | status = rtems_task_create( |
---|
78 | Task_name[ 4 ], |
---|
79 | 1, |
---|
80 | TASK_STACK_SIZE, |
---|
81 | RTEMS_DEFAULT_MODES, |
---|
82 | RTEMS_DEFAULT_ATTRIBUTES, |
---|
83 | &Task_id[ 4 ] |
---|
84 | ); |
---|
85 | directive_failed( status, "rtems_task_create of TA4" ); |
---|
86 | |
---|
87 | status = rtems_task_create( |
---|
88 | Task_name[ 5 ], |
---|
89 | 1, |
---|
90 | TASK_STACK_SIZE, |
---|
91 | RTEMS_DEFAULT_MODES, |
---|
92 | RTEMS_DEFAULT_ATTRIBUTES, |
---|
93 | &Task_id[ 5 ] |
---|
94 | ); |
---|
95 | directive_failed( status, "rtems_task_create of TA5" ); |
---|
96 | |
---|
97 | status = rtems_task_start( Task_id[ 1 ], Task_1_through_5, 0 ); |
---|
98 | directive_failed( status, "rtems_task_start of TA1" ); |
---|
99 | |
---|
100 | status = rtems_task_start( Task_id[ 2 ], Task_1_through_5, 0 ); |
---|
101 | directive_failed( status, "rtems_task_start of TA2" ); |
---|
102 | |
---|
103 | status = rtems_task_start( Task_id[ 3 ], Task_1_through_5, 0 ); |
---|
104 | directive_failed( status, "rtems_task_start of TA3" ); |
---|
105 | |
---|
106 | status = rtems_task_start( Task_id[ 4 ], Task_1_through_5, 0 ); |
---|
107 | directive_failed( status, "rtems_task_start of TA4" ); |
---|
108 | |
---|
109 | status = rtems_task_start( Task_id[ 5 ], Task_1_through_5, 0 ); |
---|
110 | directive_failed( status, "rtems_task_start of TA5" ); |
---|
111 | |
---|
112 | status = rtems_task_delete( RTEMS_SELF ); |
---|
113 | directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); |
---|
114 | } |
---|