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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 30 unneback
/*  Screen5
2
 *
3
 *  This routine generates error screen 5 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: screen05.c,v 1.2 2001-09-27 12:02:31 chris Exp $
17
 */
18
 
19
#include "system.h"
20
 
21
void Screen5()
22
{
23
  rtems_status_code status;
24
 
25
  status = rtems_semaphore_create(
26
    0,
27
    1,
28
    RTEMS_DEFAULT_ATTRIBUTES,
29
    RTEMS_NO_PRIORITY,
30
    &Junk_id
31
  );
32
  fatal_directive_status(
33
    status,
34
    RTEMS_INVALID_NAME,
35
    "rtems_semaphore_create with illegal name"
36
  );
37
  puts( "TA1 - rtems_semaphore_create - RTEMS_INVALID_NAME" );
38
 
39
  status = rtems_semaphore_create(
40
    Semaphore_name[ 1 ],
41
    1,
42
    RTEMS_DEFAULT_ATTRIBUTES,
43
    RTEMS_NO_PRIORITY,
44
    &Semaphore_id[ 1 ]
45
  );
46
  directive_failed( status, "rtems_semaphore_create" );
47
  puts( "TA1 - rtems_semaphore_create - 1 - RTEMS_SUCCESSFUL" );
48
 
49
  status = rtems_semaphore_create(
50
    Semaphore_name[ 2 ],
51
    1,
52
    RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY | RTEMS_INHERIT_PRIORITY,
53
    RTEMS_NO_PRIORITY,
54
    &Semaphore_id[ 2 ]
55
  );
56
  directive_failed( status, "rtems_semaphore_create" );
57
  puts( "TA1 - rtems_semaphore_create - 2 - RTEMS_SUCCESSFUL" );
58
 
59
  do {
60
      status = rtems_semaphore_create(
61
          Semaphore_name[ 3 ],
62
          1,
63
          RTEMS_DEFAULT_ATTRIBUTES,
64
          RTEMS_NO_PRIORITY,
65
          &Junk_id
66
      );
67
  } while (status == RTEMS_SUCCESSFUL);
68
 
69
  fatal_directive_status(
70
    status,
71
    RTEMS_TOO_MANY,
72
    "rtems_semaphore_create of too many"
73
  );
74
  puts( "TA1 - rtems_semaphore_create - 3 - RTEMS_TOO_MANY" );
75
 
76
  status = rtems_semaphore_create(
77
    Semaphore_name[ 1 ],
78
    1,
79
    RTEMS_INHERIT_PRIORITY | RTEMS_BINARY_SEMAPHORE | RTEMS_FIFO,
80
    RTEMS_NO_PRIORITY,
81
    &Junk_id
82
  );
83
  fatal_directive_status(
84
    status,
85
    RTEMS_NOT_DEFINED,
86
    "rtems_semaphore_create of RTEMS_FIFO RTEMS_INHERIT_PRIORITY"
87
  );
88
  puts( "TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED" );
89
 
90
  status = rtems_semaphore_create(
91
    Semaphore_name[ 1 ],
92
    1,
93
    RTEMS_INHERIT_PRIORITY | RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY,
94
    RTEMS_NO_PRIORITY,
95
    &Junk_id
96
  );
97
  fatal_directive_status(
98
    status,
99
    RTEMS_NOT_DEFINED,
100
    "rtems_semaphore_create of RTEMS_COUNTING_SEMAPHORE RTEMS_INHERIT_PRIORITY"
101
  );
102
  puts( "TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED" );
103
 
104
  status = rtems_semaphore_create(
105
    Semaphore_name[ 1 ],
106
    2,
107
    RTEMS_BINARY_SEMAPHORE,
108
    RTEMS_NO_PRIORITY,
109
    &Junk_id
110
  );
111
  fatal_directive_status(
112
    status,
113
    RTEMS_INVALID_NUMBER,
114
    "rtems_semaphore_create of binary semaphore with count > 1"
115
  );
116
  puts( "TA1 - rtems_semaphore_create - RTEMS_INVALID_NUMBER" );
117
 
118
  /*
119
   *  The check for an object being global is only made if
120
   *  multiprocessing is enabled.
121
   */
122
 
123
#if defined(RTEMS_MULTIPROCESSING)
124
  status = rtems_semaphore_create(
125
    Semaphore_name[ 3 ],
126
    1,
127
    RTEMS_GLOBAL,
128
    RTEMS_NO_PRIORITY,
129
    &Junk_id
130
  );
131
  fatal_directive_status(
132
    status,
133
    RTEMS_MP_NOT_CONFIGURED,
134
    "rtems_semaphore_create of mp not configured"
135
  );
136
#endif
137
  puts( "TA1 - rtems_semaphore_create - RTEMS_MP_NOT_CONFIGURED" );
138
 
139
  status = rtems_semaphore_delete( 100 );
140
  fatal_directive_status(
141
    status,
142
    RTEMS_INVALID_ID,
143
    "rtems_semaphore_delete with illegal id"
144
  );
145
  puts( "TA1 - rtems_semaphore_delete - unknown RTEMS_INVALID_ID" );
146
 
147
  status = rtems_semaphore_delete( 0x010100 );
148
  fatal_directive_status(
149
    status,
150
    RTEMS_INVALID_ID,
151
    "rtems_semaphore_delete with local illegal id"
152
  );
153
  puts( "TA1 - rtems_semaphore_delete - local RTEMS_INVALID_ID" );
154
 
155
  status = rtems_semaphore_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id );
156
  fatal_directive_status(
157
    status,
158
    RTEMS_INVALID_NAME,
159
    "rtems_semaphore_ident will illegal name (local)"
160
  );
161
  puts( "TA1 - rtems_semaphore_ident - global RTEMS_INVALID_NAME" );
162
 
163
  status = rtems_semaphore_ident( 100, 1, &Junk_id );
164
  fatal_directive_status(
165
    status,
166
    RTEMS_INVALID_NAME,
167
    "rtems_semaphore_ident will illegal name (global)"
168
  );
169
  puts( "TA1 - rtems_semaphore_ident - local RTEMS_INVALID_NAME" );
170
}

powered by: WebSVN 2.1.0

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