1 | -- |
---|
2 | -- TMTEST / SPECIFICATION |
---|
3 | -- |
---|
4 | -- DESCRIPTION: |
---|
5 | -- |
---|
6 | -- This package is the specification for Test 4 of the RTEMS |
---|
7 | -- Timing Test Suite. |
---|
8 | -- |
---|
9 | -- DEPENDENCIES: |
---|
10 | -- |
---|
11 | -- |
---|
12 | -- |
---|
13 | -- COPYRIGHT (c) 1989-1997. |
---|
14 | -- On-Line Applications Research Corporation (OAR). |
---|
15 | -- Copyright assigned to U.S. Government, 1994. |
---|
16 | -- |
---|
17 | -- The license and distribution terms for this file may in |
---|
18 | -- the file LICENSE in this distribution or at |
---|
19 | -- http://www.OARcorp.com/rtems/license.html. |
---|
20 | -- |
---|
21 | -- $Id$ |
---|
22 | -- |
---|
23 | |
---|
24 | with TIME_TEST_SUPPORT; |
---|
25 | with TIMER_DRIVER; |
---|
26 | with RTEMS; |
---|
27 | |
---|
28 | package TMTEST is |
---|
29 | |
---|
30 | -- |
---|
31 | -- This array contains the IDs of all RTEMS tasks created by this test. |
---|
32 | -- |
---|
33 | |
---|
34 | TASK_ID : array ( RTEMS.UNSIGNED32 |
---|
35 | range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; |
---|
36 | |
---|
37 | -- |
---|
38 | -- This variable contains the id of the highest priority task |
---|
39 | -- in the system. |
---|
40 | -- |
---|
41 | |
---|
42 | HIGHEST_ID : RTEMS.ID; |
---|
43 | |
---|
44 | -- |
---|
45 | -- The following is the ID of the semaphore used for timing operations. |
---|
46 | -- |
---|
47 | |
---|
48 | SEMAPHORE_ID : RTEMS.ID; |
---|
49 | |
---|
50 | -- |
---|
51 | -- The following is used to perform the same operation |
---|
52 | -- on a group of tasks. |
---|
53 | -- |
---|
54 | |
---|
55 | TASK_COUNT : RTEMS.UNSIGNED32; |
---|
56 | |
---|
57 | -- |
---|
58 | -- The following variable is set to the execution time returned |
---|
59 | -- by the timer. |
---|
60 | -- |
---|
61 | |
---|
62 | END_TIME : RTEMS.UNSIGNED32; |
---|
63 | |
---|
64 | -- |
---|
65 | -- INIT |
---|
66 | -- |
---|
67 | -- DESCRIPTION: |
---|
68 | -- |
---|
69 | -- This RTEMS task initializes the application. |
---|
70 | -- |
---|
71 | |
---|
72 | procedure INIT ( |
---|
73 | ARGUMENT : in RTEMS.TASK_ARGUMENT |
---|
74 | ); |
---|
75 | |
---|
76 | -- |
---|
77 | -- TEST_INIT |
---|
78 | -- |
---|
79 | -- DESCRIPTION: |
---|
80 | -- |
---|
81 | -- This subprogram performs test initialization. |
---|
82 | -- |
---|
83 | |
---|
84 | procedure TEST_INIT; |
---|
85 | |
---|
86 | -- |
---|
87 | -- HIGHEST_TASK |
---|
88 | -- |
---|
89 | -- DESCRIPTION: |
---|
90 | -- |
---|
91 | -- This RTEMS task is created by one of the LOW_TASKS. The |
---|
92 | -- first time it executes, it performs a blocking SEMAPHORE_OBTAIN |
---|
93 | -- which transfers control of the processor to HIGH_TASK. |
---|
94 | -- The first time HIGHEST_TASK is restarted, it stops the |
---|
95 | -- timer and reports the execution time for a TASK_RESTART |
---|
96 | -- for a blocked task which preempts the caller. The second |
---|
97 | -- time HIGHEST_TASK is restarted, it stops the timer and reports |
---|
98 | -- the execution time for a TASK_RESTART for a ready task which |
---|
99 | -- has its original priority restored and preempts the caller. |
---|
100 | -- |
---|
101 | |
---|
102 | procedure HIGHEST_TASK ( |
---|
103 | ARGUMENT : in RTEMS.TASK_ARGUMENT |
---|
104 | ); |
---|
105 | |
---|
106 | -- |
---|
107 | -- HIGH_TASK |
---|
108 | -- |
---|
109 | -- DESCRIPTION: |
---|
110 | -- |
---|
111 | -- This RTEMS task is created by one of the LOW_TASKS. This |
---|
112 | -- task restarts HIGHEST_TASK twice. HIGHEST_TASK is blocked the |
---|
113 | -- first time and preempts this task when restarted. HIGHEST_TASK |
---|
114 | -- is ready the second time but has lowered its priority. When |
---|
115 | -- restarted for the second time, HIGHEST_TASK will have its |
---|
116 | -- original priority restored and preempt this task. |
---|
117 | -- Once control of the processor is returned to this task after |
---|
118 | -- HIGHEST_TASK deletes itself, the following execution times |
---|
119 | -- are measured and reported. |
---|
120 | -- |
---|
121 | -- + readying SEMAPHORE_RELEASE |
---|
122 | -- + TASK_CREATE |
---|
123 | -- + TASK_START |
---|
124 | -- + TASK_RESTART of a suspended task |
---|
125 | -- + TASK_DELETE of a suspended task |
---|
126 | -- + TASK_RESTART of a ready task |
---|
127 | -- + TASK_RESTART of a blocked task which does not cause a preempt |
---|
128 | -- + TASK_DELETE of a blocked task |
---|
129 | -- |
---|
130 | |
---|
131 | procedure HIGH_TASK ( |
---|
132 | ARGUMENT : in RTEMS.TASK_ARGUMENT |
---|
133 | ); |
---|
134 | |
---|
135 | -- |
---|
136 | -- LOW_TASKS |
---|
137 | -- |
---|
138 | -- DESCRIPTION: |
---|
139 | -- |
---|
140 | -- The last of these RTEMS tasks to execute creates HIGH_TASK |
---|
141 | -- and HIGHEST_TASK. All of these tasks perform a blocking |
---|
142 | -- SEMAPHORE_OBTAIN. |
---|
143 | -- |
---|
144 | |
---|
145 | procedure LOW_TASKS ( |
---|
146 | ARGUMENT : in RTEMS.TASK_ARGUMENT |
---|
147 | ); |
---|
148 | |
---|
149 | -- |
---|
150 | -- RESTART_TASK |
---|
151 | -- |
---|
152 | -- DESCRIPTION: |
---|
153 | -- |
---|
154 | -- This RTEMS task |
---|
155 | -- |
---|
156 | |
---|
157 | procedure RESTART_TASK ( |
---|
158 | ARGUMENT : in RTEMS.TASK_ARGUMENT |
---|
159 | ); |
---|
160 | |
---|
161 | end TMTEST; |
---|