source: rtems/testsuites/sptests/sp09/screen03.c @ 3652ad35

4.104.114.84.95
Last change on this file since 3652ad35 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: 5.2 KB
Line 
1/*  Screen3
2 *
3 *  This routine generates error screen 3 for test 9.
4 *
5 *  Input parameters:  NONE
6 *
7 *  Output parameters:  NONE
8 *
9 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
10 *  On-Line Applications Research Corporation (OAR).
11 *  All rights assigned to U.S. Government, 1994.
12 *
13 *  This material may be reproduced by or for the U.S. Government pursuant
14 *  to the copyright license under the clause at DFARS 252.227-7013.  This
15 *  notice must appear in all copies of this file and its derivatives.
16 *
17 *  $Id$
18 */
19
20#include "system.h"
21
22extern rtems_configuration_table BSP_Configuration;
23
24void Screen3()
25{
26  rtems_name        task_name;
27  rtems_status_code status;
28
29  task_name = 1;
30  status = rtems_task_create(
31    0,
32    1,
33    RTEMS_MINIMUM_STACK_SIZE,
34    RTEMS_DEFAULT_MODES,
35    RTEMS_DEFAULT_ATTRIBUTES,
36    &Junk_id
37  );
38  fatal_directive_status(
39    status,
40    RTEMS_INVALID_NAME,
41    "rtems_task_create with illegal name"
42  );
43  puts( "TA1 - rtems_task_create - RTEMS_INVALID_NAME" );
44
45  status = rtems_task_create(
46    task_name,
47    1,
48    BSP_Configuration.work_space_size,
49    RTEMS_DEFAULT_MODES,
50    RTEMS_DEFAULT_ATTRIBUTES,
51    &Junk_id
52  );
53  fatal_directive_status(
54    status,
55    RTEMS_UNSATISFIED,
56    "rtems_task_create with a stack size larger than the workspace"
57  );
58  puts( "TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED" );
59
60  status = rtems_task_create(
61    Task_name[ 2 ],
62    4,
63    RTEMS_MINIMUM_STACK_SIZE,
64    RTEMS_DEFAULT_MODES,
65    RTEMS_DEFAULT_ATTRIBUTES,
66    &Task_id[ 2 ]
67  );
68  directive_failed( status, "rtems_task_create of TA2" );
69  puts( "TA1 - rtems_task_create - TA2 created - RTEMS_SUCCESSFUL" );
70
71  status = rtems_task_suspend( Task_id[ 2 ] );
72  directive_failed( status, "rtems_task_suspend of TA2" );
73  puts( "TA1 - rtems_task_suspend - suspend TA2 - RTEMS_SUCCESSFUL" );
74
75  status = rtems_task_suspend( Task_id[ 2 ] );
76  fatal_directive_status(
77    status,
78    RTEMS_ALREADY_SUSPENDED,
79    "rtems_task_suspend of suspended TA2"
80  );
81  puts( "TA1 - rtems_task_suspend - suspend TA2 - RTEMS_ALREADY_SUSPENDED" );
82
83  status = rtems_task_resume( Task_id[ 2 ] );
84  directive_failed( status, "rtems_task_resume of TA2" );
85  puts( "TA1 - rtems_task_resume - TA2 resumed - RTEMS_SUCCESSFUL" );
86
87  status = rtems_task_create(
88    Task_name[ 3 ],
89    4,
90    RTEMS_MINIMUM_STACK_SIZE,
91    RTEMS_DEFAULT_MODES,
92    RTEMS_DEFAULT_ATTRIBUTES,
93    &Task_id[ 3 ]
94  );
95  directive_failed( status, "rtems_task_create of TA3" );
96  puts( "TA1 - rtems_task_create - TA3 created - RTEMS_SUCCESSFUL" );
97
98  status = rtems_task_create(
99    Task_name[ 4 ],
100    4,
101    RTEMS_MINIMUM_STACK_SIZE,
102    RTEMS_DEFAULT_MODES,
103    RTEMS_DEFAULT_ATTRIBUTES,
104    &Task_id[ 4 ]
105  );
106  directive_failed( status, "rtems_task_create of TA4" );
107  puts( "TA1 - rtems_task_create - 4 created - RTEMS_SUCCESSFUL" );
108
109  status = rtems_task_create(
110    Task_name[ 5 ],
111    4,
112    RTEMS_MINIMUM_STACK_SIZE,
113    RTEMS_DEFAULT_MODES,
114    RTEMS_DEFAULT_ATTRIBUTES,
115    &Task_id[ 5 ]
116  );
117  directive_failed( status, "rtems_task_create of TA5" );
118  puts( "TA1 - rtems_task_create - 5 created - RTEMS_SUCCESSFUL" );
119
120  status = rtems_task_create(
121    Task_name[ 6 ],
122    4,
123    RTEMS_MINIMUM_STACK_SIZE,
124    RTEMS_DEFAULT_MODES,
125    RTEMS_DEFAULT_ATTRIBUTES,
126    &Task_id[ 6 ]
127  );
128  directive_failed( status, "rtems_task_create of TA6" );
129  puts( "TA1 - rtems_task_create - 6 created - RTEMS_SUCCESSFUL" );
130
131  status = rtems_task_create(
132    Task_name[ 7 ],
133    4,
134    RTEMS_MINIMUM_STACK_SIZE,
135    RTEMS_DEFAULT_MODES,
136    RTEMS_DEFAULT_ATTRIBUTES,
137    &Task_id[ 7 ]
138  );
139  directive_failed( status, "rtems_task_create of TA7" );
140  puts( "TA1 - rtems_task_create - 7 created - RTEMS_SUCCESSFUL" );
141
142  status = rtems_task_create(
143    Task_name[ 8 ],
144    4,
145    RTEMS_MINIMUM_STACK_SIZE,
146    RTEMS_DEFAULT_MODES,
147    RTEMS_DEFAULT_ATTRIBUTES,
148    &Task_id[ 8 ]
149  );
150  directive_failed( status, "rtems_task_create of TA8" );
151  puts( "TA1 - rtems_task_create - 8 created - RTEMS_SUCCESSFUL" );
152
153  status = rtems_task_create(
154    Task_name[ 9 ],
155    4,
156    RTEMS_MINIMUM_STACK_SIZE,
157    RTEMS_DEFAULT_MODES,
158    RTEMS_DEFAULT_ATTRIBUTES,
159    &Task_id[ 9 ]
160  );
161  directive_failed( status, "rtems_task_create of TA9" );
162  puts( "TA1 - rtems_task_create - 9 created - RTEMS_SUCCESSFUL" );
163
164  status = rtems_task_create(
165    Task_name[ 10 ],
166    4,
167    RTEMS_MINIMUM_STACK_SIZE,
168    RTEMS_DEFAULT_MODES,
169    RTEMS_DEFAULT_ATTRIBUTES,
170    &Task_id[ 10 ]
171  );
172  directive_failed( status, "rtems_task_create of TA10" );
173  puts( "TA1 - rtems_task_create - 10 created - RTEMS_SUCCESSFUL" );
174
175  status = rtems_task_create(
176    task_name,
177    4,
178    RTEMS_MINIMUM_STACK_SIZE,
179    RTEMS_DEFAULT_MODES,
180    RTEMS_DEFAULT_ATTRIBUTES,
181    &Junk_id
182  );
183  fatal_directive_status(
184    status,
185    RTEMS_TOO_MANY,
186    "rtems_task_create for too many tasks"
187  );
188  puts( "TA1 - rtems_task_create - 11 - RTEMS_TOO_MANY" );
189
190  status = rtems_task_create(
191    task_name,
192    4,
193    RTEMS_MINIMUM_STACK_SIZE,
194    RTEMS_DEFAULT_MODES,
195    RTEMS_GLOBAL,
196    &Junk_id
197  );
198  fatal_directive_status(
199    status,
200    RTEMS_MP_NOT_CONFIGURED,
201    "rtems_task_create of global task in a single cpu system"
202  );
203  puts( "TA1 - rtems_task_create - RTEMS_MP_NOT_CONFIGURED" );
204}
Note: See TracBrowser for help on using the repository browser.