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

Subversion Repositories openrisc_me

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  Screen10
2
 *
3
 *  This routine generates error screen 10 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: screen10.c,v 1.2 2001-09-27 12:02:31 chris Exp $
17
 */
18
 
19
#include "system.h"
20
 
21
void Screen10()
22
{
23
  rtems_status_code status;
24
 
25
  status = rtems_rate_monotonic_create( 0, &Junk_id );
26
  fatal_directive_status(
27
    status,
28
    RTEMS_INVALID_NAME,
29
    "rtems_rate_monotonic_create with illegal name"
30
  );
31
  puts( "TA1 - rtems_rate_monotonic_create - RTEMS_INVALID_NAME" );
32
 
33
  status = rtems_rate_monotonic_create( Period_name[ 1 ], &Period_id[ 1 ] );
34
  directive_failed( status, "rtems_rate_monotonic_create successful" );
35
  puts( "TA1 - rtems_rate_monotonic_create - RTEMS_SUCCESSFUL" );
36
 
37
  status = rtems_rate_monotonic_create( Period_name[ 1 ], &Junk_id );
38
  fatal_directive_status(
39
    status,
40
    RTEMS_TOO_MANY,
41
    "rtems_rate_monotonic_create of too many"
42
  );
43
  puts( "TA1 - rtems_rate_monotonic_create - RTEMS_TOO_MANY" );
44
 
45
  status = rtems_rate_monotonic_ident( 0, &Junk_id );
46
  fatal_directive_status(
47
    status,
48
    RTEMS_INVALID_NAME,
49
    "rtems_rate_monotonic_ident with illegal name"
50
  );
51
  puts( "TA1 - rtems_rate_monotonic_ident - RTEMS_INVALID_NAME" );
52
 
53
  status = rtems_rate_monotonic_period( 100, 5 );
54
  fatal_directive_status(
55
    status,
56
    RTEMS_INVALID_ID,
57
    "rtems_rate_monotonic_period with illegal id"
58
  );
59
  puts( "TA1 - rtems_rate_monotonic_period - unknown RTEMS_INVALID_ID" );
60
 
61
  status = rtems_rate_monotonic_period( 0x10100, 5 );
62
  fatal_directive_status(
63
    status,
64
    RTEMS_INVALID_ID,
65
    "rtems_rate_monotonic_period with illegal id"
66
  );
67
  puts( "TA1 - rtems_rate_monotonic_period - local RTEMS_INVALID_ID" );
68
 
69
  status = rtems_rate_monotonic_period( Period_id[ 1 ], RTEMS_PERIOD_STATUS );
70
  fatal_directive_status(
71
    status,
72
    RTEMS_NOT_DEFINED,
73
    "rtems_rate_monotonic_period status not defined"
74
  );
75
  puts(
76
    "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_NOT_DEFINED"
77
  );
78
 
79
  status = rtems_rate_monotonic_period( Period_id[ 1 ], 100 );
80
  directive_failed( status, "rtems_rate_monotonic_period successful" );
81
  puts( "TA1 - rtems_rate_monotonic_period - 100 ticks - RTEMS_SUCCESSFUL" );
82
 
83
  status = rtems_rate_monotonic_period( Period_id[ 1 ], RTEMS_PERIOD_STATUS );
84
  directive_failed( status, "rtems_rate_monotonic_period status" );
85
  puts(
86
    "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_SUCCESSFUL"
87
  );
88
 
89
  while ( FOREVER ) {
90
 
91
     status = rtems_rate_monotonic_period(Period_id[ 1 ], RTEMS_PERIOD_STATUS);
92
 
93
     if ( status == RTEMS_TIMEOUT ) break;
94
 
95
     directive_failed(
96
       status,
97
       "rtems_rate_monotonic_period waiting for timeout"
98
     );
99
  }
100
  puts(
101
    "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_TIMEOUT"
102
  );
103
 
104
  status = rtems_rate_monotonic_cancel( 100 );
105
  fatal_directive_status(
106
    status,
107
    RTEMS_INVALID_ID,
108
    "rtems_rate_monotonic_cancel with illegal id"
109
  );
110
  puts( "TA1 - rtems_rate_monotonic_cancel - unknown RTEMS_INVALID_ID" );
111
 
112
  status = rtems_rate_monotonic_cancel( 0x10100 );
113
  fatal_directive_status(
114
    status,
115
    RTEMS_INVALID_ID,
116
    "rtems_rate_monotonic_cancel will illegal id"
117
  );
118
  puts( "TA1 - rtems_rate_monotonic_cancel - local RTEMS_INVALID_ID" );
119
 
120
  status = rtems_rate_monotonic_cancel( Period_id[ 1 ] );
121
  directive_failed( status, "rtems_rate_monotonic_cancel" );
122
  puts( "TA1 - rtems_rate_monotonic_cancel - RTEMS_SUCCESSFUL" );
123
 
124
  status = rtems_rate_monotonic_period( Period_id[ 1 ], 5 );
125
  directive_failed( status, "rtems_rate_monotonic_period restart" );
126
 
127
  status = rtems_task_wake_after( 1 * TICKS_PER_SECOND );
128
  directive_failed( status, "rtems_task_wake_after" );
129
 
130
  status = rtems_rate_monotonic_period( Period_id[ 1 ], 5 );
131
  fatal_directive_status(
132
    status,
133
    RTEMS_TIMEOUT,
134
    "rtems_rate_monotonic_period"
135
  );
136
  puts( "TA1 - rtems_rate_monotonic_period - 5 ticks - RTEMS_TIMEOUT" );
137
 
138
  status = rtems_task_start( Task_id[ 4 ], Task_4, 0 );
139
  directive_failed( status, "rtems_task_start of TA4" );
140
 
141
  puts( "TA1 - yielding to TA4" );
142
  status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
143
 
144
  status = rtems_rate_monotonic_delete( 100 );
145
  fatal_directive_status(
146
    status,
147
    RTEMS_INVALID_ID,
148
    "rtems_rate_monotonic_delete with illegal id"
149
  );
150
  puts( "TA1 - rtems_rate_monotonic_delete - unknown RTEMS_INVALID_ID" );
151
 
152
  status = rtems_rate_monotonic_delete( 0x10100 );
153
  fatal_directive_status(
154
    status,
155
    RTEMS_INVALID_ID,
156
    "rtems_rate_monotonic_delete with illegal id"
157
  );
158
  puts( "TA1 - rtems_rate_monotonic_delete - local RTEMS_INVALID_ID" );
159
 
160
  status = rtems_rate_monotonic_delete( Period_id[ 1 ] );
161
  directive_failed( status, "rtems_rate_monotonic_delete" );
162
  puts( "TA1 - rtems_rate_monotonic_delete - RTEMS_SUCCESSFUL" );
163
}

powered by: WebSVN 2.1.0

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