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/] [screen01.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  Screen1
2
 *
3
 *  This routine generates error screen 1 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: screen01.c,v 1.2 2001-09-27 12:02:31 chris Exp $
17
 */
18
 
19
#include "system.h"
20
 
21
void Screen1()
22
{
23
  rtems_unsigned32    notepad_value;
24
  rtems_id            self_id;
25
  rtems_task_priority previous_priority;
26
  rtems_status_code   status;
27
 
28
  status = rtems_task_delete( 100 );
29
  fatal_directive_status(
30
    status,
31
    RTEMS_INVALID_ID,
32
    "rtems_task_delete with illegal id"
33
  );
34
  puts( "TA1 - rtems_task_delete - RTEMS_INVALID_ID" );
35
 
36
  status = rtems_task_get_note( RTEMS_SELF, 100, &notepad_value );
37
  fatal_directive_status(
38
    status,
39
    RTEMS_INVALID_NUMBER,
40
    "rtems_task_get_note with illegal notepad"
41
  );
42
  puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER" );
43
 
44
  status = rtems_task_get_note( 100, RTEMS_NOTEPAD_LAST, &notepad_value );
45
  fatal_directive_status(
46
    status,
47
    RTEMS_INVALID_ID,
48
    "rtems_task_get_note with illegal id"
49
  );
50
  puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" );
51
 
52
  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &self_id );
53
  directive_failed( status, "rtems_task_ident of self" );
54
 
55
  if ( self_id != Task_id[ 1 ] ) {
56
    puts( "ERROR - rtems_task_ident - incorrect ID returned!" );
57
  }
58
  puts( "TA1 - rtems_task_ident - current task RTEMS_SUCCESSFUL" );
59
 
60
  status = rtems_task_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id );
61
  fatal_directive_status(
62
    status,
63
    RTEMS_INVALID_NAME,
64
    "rtems_task_ident with illegal name (local)"
65
  );
66
  puts( "TA1 - rtems_task_ident - global RTEMS_INVALID_NAME" );
67
 
68
  status = rtems_task_ident( 100, 1, &Junk_id );
69
  fatal_directive_status(
70
    status,
71
    RTEMS_INVALID_NAME,
72
    "rtems_task_ident with illegal name (global)"
73
  );
74
  puts( "TA1 - rtems_task_ident - local RTEMS_INVALID_NAME" );
75
 
76
  /*
77
   *  This one case is different if MP is enabled/disabled.
78
   */
79
 
80
  status = rtems_task_ident( 100, 2, &Junk_id );
81
#if defined(RTEMS_MULTIPROCESSING)
82
  fatal_directive_status(
83
    status,
84
    RTEMS_INVALID_NODE,
85
    "rtems_task_ident with illegal node"
86
  );
87
#else
88
  fatal_directive_status(
89
    status,
90
    RTEMS_INVALID_NAME,
91
    "rtems_task_ident with illegal node"
92
  );
93
#endif
94
  puts( "TA1 - rtems_task_ident - RTEMS_INVALID_NODE" );
95
 
96
  status = rtems_task_restart( 100, 0 );
97
  fatal_directive_status(
98
    status,
99
    RTEMS_INVALID_ID,
100
    "rtems_task_restart with illegal id"
101
  );
102
  puts( "TA1 - rtems_task_restart - RTEMS_INVALID_ID" );
103
 
104
  status = rtems_task_resume( 100 );
105
  fatal_directive_status(
106
    status,
107
    RTEMS_INVALID_ID,
108
    "rtems_task_resume with illegal id"
109
  );
110
  puts( "TA1 - rtems_task_resume - RTEMS_INVALID_ID" );
111
 
112
  status = rtems_task_resume( RTEMS_SELF );
113
  fatal_directive_status(
114
    status,
115
    RTEMS_INCORRECT_STATE,
116
    "rtems_task_resume of ready task"
117
  );
118
  puts( "TA1 - rtems_task_resume - RTEMS_INCORRECT_STATE" );
119
 
120
  status = rtems_task_set_priority( RTEMS_SELF, 512, &previous_priority );
121
  fatal_directive_status(
122
    status,
123
    RTEMS_INVALID_PRIORITY,
124
    "rtems_task_set_priority with illegal priority"
125
  );
126
  puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_PRIORITY" );
127
 
128
  status = rtems_task_set_priority( 100, 8, &previous_priority );
129
  fatal_directive_status(
130
    status,
131
    RTEMS_INVALID_ID,
132
    "rtems_task_set_priority with illegal id"
133
  );
134
  puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_ID" );
135
 
136
  status = rtems_task_set_note(
137
    RTEMS_SELF,
138
    RTEMS_NOTEPAD_LAST+10,
139
    notepad_value
140
  );
141
  fatal_directive_status(
142
    status,
143
    RTEMS_INVALID_NUMBER,
144
    "rtems_task_set_note with illegal notepad"
145
  );
146
  puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_NUMBER" );
147
 
148
  status = rtems_task_set_note( 100, RTEMS_NOTEPAD_LAST, notepad_value );
149
  fatal_directive_status(
150
    status,
151
    RTEMS_INVALID_ID,
152
    "rtems_task_set_note with illegal id"
153
  );
154
  puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_ID" );
155
 
156
  status = rtems_task_start( 100, Task_1, 0 );
157
  fatal_directive_status(
158
    status,
159
    RTEMS_INVALID_ID,
160
    "rtems_task_start with illegal id"
161
  );
162
  puts( "TA1 - rtems_task_start - RTEMS_INVALID_ID" );
163
 
164
  status = rtems_task_start( 0, Task_1, 0 );
165
  fatal_directive_status(
166
    status,
167
    RTEMS_INCORRECT_STATE,
168
    "rtems_task_start of ready task"
169
  );
170
  puts( "TA1 - rtems_task_start - RTEMS_INCORRECT_STATE" );
171
 
172
  status = rtems_task_suspend( 100 );
173
  fatal_directive_status(
174
    status,
175
    RTEMS_INVALID_ID,
176
    "rtems_task_suspend with illegal id"
177
  );
178
  puts( "TA1 - rtems_task_suspend - RTEMS_INVALID_ID" );
179
}

powered by: WebSVN 2.1.0

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