source: rtems/testsuites/ada/sptests/sp04/sptest.ads @ 0d44e251

5
Last change on this file since 0d44e251 was 0d44e251, checked in by Sebastian Huber <sebastian.huber@…>, on 02/22/18 at 15:37:26

ada/sp04: Fix test failure due to compiler opti

The SPTEST.RUN_COUNT must be volatile since it is changed outside of the
procedure scope by the thread switch extension.

  • Property mode set to 100644
File size: 3.1 KB
Line 
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.org/license/LICENSE.
19--
20
21with RTEMS;
22with RTEMS.TASKS;
23
24package 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   pragma Volatile (RUN_COUNT);
49
50--
51--  INIT
52--
53--  DESCRIPTION:
54--
55--  This RTEMS task initializes the application.
56--
57
58   procedure INIT (
59      ARGUMENT : in     RTEMS.TASKS.ARGUMENT
60   );
61   pragma Convention (C, INIT);
62
63--
64--  TASK_1
65--
66--  DESCRIPTION:
67--
68--  This RTEMS task tests some of the capabilities of the Task Manager.
69--
70
71   procedure TASK_1 (
72      ARGUMENT : in     RTEMS.TASKS.ARGUMENT
73   );
74   pragma Convention (C, TASK_1);
75
76--
77--  TASK_2
78--
79--  DESCRIPTION:
80--
81--  This RTEMS task is used as a background task to suspend, resume,
82--  and context switch to.
83--
84
85   procedure TASK_2 (
86      ARGUMENT : in     RTEMS.TASKS.ARGUMENT
87   );
88   pragma Convention (C, TASK_2);
89
90--
91--  TASK_3
92--
93--  DESCRIPTION:
94--
95--  This RTEMS task is used as a background task to suspend, resume,
96--  and context switch to.
97--
98
99   procedure TASK_3 (
100      ARGUMENT : in     RTEMS.TASKS.ARGUMENT
101   );
102   pragma Convention (C, TASK_3);
103
104--
105--  TASK_SWITCH
106--
107--  DESCRIPTION:
108--
109--  This subprogram is the TASK_SWITCH extension for this test.
110--  It is invoked at each context switch and counts the number
111--  of times each application task has been context switched to.
112--
113
114   procedure TASK_SWITCH (
115      UNUSED : in     RTEMS.TCB_POINTER;
116      HEIR   : in     RTEMS.TCB_POINTER
117   );
118   pragma Convention (C, TASK_SWITCH);
119
120--
121--  This is the User Extension Table for this test.
122--
123
124   EXTENSIONS : aliased RTEMS.EXTENSIONS_TABLE :=
125   (
126        NULL,                                        -- Task create
127        NULL,                                        -- Task start
128        NULL,                                        -- Task restart
129        NULL,                                        -- Task delete
130        SPTEST.TASK_SWITCH'ACCESS,                   -- Task switch
131        NULL,                                        -- Task post switch
132        NULL,                                        -- Task begin
133        NULL,                                        -- Task exitted
134        NULL                                         -- Fatal error
135   );
136
137end SPTEST;
Note: See TracBrowser for help on using the repository browser.