source: rtems/c/src/tests/sptests/sp19/init.c @ 1690c6b

4.104.114.84.95
Last change on this file since 1690c6b was 1690c6b, checked in by Joel Sherrill <joel.sherrill@…>, on 07/21/95 at 20:10:49

after testing go32 and cvme961

  • Property mode set to 100644
File size: 3.9 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 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
15 *  On-Line Applications Research Corporation (OAR).
16 *  All rights assigned to U.S. Government, 1994.
17 *
18 *  This material may be reproduced by or for the U.S. Government pursuant
19 *  to the copyright license under the clause at DFARS 252.227-7013.  This
20 *  notice must appear in all copies of this file and its derivatives.
21 *
22 *  $Id$
23 */
24
25#include "system.h"
26#undef EXTERN
27#define EXTERN
28#include "conftbl.h"
29#include "gvar.h"
30
31rtems_task Init(
32  rtems_task_argument argument
33)
34{
35  rtems_status_code status;
36
37  puts( "\n\n*** TEST 19 ***" );
38
39  Task_name[ 1 ] =  rtems_build_name( 'T', 'A', '1', ' ' );
40  Task_name[ 2 ] =  rtems_build_name( 'T', 'A', '2', ' ' );
41  Task_name[ 3 ] =  rtems_build_name( 'T', 'A', '3', ' ' );
42  Task_name[ 4 ] =  rtems_build_name( 'T', 'A', '4', ' ' );
43  Task_name[ 5 ] =  rtems_build_name( 'T', 'A', '5', ' ' );
44  Task_name[ 6 ] =  rtems_build_name( 'F', 'P', '1', ' ' );
45
46  status = rtems_task_create(
47    Task_name[ 1 ],
48    2,
49    8192,
50    RTEMS_DEFAULT_MODES,
51    RTEMS_FLOATING_POINT,
52    &Task_id[ 1 ]
53  );
54  directive_failed( status, "rtems_task_create of TA1" );
55
56  status = rtems_task_create(
57    Task_name[ 2 ],
58    2,
59    8192,
60    RTEMS_DEFAULT_MODES,
61    RTEMS_DEFAULT_ATTRIBUTES,
62    &Task_id[ 2 ]
63  );
64  directive_failed( status, "rtems_task_create of TA2" );
65
66  status = rtems_task_create(
67    Task_name[ 3 ],
68    2,
69    8192,
70    RTEMS_DEFAULT_MODES,
71    RTEMS_DEFAULT_ATTRIBUTES,
72    &Task_id[ 3 ]
73  );
74  directive_failed( status, "rtems_task_create of TA3" );
75
76  status = rtems_task_create(
77    Task_name[ 4 ],
78    2,
79    8192,
80    RTEMS_DEFAULT_MODES,
81    RTEMS_FLOATING_POINT,
82    &Task_id[ 4 ]
83  );
84  directive_failed( status, "rtems_task_create of TA4" );
85
86  status = rtems_task_create(
87    Task_name[ 5 ],
88    2,
89    8192,
90    RTEMS_DEFAULT_MODES,
91    RTEMS_FLOATING_POINT,
92    &Task_id[ 5 ]
93  );
94  directive_failed( status, "rtems_task_create of TA5" );
95
96  status = rtems_task_create(
97    Task_name[ 6 ],
98    1,
99    8192,
100    RTEMS_DEFAULT_MODES,
101    RTEMS_FLOATING_POINT,
102    &Task_id[ 6 ]
103  );
104  directive_failed( status, "rtems_task_create of FP1" );
105
106  status = rtems_task_start( Task_id[ 6 ], First_FP_task, 0 );
107  directive_failed( status, "rtems_task_start of FP1" );
108
109  status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
110  directive_failed( status, "rtems_task_start of TA1" );
111
112  status = rtems_task_start( Task_id[ 2 ], Task_1, 0 );
113  directive_failed( status, "rtems_task_start of TA2" );
114
115  status = rtems_task_start( Task_id[ 3 ], Task_1, 0 );
116  directive_failed( status, "rtems_task_start of TA3" );
117
118  status = rtems_task_start( Task_id[ 4 ], FP_task, 0 );
119  directive_failed( status, "rtems_task_start of TA4" );
120
121  status = rtems_task_start( Task_id[ 5 ], FP_task, 0 );
122  directive_failed( status, "rtems_task_create of TA5" );
123
124  /*
125   *  Load "task dependent factors" in the context areas
126   */
127
128
129  FP_factors[0] =    0.0;
130  FP_factors[1] = 1000.1;
131  FP_factors[2] = 2000.2;
132  FP_factors[3] = 3000.3;
133  FP_factors[4] = 4000.4;
134  FP_factors[5] = 5000.5;
135  FP_factors[6] = 6000.6;
136  FP_factors[7] = 7000.7;
137  FP_factors[8] = 8000.8;
138  FP_factors[9] = 9000.9;
139
140  INTEGER_factors[0] = 0x0000;
141  INTEGER_factors[1] = 0x1000;
142  INTEGER_factors[2] = 0x2000;
143  INTEGER_factors[3] = 0x3000;
144  INTEGER_factors[4] = 0x4000;
145  INTEGER_factors[5] = 0x5000;
146  INTEGER_factors[6] = 0x6000;
147  INTEGER_factors[7] = 0x7000;
148  INTEGER_factors[8] = 0x8000;
149  INTEGER_factors[9] = 0x9000;
150
151  status = rtems_task_delete( RTEMS_SELF );
152  directive_failed( status, "rtems_task_delete of TA1" );
153}
Note: See TracBrowser for help on using the repository browser.