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 | -- |
---|
13 | -- COPYRIGHT (c) 1989-2011. |
---|
14 | -- On-Line Applications Research Corporation (OAR). |
---|
15 | -- |
---|
16 | -- The license and distribution terms for this file may in |
---|
17 | -- the file LICENSE in this distribution or at |
---|
18 | -- http://www.rtems.com/license/LICENSE. |
---|
19 | -- |
---|
20 | |
---|
21 | with RTEMS; |
---|
22 | with RTEMS.TASKS; |
---|
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 ( |
---|
58 | ARGUMENT : in RTEMS.TASKS.ARGUMENT |
---|
59 | ); |
---|
60 | pragma Convention (C, INIT); |
---|
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 ( |
---|
71 | ARGUMENT : in RTEMS.TASKS.ARGUMENT |
---|
72 | ); |
---|
73 | pragma Convention (C, TASK_1); |
---|
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 ( |
---|
85 | ARGUMENT : in RTEMS.TASKS.ARGUMENT |
---|
86 | ); |
---|
87 | pragma Convention (C, TASK_2); |
---|
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 ( |
---|
99 | ARGUMENT : in RTEMS.TASKS.ARGUMENT |
---|
100 | ); |
---|
101 | pragma Convention (C, TASK_3); |
---|
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 | ); |
---|
117 | pragma Convention (C, TASK_SWITCH); |
---|
118 | |
---|
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 | |
---|
136 | end SPTEST; |
---|