OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [sptests/] [sp09/] [screen11.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  Screen11
2
 *
3
 *  This routine generates error screen 11 for test 9.
4
 *
5
 *  Input parameters:  NONE
6
 *
7
 *  Output parameters:  NONE
8
 *
9
 *  COPYRIGHT (c) 1989-1999.
10
 *  On-Line Applications Research Corporation (OAR).
11
 *
12
 *  The license and distribution terms for this file may be
13
 *  found in the file LICENSE in this distribution or at
14
 *  http://www.OARcorp.com/rtems/license.html.
15
 *
16
 *  $Id: screen11.c,v 1.2 2001-09-27 12:02:31 chris Exp $
17
 */
18
 
19
#include "system.h"
20
 
21
void Screen11()
22
{
23
  void              *buffer_address_1;
24
  void              *buffer_address_2;
25
  void              *buffer_address_3;
26
  rtems_status_code  status;
27
 
28
  status = rtems_partition_create(
29
    0,
30
    Partition_good_area,
31
    128,
32
    40,
33
    RTEMS_DEFAULT_ATTRIBUTES,
34
    &Junk_id
35
  );
36
  fatal_directive_status(
37
    status,
38
    RTEMS_INVALID_NAME,
39
    "rtems_partition_create with illegal name"
40
  );
41
  puts( "TA1 - rtems_partition_create - RTEMS_INVALID_NAME" );
42
 
43
  status = rtems_partition_create(
44
    Partition_name[ 1 ],
45
    Partition_good_area,
46
    0,
47
    80,
48
    RTEMS_DEFAULT_ATTRIBUTES,
49
    &Junk_id
50
  );
51
  fatal_directive_status(
52
    status,
53
    RTEMS_INVALID_SIZE,
54
    "rtems_partition_create with illegal length"
55
  );
56
  puts( "TA1 - rtems_partition_create - length - RTEMS_INVALID_SIZE" );
57
 
58
  status = rtems_partition_create(
59
    Partition_name[ 1 ],
60
    Partition_good_area,
61
    128,
62
    0,
63
    RTEMS_DEFAULT_ATTRIBUTES,
64
    &Junk_id
65
  );
66
  fatal_directive_status(
67
    status,
68
    RTEMS_INVALID_SIZE,
69
    "rtems_partition_create with illegal buffer size"
70
  );
71
  puts( "TA1 - rtems_partition_create - buffer size - RTEMS_INVALID_SIZE" );
72
 
73
  status = rtems_partition_create(
74
    Partition_name[ 1 ],
75
    Partition_good_area,
76
    128,
77
    256,
78
    RTEMS_DEFAULT_ATTRIBUTES,
79
    &Junk_id
80
  );
81
  fatal_directive_status(
82
    status,
83
    RTEMS_INVALID_SIZE,
84
    "rtems_partition_create with buffer_size > length"
85
  );
86
  puts(
87
    "TA1 - rtems_partition_create - length < buffer size - RTEMS_INVALID_SIZE"
88
  );
89
 
90
  /*
91
   *  The check for an object being global is only made if
92
   *  multiprocessing is enabled.
93
   */
94
 
95
#if defined(RTEMS_MULTIPROCESSING)
96
  status = rtems_partition_create(
97
    Partition_name[ 1 ],
98
    Partition_good_area,
99
    128,
100
    64,
101
    RTEMS_GLOBAL,
102
    &Junk_id
103
  );
104
  fatal_directive_status(
105
    status,
106
    RTEMS_MP_NOT_CONFIGURED,
107
    "rtems_partition_create of global"
108
  );
109
#endif
110
  puts( "TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED" );
111
 
112
  status = rtems_partition_create(
113
    Partition_name[ 1 ],
114
    Partition_bad_area,
115
    128,
116
    64,
117
    RTEMS_GLOBAL,
118
    &Junk_id
119
  );
120
  fatal_directive_status(
121
    status,
122
    RTEMS_INVALID_ADDRESS,
123
    "rtems_partition_create with bad address"
124
  );
125
  puts( "TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS" );
126
 
127
  status = rtems_partition_create(
128
    Partition_name[ 1 ],
129
    Partition_good_area,
130
    128,
131
    34,
132
    RTEMS_DEFAULT_ATTRIBUTES,
133
    &Junk_id
134
  );
135
  fatal_directive_status(
136
    status,
137
    RTEMS_INVALID_SIZE,
138
    "rtems_partition_create with unaligned buffer_size"
139
  );
140
  puts( "TA1 - rtems_partition_create - RTEMS_INVALID_SIZE" );
141
 
142
  status = rtems_partition_delete( 100 );
143
  fatal_directive_status(
144
    status,
145
    RTEMS_INVALID_ID,
146
    "rtems_partition_delete with illegal id"
147
  );
148
  puts( "TA1 - rtems_partition_delete - unknown RTEMS_INVALID_ID" );
149
 
150
  status = rtems_partition_delete( 0x10100 );
151
  fatal_directive_status(
152
    status,
153
    RTEMS_INVALID_ID,
154
    "rtems_partition_delete with illegal id"
155
  );
156
  puts( "TA1 - rtems_partition_delete - local RTEMS_INVALID_ID" );
157
 
158
  status = rtems_partition_get_buffer( 100, &buffer_address_1 );
159
  fatal_directive_status(
160
    status,
161
    RTEMS_INVALID_ID,
162
    "rtems_partition_get_buffer with illegal id"
163
  );
164
  puts( "TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ID" );
165
 
166
  status = rtems_partition_ident( 0, RTEMS_SEARCH_ALL_NODES, &Junk_id );
167
  fatal_directive_status(
168
    status,
169
    RTEMS_INVALID_NAME,
170
    "rtems_partition_ident with illegal name"
171
  );
172
  puts( "TA1 - rtems_partition_ident - RTEMS_INVALID_NAME" );
173
 
174
  status = rtems_partition_return_buffer( 100, buffer_address_1 );
175
  fatal_directive_status(
176
    status,
177
    RTEMS_INVALID_ID,
178
    "rtems_partition_return_buffer with illegal id"
179
  );
180
  puts( "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ID" );
181
 
182
  status = rtems_partition_create(
183
    Partition_name[ 1 ],
184
    Partition_good_area,
185
    128,
186
    64,
187
    RTEMS_DEFAULT_ATTRIBUTES,
188
    &Partition_id[ 1 ]
189
  );
190
  directive_failed( status, "rtems_partition_create" );
191
  puts( "TA1 - rtems_partition_create - RTEMS_SUCCESSFUL" );
192
 
193
  status = rtems_partition_create(
194
    Partition_name[ 1 ],
195
    Partition_good_area,
196
    128,
197
    32,
198
    RTEMS_DEFAULT_ATTRIBUTES,
199
    &Junk_id
200
  );
201
  fatal_directive_status(
202
    status,
203
    RTEMS_TOO_MANY,
204
    "rtems_partition_create of too many"
205
  );
206
  puts( "TA1 - rtems_partition_create - RTEMS_TOO_MANY" );
207
 
208
  status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_1 );
209
  directive_failed( status, "rtems_partition_get_buffer");
210
  puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" );
211
 
212
  status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_2 );
