source: rtems/testsuites/sptests/sp16/init.c @ 709b93d

4.104.114.84.95
Last change on this file since 709b93d was 709b93d, checked in by Joel Sherrill <joel.sherrill@…>, on 01/19/96 at 22:21:46

Increased stack size.

  • Property mode set to 100644
File size: 3.4 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 16 ***" );
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
42  status = rtems_task_create(
43    Task_name[ 1 ],
44    BASE_PRIORITY,
45    RTEMS_MINIMUM_STACK_SIZE * 2,
46    RTEMS_DEFAULT_MODES,
47    RTEMS_DEFAULT_ATTRIBUTES,
48    &Task_id[ 1 ]
49  );
50  directive_failed( status, "rtems_task_create of TA1" );
51
52  status = rtems_task_create(
53    Task_name[ 2 ],
54    BASE_PRIORITY,
55    RTEMS_MINIMUM_STACK_SIZE,
56    RTEMS_DEFAULT_MODES,
57    RTEMS_DEFAULT_ATTRIBUTES,
58    &Task_id[ 2 ]
59  );
60  directive_failed( status, "rtems_task_create of TA2" );
61
62  status = rtems_task_create(
63    Task_name[ 3 ],
64    BASE_PRIORITY,
65    RTEMS_MINIMUM_STACK_SIZE,
66    RTEMS_DEFAULT_MODES,
67    RTEMS_DEFAULT_ATTRIBUTES,
68    &Task_id[ 3 ]
69  );
70  directive_failed( status, "rtems_task_create of TA3" );
71
72  status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
73  directive_failed( status, "rtems_task_start of TA1" );
74
75  status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
76  directive_failed( status, "rtems_task_start of TA2" );
77
78  status = rtems_task_start( Task_id[ 3 ], Task_3, 0 );
79  directive_failed( status, "rtems_task_start of TA3" );
80
81  Region_name[ 1 ] = rtems_build_name( 'R', 'N', '1', ' ' );
82  Region_name[ 2 ] = rtems_build_name( 'R', 'N', '2', ' ' );
83  Region_name[ 3 ] = rtems_build_name( 'R', 'N', '3', ' ' );
84  Region_name[ 4 ] = rtems_build_name( 'R', 'N', '4', ' ' );
85
86  status = rtems_region_create(
87    Region_name[ 1 ],
88    Area_1,
89    4096,
90    128,
91    RTEMS_DEFAULT_ATTRIBUTES,
92    &Region_id[ 1 ]
93  );
94  directive_failed( status, "rtems_region_create of RN1" );
95
96  status = rtems_region_create(
97    Region_name[ 2 ],
98    Area_2,
99    4096,
100    128,
101    RTEMS_PRIORITY,
102    &Region_id[ 2 ]
103  );
104  directive_failed( status, "rtems_region_create of RN2" );
105
106  status = rtems_region_create(
107    Region_name[ 3 ],
108    Area_3,
109    4096,
110    128,
111    RTEMS_DEFAULT_ATTRIBUTES,
112    &Region_id[ 3 ]
113  );
114  directive_failed( status, "rtems_region_create of RN3" );
115
116  status = rtems_region_create(
117    Region_name[ 4 ],
118    Area_4,
119    4096,
120    128,
121    RTEMS_DEFAULT_ATTRIBUTES,
122    &Region_id[ 4 ]
123  );
124  directive_failed( status, "rtems_region_create of RN4" );
125
126  status = rtems_task_delete( RTEMS_SELF );
127  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
128}
Note: See TracBrowser for help on using the repository browser.