OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  Screen7
2
 *
3
 *  This routine generates error screen 7 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: screen07.c,v 1.2 2001-09-27 12:02:31 chris Exp $
17
 */
18
 
19
#include "system.h"
20
 
21
#define MESSAGE_SIZE (sizeof(long) * 4)
22
 
23
void Screen7()
24
{
25
  long              buffer[ 4 ];
26
  rtems_unsigned32  size;
27
  rtems_unsigned32  count;
28
  rtems_status_code status;
29
 
30
  status = rtems_message_queue_broadcast( 100, buffer, MESSAGE_SIZE, &count );
31
  fatal_directive_status(
32
    status,
33
    RTEMS_INVALID_ID,
34
    "rtems_message_queue_broadcast with illegal id"
35
  );
36
  puts( "TA1 - rtems_message_queue_broadcast - RTEMS_INVALID_ID" );
37
 
38
  status = rtems_message_queue_create(
39
    0,
40
    3,
41
    MESSAGE_SIZE,
42
    RTEMS_DEFAULT_ATTRIBUTES,
43
    &Junk_id
44
  );
45
  fatal_directive_status(
46
    status,
47
    RTEMS_INVALID_NAME,
48
    "rtems_message_queue_create with illegal name"
49
  );
50
  puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_INVALID_NAME" );
51
 
52
  /*
53
   *  The check for an object being global is only made if
54
   *  multiprocessing is enabled.
55
   */
56
 
57
#if defined(RTEMS_MULTIPROCESSING)
58
  status = rtems_message_queue_create(
59
    Queue_name[ 1 ],
60
    1,
61
    MESSAGE_SIZE,
62
    RTEMS_GLOBAL,
63
    &Junk_id
64
  );
65
  fatal_directive_status(
66
    status,
67
    RTEMS_MP_NOT_CONFIGURED,
68
    "rtems_message_queue_create of mp not configured"
69
  );
70
#endif
71
  puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED" );
72
 
73
  status = rtems_message_queue_create(
74
    Queue_name[ 1 ],
75
    2,
76
    MESSAGE_SIZE,
77
    RTEMS_DEFAULT_ATTRIBUTES,
78
    &Queue_id[ 1 ]
79
  );
80
  directive_failed( status, "rtems_message_queue_create successful" );
81
  puts(
82
    "TA1 - rtems_message_queue_create - Q 1 - 2 DEEP - RTEMS_SUCCESSFUL"
83
  );
84
 
85
  status = rtems_message_queue_create(
86
    Queue_name[ 2 ],
87
    1,
88
    MESSAGE_SIZE,
89
    RTEMS_DEFAULT_ATTRIBUTES,
90
    &Junk_id
91
  );
92
  fatal_directive_status(
93
    status,
94
    RTEMS_TOO_MANY,
95
    "rtems_message_queue_create of too many"
96
  );
97
  puts( "TA1 - rtems_message_queue_create - Q 2 - RTEMS_TOO_MANY" );
98
 
99
  status = rtems_message_queue_delete( 100 );
100
  fatal_directive_status(
101
    status,
102
    RTEMS_INVALID_ID,
103
    "rtems_message_queue_create with illegal id"
104
  );
105
  puts( "TA1 - rtems_message_queue_delete - unknown RTEMS_INVALID_ID" );
106
 
107
  status = rtems_message_queue_delete( 0x10100 );
108
  fatal_directive_status(
109
    status,
110
    RTEMS_INVALID_ID,
111
    "rtems_message_queue_delete with local illegal id"
112
  );
113
  puts( "TA1 - rtems_message_queue_delete - local RTEMS_INVALID_ID" );
114
 
115
  status = rtems_message_queue_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id );
116
  fatal_directive_status(
117
    status,
118
    RTEMS_INVALID_NAME,
119
    "rtems_message_queue_ident with illegal name"
120
  );
121
  puts( "TA1 - rtems_message_queue_ident - RTEMS_INVALID_NAME" );
122
 
123
  status = rtems_message_queue_get_number_pending( 100, &count );
124
  fatal_directive_status(
125
    status,
126
    RTEMS_INVALID_ID,
127
    "rtems_message_queue_get_number_pending with illegal id"
128
  );
129
  puts( "TA1 - rtems_message_queue_get_number_pending - RTEMS_INVALID_ID" );
130
 
131
  status = rtems_message_queue_flush( 100, &count );
132
  fatal_directive_status(
133
    status,
134
    RTEMS_INVALID_ID,
135
    "rtems_message_queue_flush with illegal id"
136
  );
137
  puts( "TA1 - rtems_message_queue_flush - RTEMS_INVALID_ID" );
138
 
139
  status = rtems_message_queue_receive(
140
    100,
141
    (long (*)[4]) buffer,
142
    &size,
143
    RTEMS_DEFAULT_OPTIONS,
144
 
145
  );
146
  fatal_directive_status(
147
    status,
148
    RTEMS_INVALID_ID,
149
    "rtems_message_queue_receive wit illegal id"
150
  );
151
  puts( "TA1 - rtems_message_queue_receive - RTEMS_INVALID_ID" );
152
 
153
  status = rtems_message_queue_receive(
154
    Queue_id[ 1 ],
155
    (long (*)[4]) buffer,
156
    &size,
157
    RTEMS_NO_WAIT,
158
    RTEMS_NO_TIMEOUT
159
  );
160
  fatal_directive_status(
161
    status,
162
    RTEMS_UNSATISFIED,
163
    "rtems_message_queue_receive unsatisfied"
164
  );
165
  puts( "TA1 - rtems_message_queue_receive - Q 1 - RTEMS_UNSATISFIED" );
166
 
167
  puts( "TA1 - rtems_message_queue_receive - Q 1 - timeout in 3 seconds" );
168
  status = rtems_message_queue_receive(
169
    Queue_id[ 1 ],
170
    (long (*)[4]) buffer,
171
    &size,
172
    RTEMS_DEFAULT_OPTIONS,
173
    3 * TICKS_PER_SECOND
174
  );
175
  fatal_directive_status(
176
    status,
177
    RTEMS_TIMEOUT,
178
    "rtems_message_queue_receive 3 second timeout"
179
  );
180
 
181
  puts(
182
    "TA1 - rtems_message_queue_receive - Q 1 - woke up with RTEMS_TIMEOUT"
183
  );
184
 
185
  status = rtems_message_queue_send( 100, buffer, MESSAGE_SIZE );
186
  fatal_directive_status(
187
    status,
188
    RTEMS_INVALID_ID,
189
    "rtems_message_queue_send with illegal id"
190
  );
191
  puts( "TA1 - rtems_message_queue_send - RTEMS_INVALID_ID" );
192
 
193
  status = rtems_message_queue_send( Queue_id[ 1 ], buffer, MESSAGE_SIZE );
194
  directive_failed( status, "rtems_message_queue_send" );
195
  puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" );
196
 
197
  status = rtems_message_queue_send( Queue_id[ 1 ], buffer, MESSAGE_SIZE );
198
  directive_failed( status, "rtems_message_queue_send" );
199
  puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" );
200
 
201
  status = rtems_message_queue_send( Queue_id[ 1 ], buffer, MESSAGE_SIZE );
202
  fatal_directive_status(
203
    status,
204
    RTEMS_TOO_MANY,
205
    "rtems_message_queue_send too many to a limited queue"
206
  );
207
  puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_TOO_MANY" );
208
}

powered by: WebSVN 2.1.0

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