[6d4e604b] | 1 | -- |
---|
| 2 | -- SPTEST / SPECIFICATION |
---|
| 3 | -- |
---|
| 4 | -- DESCRIPTION: |
---|
| 5 | -- |
---|
| 6 | -- This package is the specification for Test 4 of the RTEMS |
---|
| 7 | -- Single Processor 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 |
---|
[35e4691] | 18 | -- http://www.rtems.com/license/LICENSE. |
---|
[6d4e604b] | 19 | -- |
---|
| 20 | |
---|
| 21 | with RTEMS; |
---|
[3c4d8cd1] | 22 | with RTEMS.TASKS; |
---|
[6d4e604b] | 23 | |
---|
| 24 | package SPTEST is |
---|
| 25 | |
---|
| 26 | -- |
---|
| 27 | -- These arrays contain the IDs and NAMEs of all RTEMS tasks created |
---|
| 28 | -- by this test. |
---|
| 29 | -- |
---|
| 30 | |
---|
| 31 | TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; |
---|
| 32 | TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; |
---|
| 33 | |
---|
| 34 | -- |
---|
| 35 | -- These arrays contain the IDs and NAMEs of all RTEMS extensions created |
---|
| 36 | -- by this test. |
---|
| 37 | -- |
---|
| 38 | |
---|
| 39 | EXTENSION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; |
---|
| 40 | EXTENSION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; |
---|
| 41 | |
---|
| 42 | -- |
---|
| 43 | -- This array contains the number of times each of the test tasks has |
---|
| 44 | -- been context switched TO. |
---|
| 45 | -- |
---|
| 46 | |
---|
| 47 | RUN_COUNT : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.UNSIGNED32; |
---|
| 48 | |
---|
| 49 | -- |
---|
| 50 | -- INIT |
---|
| 51 | -- |
---|
| 52 | -- DESCRIPTION: |
---|
| 53 | -- |
---|
| 54 | -- This RTEMS task initializes the application. |
---|
| 55 | -- |
---|
| 56 | |
---|
| 57 | procedure INIT ( |
---|
[3c4d8cd1] | 58 | ARGUMENT : in RTEMS.TASKS.ARGUMENT |
---|
[6d4e604b] | 59 | ); |
---|
[d43dd82] | 60 | pragma Convention (C, INIT); |
---|
[6d4e604b] | 61 | |
---|
| 62 | -- |
---|
| 63 | -- TASK_1 |
---|
| 64 | -- |
---|
| 65 | -- DESCRIPTION: |
---|
| 66 | -- |
---|
| 67 | -- This RTEMS task tests some of the capabilities of the Task Manager. |
---|
| 68 | -- |
---|
| 69 | |
---|
| 70 | procedure TASK_1 ( |
---|
[3c4d8cd1] | 71 | ARGUMENT : in RTEMS.TASKS.ARGUMENT |
---|
[6d4e604b] | 72 | ); |
---|
[d43dd82] | 73 | pragma Convention (C, TASK_1); |
---|
[6d4e604b] | 74 | |
---|
| 75 | -- |
---|
| 76 | -- TASK_2 |
---|
| 77 | -- |
---|
| 78 | -- DESCRIPTION: |
---|
| 79 | -- |
---|
| 80 | -- This RTEMS task is used as a background task to suspend, resume, |
---|
| 81 | -- and context switch to. |
---|
| 82 | -- |
---|
| 83 | |
---|
| 84 | procedure TASK_2 ( |
---|
[3c4d8cd1] | 85 | ARGUMENT : in RTEMS.TASKS.ARGUMENT |
---|
[6d4e604b] | 86 | ); |
---|
[d43dd82] | 87 | pragma Convention (C, TASK_2); |
---|
[6d4e604b] | 88 | |
---|
| 89 | -- |
---|
| 90 | -- TASK_3 |
---|
| 91 | -- |
---|
| 92 | -- DESCRIPTION: |
---|
| 93 | -- |
---|
| 94 | -- This RTEMS task is used as a background task to suspend, resume, |
---|
| 95 | -- and context switch to. |
---|
| 96 | -- |
---|
| 97 | |
---|
| 98 | procedure TASK_3 ( |
---|
[3c4d8cd1] | 99 | ARGUMENT : in RTEMS.TASKS.ARGUMENT |
---|
[6d4e604b] | 100 | ); |
---|
[d43dd82] | 101 | pragma Convention (C, TASK_3); |
---|
[6d4e604b] | 102 | |
---|
| 103 | -- |
---|
| 104 | -- TASK_SWITCH |
---|
| 105 | -- |
---|
| 106 | -- DESCRIPTION: |
---|
| 107 | -- |
---|
| 108 | -- This subprogram is the TASK_SWITCH extension for this test. |
---|
| 109 | -- It is invoked at each context switch and counts the number |
---|
| 110 | -- of times each application task has been context switched to. |
---|
| 111 | -- |
---|
| 112 | |
---|
| 113 | procedure TASK_SWITCH ( |
---|
| 114 | UNUSED : in RTEMS.TCB_POINTER; |
---|
| 115 | HEIR : in RTEMS.TCB_POINTER |
---|
| 116 | ); |
---|
[d43dd82] | 117 | pragma Convention (C, TASK_SWITCH); |
---|
[6d4e604b] | 118 | |
---|
[f2078ec] | 119 | -- |
---|
| 120 | -- This is the User Extension Table for this test. |
---|
| 121 | -- |
---|
| 122 | |
---|
| 123 | EXTENSIONS : aliased RTEMS.EXTENSIONS_TABLE := |
---|
| 124 | ( |
---|
| 125 | NULL, -- Task create |
---|
| 126 | NULL, -- Task start |
---|
| 127 | NULL, -- Task restart |
---|
| 128 | NULL, -- Task delete |
---|
| 129 | SPTEST.TASK_SWITCH'ACCESS, -- Task switch |
---|
| 130 | NULL, -- Task post switch |
---|
| 131 | NULL, -- Task begin |
---|
| 132 | NULL, -- Task exitted |
---|
| 133 | NULL -- Fatal error |
---|
| 134 | ); |
---|
| 135 | |
---|
[6d4e604b] | 136 | end SPTEST; |
---|