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-1999. |
---|
15 | * On-Line Applications Research Corporation (OAR). |
---|
16 | * |
---|
17 | * The license and distribution terms for this file may be |
---|
18 | * found in the file LICENSE in this distribution or at |
---|
19 | * http://www.rtems.org/license/LICENSE. |
---|
20 | */ |
---|
21 | |
---|
22 | #ifdef HAVE_CONFIG_H |
---|
23 | #include "config.h" |
---|
24 | #endif |
---|
25 | |
---|
26 | #define CONFIGURE_INIT |
---|
27 | #include "system.h" |
---|
28 | |
---|
29 | const char rtems_test_name[] = "SP 19"; |
---|
30 | |
---|
31 | rtems_task Init( |
---|
32 | rtems_task_argument argument |
---|
33 | ) |
---|
34 | { |
---|
35 | rtems_status_code status; |
---|
36 | |
---|
37 | rtems_print_printer_fprintf_putc(&rtems_test_printer); |
---|
38 | TEST_BEGIN(); |
---|
39 | |
---|
40 | Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); |
---|
41 | Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); |
---|
42 | Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' ); |
---|
43 | Task_name[ 4 ] = rtems_build_name( 'T', 'A', '4', ' ' ); |
---|
44 | Task_name[ 5 ] = rtems_build_name( 'T', 'A', '5', ' ' ); |
---|
45 | Task_name[ 6 ] = rtems_build_name( 'F', 'P', '1', ' ' ); |
---|
46 | |
---|
47 | status = rtems_task_create( |
---|
48 | Task_name[ 1 ], |
---|
49 | 2, |
---|
50 | RTEMS_MINIMUM_STACK_SIZE * 4, |
---|
51 | RTEMS_DEFAULT_MODES, |
---|
52 | RTEMS_FLOATING_POINT, |
---|
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 | 2, |
---|
60 | RTEMS_MINIMUM_STACK_SIZE * 4, |
---|
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 | 2, |
---|
70 | RTEMS_MINIMUM_STACK_SIZE * 4, |
---|
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 | 2, |
---|
80 | RTEMS_MINIMUM_STACK_SIZE * 4, |
---|
81 | RTEMS_DEFAULT_MODES, |
---|
82 | RTEMS_FLOATING_POINT, |
---|
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 | 2, |
---|
90 | RTEMS_MINIMUM_STACK_SIZE * 4, |
---|
91 | RTEMS_DEFAULT_MODES, |
---|
92 | RTEMS_FLOATING_POINT, |
---|
93 | &Task_id[ 5 ] |
---|
94 | ); |
---|
95 | directive_failed( status, "rtems_task_create of TA5" ); |
---|
96 | |
---|
97 | status = rtems_task_create( |
---|
98 | Task_name[ 6 ], |
---|
99 | 1, |
---|
100 | RTEMS_MINIMUM_STACK_SIZE * 4, |
---|
101 | RTEMS_DEFAULT_MODES, |
---|
102 | RTEMS_FLOATING_POINT, |
---|
103 | &Task_id[ 6 ] |
---|
104 | ); |
---|
105 | directive_failed( status, "rtems_task_create of FP1" ); |
---|
106 | |
---|
107 | status = rtems_task_start( Task_id[ 6 ], First_FP_task, 0 ); |
---|
108 | directive_failed( status, "rtems_task_start of FP1" ); |
---|
109 | |
---|
110 | status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); |
---|
111 | directive_failed( status, "rtems_task_start of TA1" ); |
---|
112 | |
---|
113 | status = rtems_task_start( Task_id[ 2 ], Task_1, 0 ); |
---|
114 | directive_failed( status, "rtems_task_start of TA2" ); |
---|
115 | |
---|
116 | status = rtems_task_start( Task_id[ 3 ], Task_1, 0 ); |
---|
117 | directive_failed( status, "rtems_task_start of TA3" ); |
---|
118 | |
---|
119 | status = rtems_task_start( Task_id[ 4 ], FP_task, 0 ); |
---|
120 | directive_failed( status, "rtems_task_start of TA4" ); |
---|
121 | |
---|
122 | status = rtems_task_start( Task_id[ 5 ], FP_task, 0 ); |
---|
123 | directive_failed( status, "rtems_task_create of TA5" ); |
---|
124 | |
---|
125 | /* |
---|
126 | * Load "task dependent factors" in the context areas |
---|
127 | */ |
---|
128 | |
---|
129 | |
---|
130 | FP_factors[0] = 0.0; |
---|
131 | FP_factors[1] = 1000.1; |
---|
132 | FP_factors[2] = 2000.2; |
---|
133 | FP_factors[3] = 3000.3; |
---|
134 | FP_factors[4] = 4000.4; |
---|
135 | FP_factors[5] = 5000.5; |
---|
136 | FP_factors[6] = 6000.6; |
---|
137 | FP_factors[7] = 7000.7; |
---|
138 | FP_factors[8] = 8000.8; |
---|
139 | FP_factors[9] = 9000.9; |
---|
140 | |
---|
141 | INTEGER_factors[0] = 0x0000; |
---|
142 | INTEGER_factors[1] = 0x1000; |
---|
143 | INTEGER_factors[2] = 0x2000; |
---|
144 | INTEGER_factors[3] = 0x3000; |
---|
145 | INTEGER_factors[4] = 0x4000; |
---|
146 | INTEGER_factors[5] = 0x5000; |
---|
147 | INTEGER_factors[6] = 0x6000; |
---|
148 | INTEGER_factors[7] = 0x7000; |
---|
149 | INTEGER_factors[8] = 0x8000; |
---|
150 | INTEGER_factors[9] = 0x9000; |
---|
151 | |
---|
152 | status = rtems_task_delete( RTEMS_SELF ); |
---|
153 | directive_failed( status, "rtems_task_delete of TA1" ); |
---|
154 | } |
---|