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