213
  directive_failed( status, "rtems_partition_get_buffer" );
214
  puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" );
215
 
216
  status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_3 );
217
  fatal_directive_status(
218
    status,
219
    RTEMS_UNSATISFIED,
220
    "rtems_partition_get_buffer unsatisfied"
221
  );
222
  puts( "TA1 - rtems_partition_get_buffer - RTEMS_UNSATISFIED" );
223
 
224
  status = rtems_partition_delete( Partition_id[ 1 ] );
225
  fatal_directive_status(
226
    status,
227
    RTEMS_RESOURCE_IN_USE,
228
    "rtems_partition_delete with buffers in use"
229
  );
230
  puts( "TA1 - rtems_partition_delete - RTEMS_RESOURCE_IN_USE" );
231
 
232
  status = rtems_partition_return_buffer(
233
    Partition_id[ 1 ],
234
    Region_good_area                  /* NOTE: Region Memory */
235
  );
236
  fatal_directive_status(
237
    status,
238
    RTEMS_INVALID_ADDRESS,
239
    "rtems_partition_return_buffer with buffer address out of partition"
240
  );
241
  puts(
242
    "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - out of range"
243
  );
244
 
245
  status = rtems_partition_return_buffer(
246
    Partition_id[ 1 ],
247
    &Partition_good_area[ 7 ]
248
  );
249
  fatal_directive_status(
250
    status,
251
    RTEMS_INVALID_ADDRESS,
252
    "rtems_partition_return_buffer with buffer address not on boundary"
253
  );
254
  puts_nocr( "TA1 - rtems_partition_return_buffer - " );
255
  puts     ( "RTEMS_INVALID_ADDRESS - not on boundary");
256
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.