source: rtems/testsuites/sptests/sp19/init.c @ 8389628

4.104.114.84.95
Last change on this file since 8389628 was 3652ad35, checked in by Joel Sherrill <joel.sherrill@…>, on 09/19/95 at 14:53:29

Minor bug fixes to get all targets compilable and running. The
single biggest changes were the expansion of the workspace size
macro to include other types of objects and the increase in the
minimum stack size for most CPUs.

  • Property mode set to 100644
File size: 4.0 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#define TEST_INIT
26#include "system.h"
27
28rtems_task Init(
29  rtems_task_argument argument
30)
31{
32  rtems_status_code status;
33
34  puts( "\n\n*** TEST 19 ***" );
35
36  Task_name[ 1 ] =  rtems_build_name( 'T', 'A', '1', ' ' );
37  Task_name[ 2 ] =  rtems_build_name( 'T', 'A', '2', ' ' );
38  Task_name[ 3 ] =  rtems_build_name( 'T', 'A', '3', ' ' );
39  Task_name[ 4 ] =  rtems_build_name( 'T', 'A', '4', ' ' );
40  Task_name[ 5 ] =  rtems_build_name( 'T', 'A', '5', ' ' );
41  Task_name[ 6 ] =  rtems_build_name( 'F', 'P', '1', ' ' );
42
43  status = rtems_task_create(
44    Task_name[ 1 ],
45    2,
46    RTEMS_MINIMUM_STACK_SIZE * 4,
47    RTEMS_DEFAULT_MODES,
48    RTEMS_FLOATING_POINT,
49    &Task_id[ 1 ]
50  );
51  directive_failed( status, "rtems_task_create of TA1" );
52
53  status = rtems_task_create(
54    Task_name[ 2 ],
55    2,
56    RTEMS_MINIMUM_STACK_SIZE * 4,
57    RTEMS_DEFAULT_MODES,
58    RTEMS_DEFAULT_ATTRIBUTES,
59    &Task_id[ 2 ]
60  );
61  directive_failed( status, "rtems_task_create of TA2" );
62
63  status = rtems_task_create(
64    Task_name[ 3 ],
65    2,
66    RTEMS_MINIMUM_STACK_SIZE * 4,
67    RTEMS_DEFAULT_MODES,
68    RTEMS_DEFAULT_ATTRIBUTES,
69    &Task_id[ 3 ]
70  );
71  directive_failed( status, "rtems_task_create of TA3" );
72
73  status = rtems_task_create(
74    Task_name[ 4 ],
75    2,
76    RTEMS_MINIMUM_STACK_SIZE * 4,
77    RTEMS_DEFAULT_MODES,
78    RTEMS_FLOATING_POINT,
79    &Task_id[ 4 ]
80  );
81  directive_failed( status, "rtems_task_create of TA4" );
82
83  status = rtems_task_create(
84    Task_name[ 5 ],
85    2,
86    RTEMS_MINIMUM_STACK_SIZE * 4,
87    RTEMS_DEFAULT_MODES,
88    RTEMS_FLOATING_POINT,
89    &Task_id[ 5 ]
90  );
91  directive_failed( status, "rtems_task_create of TA5" );
92
93  status = rtems_task_create(
94    Task_name[ 6 ],
95    1,
96    RTEMS_MINIMUM_STACK_SIZE * 4,
97    RTEMS_DEFAULT_MODES,
98    RTEMS_FLOATING_POINT,
99    &Task_id[ 6 ]
100  );
101  directive_failed( status, "rtems_task_create of FP1" );
102
103  status = rtems_task_start( Task_id[ 6 ], First_FP_task, 0 );
104  directive_failed( status, "rtems_task_start of FP1" );
105
106  status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
107  directive_failed( status, "rtems_task_start of TA1" );
108
109  status = rtems_task_start( Task_id[ 2 ], Task_1, 0 );
110  directive_failed( status, "rtems_task_start of TA2" );
111
112  status = rtems_task_start( Task_id[ 3 ], Task_1, 0 );
113  directive_failed( status, "rtems_task_start of TA3" );
114
115  status = rtems_task_start( Task_id[ 4 ], FP_task, 0 );
116  directive_failed( status, "rtems_task_start of TA4" );
117
118  status = rtems_task_start( Task_id[ 5 ], FP_task, 0 );
119  directive_failed( status, "rtems_task_create of TA5" );
120
121  /*
122   *  Load "task dependent factors" in the context areas
123   */
124
125
126  FP_factors[0] =    0.0;
127  FP_factors[1] = 1000.1;
128  FP_factors[2] = 2000.2;
129  FP_factors[3] = 3000.3;
130  FP_factors[4] = 4000.4;
131  FP_factors[5] = 5000.5;
132  FP_factors[6] = 6000.6;
133  FP_factors[7] = 7000.7;
134  FP_factors[8] = 8000.8;
135  FP_factors[9] = 9000.9;
136
137  INTEGER_factors[0] = 0x0000;
138  INTEGER_factors[1] = 0x1000;
139  INTEGER_factors[2] = 0x2000;
140  INTEGER_factors[3] = 0x3000;
141  INTEGER_factors[4] = 0x4000;
142  INTEGER_factors[5] = 0x5000;
143  INTEGER_factors[6] = 0x6000;
144  INTEGER_factors[7] = 0x7000;
145  INTEGER_factors[8] = 0x8000;
146  INTEGER_factors[9] = 0x9000;
147
148  status = rtems_task_delete( RTEMS_SELF );
149  directive_failed( status, "rtems_task_delete of TA1" );
150}
Note: See TracBrowser for help on using the repository browser.