annotate gcc/ada/libgnat/s-rident.ads @ 118:fd00160c1b76

ifdef TARGET_64BIT
author mir3636
date Tue, 27 Feb 2018 15:01:35 +0900
parents 04ced10e8804
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT COMPILER COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- S Y S T E M . R I D E N T --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
kono
parents:
diff changeset
9 -- Copyright (C) 1992-2017, Free Software Foundation, Inc. --
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
kono
parents:
diff changeset
17 -- --
kono
parents:
diff changeset
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
kono
parents:
diff changeset
19 -- additional permissions described in the GCC Runtime Library Exception, --
kono
parents:
diff changeset
20 -- version 3.1, as published by the Free Software Foundation. --
kono
parents:
diff changeset
21 -- --
kono
parents:
diff changeset
22 -- You should have received a copy of the GNU General Public License and --
kono
parents:
diff changeset
23 -- a copy of the GCC Runtime Library Exception along with this program; --
kono
parents:
diff changeset
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
kono
parents:
diff changeset
25 -- <http://www.gnu.org/licenses/>. --
kono
parents:
diff changeset
26 -- --
kono
parents:
diff changeset
27 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
29 -- --
kono
parents:
diff changeset
30 ------------------------------------------------------------------------------
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 -- This package defines the set of restriction identifiers. It is a generic
kono
parents:
diff changeset
33 -- package that is instantiated by the compiler/binder in package Rident, and
kono
parents:
diff changeset
34 -- is instantiated in package System.Restrictions for use at run-time.
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 -- The reason that we make this a generic package is so that in the case of
kono
parents:
diff changeset
37 -- the instantiation in Rident for use at compile time and bind time, we can
kono
parents:
diff changeset
38 -- generate normal image tables for the enumeration types, which are needed
kono
parents:
diff changeset
39 -- for diagnostic and informational messages. At run-time we really do not
kono
parents:
diff changeset
40 -- want to waste the space for these image tables, and they are not needed,
kono
parents:
diff changeset
41 -- so we can do the instantiation under control of Discard_Names to remove
kono
parents:
diff changeset
42 -- the tables.
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 ---------------------------------------------------
kono
parents:
diff changeset
45 -- Note On Compile/Run-Time Consistency Checking --
kono
parents:
diff changeset
46 ---------------------------------------------------
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 -- This unit is with'ed by the run-time (to make System.Restrictions which is
kono
parents:
diff changeset
49 -- used for run-time access to restriction information), by the compiler (to
kono
parents:
diff changeset
50 -- determine what restrictions are implemented and what their category is) and
kono
parents:
diff changeset
51 -- by the binder (in processing ali files, and generating the information used
kono
parents:
diff changeset
52 -- at run-time to access restriction information).
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 -- Normally the version of System.Rident referenced in all three contexts
kono
parents:
diff changeset
55 -- should be the same. However, problems could arise in certain inconsistent
kono
parents:
diff changeset
56 -- builds that used inconsistent versions of the compiler and run-time. This
kono
parents:
diff changeset
57 -- sort of thing is not strictly correct, but it does arise when short-cuts
kono
parents:
diff changeset
58 -- are taken in build procedures.
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 -- Previously, this kind of inconsistency could cause a significant problem.
kono
parents:
diff changeset
61 -- If versions of System.Rident accessed by the compiler and binder differed,
kono
parents:
diff changeset
62 -- then the binder could fail to recognize the R (restrictions line) in the
kono
parents:
diff changeset
63 -- ali file, leading to bind errors when restrictions were added or removed.
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 -- The latest implementation avoids both this problem by using a named
kono
parents:
diff changeset
66 -- scheme for recording restrictions, rather than a positional scheme which
kono
parents:
diff changeset
67 -- fails completely if restrictions are added or subtracted. Now the worst
kono
parents:
diff changeset
68 -- that happens at bind time in inconsistent builds is that unrecognized
kono
parents:
diff changeset
69 -- restrictions are ignored, and the consistency checking for restrictions
kono
parents:
diff changeset
70 -- might be incomplete, which is no big deal.
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 pragma Compiler_Unit_Warning;
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 generic
kono
parents:
diff changeset
75 package System.Rident is
kono
parents:
diff changeset
76 pragma Preelaborate;
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 -- The following enumeration type defines the set of restriction
kono
parents:
diff changeset
79 -- identifiers that are implemented in GNAT.
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 -- To add a new restriction identifier, add an entry with the name to be
kono
parents:
diff changeset
82 -- used in the pragma, and add calls to the Restrict.Check_Restriction
kono
parents:
diff changeset
83 -- routine as appropriate.
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 type Restriction_Id is
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 -- The following cases are checked for consistency in the binder. The
kono
parents:
diff changeset
88 -- binder will check that every unit either has the restriction set, or
kono
parents:
diff changeset
89 -- does not violate the restriction.
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 (Simple_Barriers, -- Ada 2012 (D.7 (10.9/3))
kono
parents:
diff changeset
92 Pure_Barriers, -- GNAT
kono
parents:
diff changeset
93 No_Abort_Statements, -- (RM D.7(5), H.4(3))
kono
parents:
diff changeset
94 No_Access_Parameter_Allocators, -- Ada 2012 (RM H.4 (8.3/3))
kono
parents:
diff changeset
95 No_Access_Subprograms, -- (RM H.4(17))
kono
parents:
diff changeset
96 No_Allocators, -- (RM H.4(7))
kono
parents:
diff changeset
97 No_Anonymous_Allocators, -- Ada 2012 (RM H.4(8/1))
kono
parents:
diff changeset
98 No_Asynchronous_Control, -- (RM J.13(3/2)
kono
parents:
diff changeset
99 No_Calendar, -- GNAT
kono
parents:
diff changeset
100 No_Coextensions, -- Ada 2012 (RM H.4(8.2/3))
kono
parents:
diff changeset
101 No_Default_Stream_Attributes, -- Ada 2012 (RM 13.12.1(4/2))
kono
parents:
diff changeset
102 No_Delay, -- (RM H.4(21))
kono
parents:
diff changeset
103 No_Direct_Boolean_Operators, -- GNAT
kono
parents:
diff changeset
104 No_Dispatch, -- (RM H.4(19))
kono
parents:
diff changeset
105 No_Dispatching_Calls, -- GNAT
kono
parents:
diff changeset
106 No_Dynamic_Attachment, -- Ada 2012 (RM E.7(10/3))
kono
parents:
diff changeset
107 No_Dynamic_Priorities, -- (RM D.9(9))
kono
parents:
diff changeset
108 No_Enumeration_Maps, -- GNAT
kono
parents:
diff changeset
109 No_Entry_Calls_In_Elaboration_Code, -- GNAT
kono
parents:
diff changeset
110 No_Entry_Queue, -- GNAT (Ravenscar)
kono
parents:
diff changeset
111 No_Exception_Handlers, -- GNAT
kono
parents:
diff changeset
112 No_Exception_Propagation, -- GNAT
kono
parents:
diff changeset
113 No_Exception_Registration, -- GNAT
kono
parents:
diff changeset
114 No_Exceptions, -- (RM H.4(12))
kono
parents:
diff changeset
115 No_Finalization, -- GNAT
kono
parents:
diff changeset
116 No_Fixed_IO, -- GNAT
kono
parents:
diff changeset
117 No_Fixed_Point, -- (RM H.4(15))
kono
parents:
diff changeset
118 No_Floating_Point, -- (RM H.4(14))
kono
parents:
diff changeset
119 No_IO, -- (RM H.4(20))
kono
parents:
diff changeset
120 No_Implicit_Conditionals, -- GNAT
kono
parents:
diff changeset
121 No_Implicit_Dynamic_Code, -- GNAT
kono
parents:
diff changeset
122 No_Implicit_Heap_Allocations, -- (RM D.8(8), H.4(3))
kono
parents:
diff changeset
123 No_Implicit_Task_Allocations, -- GNAT
kono
parents:
diff changeset
124 No_Implicit_Protected_Object_Allocations, -- GNAT
kono
parents:
diff changeset
125 No_Initialize_Scalars, -- GNAT
kono
parents:
diff changeset
126 No_Local_Allocators, -- (RM H.4(8))
kono
parents:
diff changeset
127 No_Local_Timing_Events, -- (RM D.7(10.2/2))
kono
parents:
diff changeset
128 No_Local_Protected_Objects, -- Ada 2012 (D.7(10/1.3))
kono
parents:
diff changeset
129 No_Long_Long_Integers, -- GNAT
kono
parents:
diff changeset
130 No_Multiple_Elaboration, -- GNAT
kono
parents:
diff changeset
131 No_Nested_Finalization, -- (RM D.7(4))
kono
parents:
diff changeset
132 No_Protected_Type_Allocators, -- Ada 2012 (D.7 (10.3/2))
kono
parents:
diff changeset
133 No_Protected_Types, -- (RM H.4(5))
kono
parents:
diff changeset
134 No_Recursion, -- (RM H.4(22))
kono
parents:
diff changeset
135 No_Reentrancy, -- (RM H.4(23))
kono
parents:
diff changeset
136 No_Relative_Delay, -- Ada 2012 (D.7 (10.5/3))
kono
parents:
diff changeset
137 No_Requeue_Statements, -- Ada 2012 (D.7 (10.6/3))
kono
parents:
diff changeset
138 No_Secondary_Stack, -- GNAT
kono
parents:
diff changeset
139 No_Select_Statements, -- Ada 2012 (D.7 (10.7/4))
kono
parents:
diff changeset
140 No_Specific_Termination_Handlers, -- (RM D.7(10.7/2))
kono
parents:
diff changeset
141 No_Standard_Allocators_After_Elaboration, -- Ada 2012 (RM D.7(19.1/2))
kono
parents:
diff changeset
142 No_Standard_Storage_Pools, -- GNAT
kono
parents:
diff changeset
143 No_Stream_Optimizations, -- GNAT
kono
parents:
diff changeset
144 No_Streams, -- GNAT
kono
parents:
diff changeset
145 No_Task_Allocators, -- (RM D.7(7))
kono
parents:
diff changeset
146 No_Task_Attributes_Package, -- GNAT
kono
parents:
diff changeset
147 No_Task_At_Interrupt_Priority, -- GNAT
kono
parents:
diff changeset
148 No_Task_Hierarchy, -- (RM D.7(3), H.4(3))
kono
parents:
diff changeset
149 No_Task_Termination, -- GNAT (Ravenscar)
kono
parents:
diff changeset
150 No_Tasking, -- GNAT
kono
parents:
diff changeset
151 No_Terminate_Alternatives, -- (RM D.7(6))
kono
parents:
diff changeset
152 No_Unchecked_Access, -- (RM H.4(18))
kono
parents:
diff changeset
153 No_Unchecked_Conversion, -- (RM J.13(4/2))
kono
parents:
diff changeset
154 No_Unchecked_Deallocation, -- (RM J.13(5/2))
kono
parents:
diff changeset
155 Static_Priorities, -- GNAT
kono
parents:
diff changeset
156 Static_Storage_Size, -- GNAT
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 -- The following require consistency checking with special rules. See
kono
parents:
diff changeset
159 -- individual routines in unit Bcheck for details of what is required.
kono
parents:
diff changeset
160
kono
parents:
diff changeset
161 No_Default_Initialization, -- GNAT
kono
parents:
diff changeset
162
kono
parents:
diff changeset
163 -- The following cases do not require consistency checking and if used
kono
parents:
diff changeset
164 -- as a configuration pragma within a specific unit, apply only to that
kono
parents:
diff changeset
165 -- unit (e.g. if used in the package spec, do not apply to the body)
kono
parents:
diff changeset
166
kono
parents:
diff changeset
167 -- Note: No_Elaboration_Code is handled specially. Like the other
kono
parents:
diff changeset
168 -- non-partition-wide restrictions, it can only be set in a unit that
kono
parents:
diff changeset
169 -- is part of the extended main source unit (body/spec/subunits). But
kono
parents:
diff changeset
170 -- it is sticky, in that if it is found anywhere within any of these
kono
parents:
diff changeset
171 -- units, it applies to all units in this extended main source.
kono
parents:
diff changeset
172
kono
parents:
diff changeset
173 Immediate_Reclamation, -- (RM H.4(10))
kono
parents:
diff changeset
174 No_Dynamic_Sized_Objects, -- GNAT
kono
parents:
diff changeset
175 No_Implementation_Aspect_Specifications, -- Ada 2012 AI-241
kono
parents:
diff changeset
176 No_Implementation_Attributes, -- Ada 2005 AI-257
kono
parents:
diff changeset
177 No_Implementation_Identifiers, -- Ada 2012 AI-246
kono
parents:
diff changeset
178 No_Implementation_Pragmas, -- Ada 2005 AI-257
kono
parents:
diff changeset
179 No_Implementation_Restrictions, -- GNAT
kono
parents:
diff changeset
180 No_Implementation_Units, -- Ada 2012 AI-242
kono
parents:
diff changeset
181 No_Implicit_Aliasing, -- GNAT
kono
parents:
diff changeset
182 No_Implicit_Loops, -- GNAT
kono
parents:
diff changeset
183 No_Elaboration_Code, -- GNAT
kono
parents:
diff changeset
184 No_Obsolescent_Features, -- Ada 2005 AI-368
kono
parents:
diff changeset
185 No_Wide_Characters, -- GNAT
kono
parents:
diff changeset
186 SPARK_05, -- GNAT
kono
parents:
diff changeset
187
kono
parents:
diff changeset
188 -- The following cases require a parameter value
kono
parents:
diff changeset
189
kono
parents:
diff changeset
190 No_Specification_Of_Aspect, -- 2012 (RM 13.12.1 (6.1/3))
kono
parents:
diff changeset
191 No_Use_Of_Attribute, -- 2012 (RM 13.12.1 (6.2/3))
kono
parents:
diff changeset
192 No_Use_Of_Pragma, -- 2012 (RM 13.12.1 (6.3/3))
kono
parents:
diff changeset
193
kono
parents:
diff changeset
194 -- The following entries are fully checked at compile/bind time, which
kono
parents:
diff changeset
195 -- means that the compiler can in general tell the minimum value which
kono
parents:
diff changeset
196 -- could be used with a restrictions pragma. The binder can deduce the
kono
parents:
diff changeset
197 -- appropriate minimum value for the partition by taking the maximum
kono
parents:
diff changeset
198 -- value required by any unit.
kono
parents:
diff changeset
199
kono
parents:
diff changeset
200 Max_Protected_Entries, -- (RM D.7(14))
kono
parents:
diff changeset
201 Max_Select_Alternatives, -- (RM D.7(12))
kono
parents:
diff changeset
202 Max_Task_Entries, -- (RM D.7(13), H.4(3))
kono
parents:
diff changeset
203
kono
parents:
diff changeset
204 -- The following entries are also fully checked at compile/bind time,
kono
parents:
diff changeset
205 -- and the compiler can also at least in some cases tell the minimum
kono
parents:
diff changeset
206 -- value which could be used with a restriction pragma. The difference
kono
parents:
diff changeset
207 -- is that the contributions are additive, so the binder deduces this
kono
parents:
diff changeset
208 -- value by adding the unit contributions.
kono
parents:
diff changeset
209
kono
parents:
diff changeset
210 Max_Tasks, -- (RM D.7(19), H.4(3))
kono
parents:
diff changeset
211
kono
parents:
diff changeset
212 -- The following entries are checked at compile time only for zero/
kono
parents:
diff changeset
213 -- nonzero entries. This means that the compiler can tell at compile
kono
parents:
diff changeset
214 -- time if a restriction value of zero is (would be) violated, but that
kono
parents:
diff changeset
215 -- the compiler cannot distinguish between different non-zero values.
kono
parents:
diff changeset
216
kono
parents:
diff changeset
217 Max_Asynchronous_Select_Nesting, -- (RM D.7(18), H.4(3))
kono
parents:
diff changeset
218 Max_Entry_Queue_Length, -- Ada 2012 (RM D.7 (19.1/2))
kono
parents:
diff changeset
219
kono
parents:
diff changeset
220 -- The remaining entries are not checked at compile/bind time
kono
parents:
diff changeset
221
kono
parents:
diff changeset
222 Max_Storage_At_Blocking, -- (RM D.7(17))
kono
parents:
diff changeset
223
kono
parents:
diff changeset
224 Not_A_Restriction_Id);
kono
parents:
diff changeset
225
kono
parents:
diff changeset
226 -- Synonyms permitted for historical purposes of compatibility.
kono
parents:
diff changeset
227 -- Must be coordinated with Restrict.Process_Restriction_Synonym.
kono
parents:
diff changeset
228
kono
parents:
diff changeset
229 Boolean_Entry_Barriers : Restriction_Id renames Simple_Barriers;
kono
parents:
diff changeset
230 Max_Entry_Queue_Depth : Restriction_Id renames Max_Entry_Queue_Length;
kono
parents:
diff changeset
231 No_Dynamic_Interrupts : Restriction_Id renames No_Dynamic_Attachment;
kono
parents:
diff changeset
232 No_Requeue : Restriction_Id renames No_Requeue_Statements;
kono
parents:
diff changeset
233 No_Task_Attributes : Restriction_Id renames No_Task_Attributes_Package;
kono
parents:
diff changeset
234 SPARK : Restriction_Id renames SPARK_05;
kono
parents:
diff changeset
235
kono
parents:
diff changeset
236 subtype All_Restrictions is Restriction_Id range
kono
parents:
diff changeset
237 Simple_Barriers .. Max_Storage_At_Blocking;
kono
parents:
diff changeset
238 -- All restrictions (excluding only Not_A_Restriction_Id)
kono
parents:
diff changeset
239
kono
parents:
diff changeset
240 subtype All_Boolean_Restrictions is Restriction_Id range
kono
parents:
diff changeset
241 Simple_Barriers .. SPARK_05;
kono
parents:
diff changeset
242 -- All restrictions which do not take a parameter
kono
parents:
diff changeset
243
kono
parents:
diff changeset
244 subtype Partition_Boolean_Restrictions is All_Boolean_Restrictions range
kono
parents:
diff changeset
245 Simple_Barriers .. Static_Storage_Size;
kono
parents:
diff changeset
246 -- Boolean restrictions that are checked for partition consistency.
kono
parents:
diff changeset
247 -- Note that all parameter restrictions are checked for partition
kono
parents:
diff changeset
248 -- consistency by default, so this distinction is only needed in the
kono
parents:
diff changeset
249 -- case of Boolean restrictions.
kono
parents:
diff changeset
250
kono
parents:
diff changeset
251 subtype Cunit_Boolean_Restrictions is All_Boolean_Restrictions range
kono
parents:
diff changeset
252 Immediate_Reclamation .. SPARK_05;
kono
parents:
diff changeset
253 -- Boolean restrictions that are not checked for partition consistency
kono
parents:
diff changeset
254 -- and that thus apply only to the current unit. Note that for these
kono
parents:
diff changeset
255 -- restrictions, the compiler does not apply restrictions found in
kono
parents:
diff changeset
256 -- with'ed units, parent specs etc. to the main unit, and vice versa.
kono
parents:
diff changeset
257
kono
parents:
diff changeset
258 subtype All_Parameter_Restrictions is
kono
parents:
diff changeset
259 Restriction_Id range
kono
parents:
diff changeset
260 No_Specification_Of_Aspect .. Max_Storage_At_Blocking;
kono
parents:
diff changeset
261 -- All restrictions that take a parameter
kono
parents:
diff changeset
262
kono
parents:
diff changeset
263 subtype Integer_Parameter_Restrictions is
kono
parents:
diff changeset
264 Restriction_Id range
kono
parents:
diff changeset
265 Max_Protected_Entries .. Max_Storage_At_Blocking;
kono
parents:
diff changeset
266 -- All restrictions taking an integer parameter
kono
parents:
diff changeset
267
kono
parents:
diff changeset
268 subtype Checked_Parameter_Restrictions is
kono
parents:
diff changeset
269 All_Parameter_Restrictions range
kono
parents:
diff changeset
270 Max_Protected_Entries .. Max_Entry_Queue_Length;
kono
parents:
diff changeset
271 -- These are the parameter restrictions that can be at least partially
kono
parents:
diff changeset
272 -- checked at compile/binder time. Minimally, the compiler can detect
kono
parents:
diff changeset
273 -- violations of a restriction pragma with a value of zero reliably.
kono
parents:
diff changeset
274
kono
parents:
diff changeset
275 subtype Checked_Max_Parameter_Restrictions is
kono
parents:
diff changeset
276 Checked_Parameter_Restrictions range
kono
parents:
diff changeset
277 Max_Protected_Entries .. Max_Task_Entries;
kono
parents:
diff changeset
278 -- Restrictions with parameters that can be checked in some cases by
kono
parents:
diff changeset
279 -- maximizing among statically detected instances where the compiler
kono
parents:
diff changeset
280 -- can determine the count.
kono
parents:
diff changeset
281
kono
parents:
diff changeset
282 subtype Checked_Add_Parameter_Restrictions is
kono
parents:
diff changeset
283 Checked_Parameter_Restrictions range
kono
parents:
diff changeset
284 Max_Tasks .. Max_Tasks;
kono
parents:
diff changeset
285 -- Restrictions with parameters that can be checked in some cases by
kono
parents:
diff changeset
286 -- summing the statically detected instances where the compiler can
kono
parents:
diff changeset
287 -- determine the count.
kono
parents:
diff changeset
288
kono
parents:
diff changeset
289 subtype Checked_Val_Parameter_Restrictions is
kono
parents:
diff changeset
290 Checked_Parameter_Restrictions range
kono
parents:
diff changeset
291 Max_Protected_Entries .. Max_Tasks;
kono
parents:
diff changeset
292 -- Restrictions with parameter where the count is known at least in some
kono
parents:
diff changeset
293 -- cases by the compiler/binder.
kono
parents:
diff changeset
294
kono
parents:
diff changeset
295 subtype Checked_Zero_Parameter_Restrictions is
kono
parents:
diff changeset
296 Checked_Parameter_Restrictions range
kono
parents:
diff changeset
297 Max_Asynchronous_Select_Nesting .. Max_Entry_Queue_Length;
kono
parents:
diff changeset
298 -- Restrictions with parameters where the compiler can detect the use of
kono
parents:
diff changeset
299 -- the feature, and hence violations of a restriction specifying a value
kono
parents:
diff changeset
300 -- of zero, but cannot detect specific values other than zero/nonzero.
kono
parents:
diff changeset
301
kono
parents:
diff changeset
302 subtype Unchecked_Parameter_Restrictions is
kono
parents:
diff changeset
303 All_Parameter_Restrictions range
kono
parents:
diff changeset
304 Max_Storage_At_Blocking .. Max_Storage_At_Blocking;
kono
parents:
diff changeset
305 -- Restrictions with parameters where the compiler cannot ever detect
kono
parents:
diff changeset
306 -- corresponding compile time usage, so the binder and compiler never
kono
parents:
diff changeset
307 -- detect violations of any restriction.
kono
parents:
diff changeset
308
kono
parents:
diff changeset
309 -------------------------------------
kono
parents:
diff changeset
310 -- Restriction Status Declarations --
kono
parents:
diff changeset
311 -------------------------------------
kono
parents:
diff changeset
312
kono
parents:
diff changeset
313 -- The following declarations are used to record the current status or
kono
parents:
diff changeset
314 -- restrictions (for the current unit, or related units, at compile time,
kono
parents:
diff changeset
315 -- and for all units in a partition at bind time or run time).
kono
parents:
diff changeset
316
kono
parents:
diff changeset
317 type Restriction_Flags is array (All_Restrictions) of Boolean;
kono
parents:
diff changeset
318 type Restriction_Values is array (All_Parameter_Restrictions) of Natural;
kono
parents:
diff changeset
319 type Parameter_Flags is array (All_Parameter_Restrictions) of Boolean;
kono
parents:
diff changeset
320
kono
parents:
diff changeset
321 type Restrictions_Info is record
kono
parents:
diff changeset
322 Set : Restriction_Flags;
kono
parents:
diff changeset
323 -- An entry is True in the Set array if a restrictions pragma has been
kono
parents:
diff changeset
324 -- encountered for the given restriction. If the value is True for a
kono
parents:
diff changeset
325 -- parameter restriction, then the corresponding entry in the Value
kono
parents:
diff changeset
326 -- array gives the minimum value encountered for any such restriction.
kono
parents:
diff changeset
327
kono
parents:
diff changeset
328 Value : Restriction_Values;
kono
parents:
diff changeset
329 -- If the entry for a parameter restriction in Set is True (i.e. a
kono
parents:
diff changeset
330 -- restrictions pragma for the restriction has been encountered), then
kono
parents:
diff changeset
331 -- the corresponding entry in the Value array is the minimum value
kono
parents:
diff changeset
332 -- specified by any such restrictions pragma. Note that a restrictions
kono
parents:
diff changeset
333 -- pragma specifying a value greater than Int'Last is simply ignored.
kono
parents:
diff changeset
334
kono
parents:
diff changeset
335 Violated : Restriction_Flags;
kono
parents:
diff changeset
336 -- An entry is True in the violations array if the compiler has detected
kono
parents:
diff changeset
337 -- a violation of the restriction. For a parameter restriction, the
kono
parents:
diff changeset
338 -- Count and Unknown arrays have additional information.
kono
parents:
diff changeset
339
kono
parents:
diff changeset
340 Count : Restriction_Values;
kono
parents:
diff changeset
341 -- If an entry for a parameter restriction is True in Violated, the
kono
parents:
diff changeset
342 -- corresponding entry in the Count array may record additional
kono
parents:
diff changeset
343 -- information. If the actual minimum count is known (by taking
kono
parents:
diff changeset
344 -- maximums, or sums, depending on the restriction), it will be
kono
parents:
diff changeset
345 -- recorded in this array. If not, then the value will remain zero.
kono
parents:
diff changeset
346 -- The value is also zero for a non-violated restriction.
kono
parents:
diff changeset
347
kono
parents:
diff changeset
348 Unknown : Parameter_Flags;
kono
parents:
diff changeset
349 -- If an entry for a parameter restriction is True in Violated, the
kono
parents:
diff changeset
350 -- corresponding entry in the Unknown array may record additional
kono
parents:
diff changeset
351 -- information. If the actual count is not known by the compiler (but
kono
parents:
diff changeset
352 -- is known to be non-zero), then the entry in Unknown will be True.
kono
parents:
diff changeset
353 -- This indicates that the value in Count is not known to be exact,
kono
parents:
diff changeset
354 -- and the actual violation count may be higher.
kono
parents:
diff changeset
355
kono
parents:
diff changeset
356 -- Note: If Violated (K) is True, then either Count (K) > 0 or
kono
parents:
diff changeset
357 -- Unknown (K) = True. It is possible for both these to be set.
kono
parents:
diff changeset
358 -- For example, if Count (K) = 3 and Unknown (K) is True, it means
kono
parents:
diff changeset
359 -- that the actual violation count is at least 3 but might be higher.
kono
parents:
diff changeset
360 end record;
kono
parents:
diff changeset
361
kono
parents:
diff changeset
362 No_Restrictions : constant Restrictions_Info :=
kono
parents:
diff changeset
363 (Set => (others => False),
kono
parents:
diff changeset
364 Value => (others => 0),
kono
parents:
diff changeset
365 Violated => (others => False),
kono
parents:
diff changeset
366 Count => (others => 0),
kono
parents:
diff changeset
367 Unknown => (others => False));
kono
parents:
diff changeset
368 -- Used to initialize Restrictions_Info variables
kono
parents:
diff changeset
369
kono
parents:
diff changeset
370 ----------------------------------
kono
parents:
diff changeset
371 -- Profile Definitions and Data --
kono
parents:
diff changeset
372 ----------------------------------
kono
parents:
diff changeset
373
kono
parents:
diff changeset
374 -- Note: to add a profile, modify the following declarations appropriately,
kono
parents:
diff changeset
375 -- add Name_xxx to Snames, and add a branch to the conditions for pragmas
kono
parents:
diff changeset
376 -- Profile and Profile_Warnings in the body of Sem_Prag.
kono
parents:
diff changeset
377
kono
parents:
diff changeset
378 type Profile_Name is
kono
parents:
diff changeset
379 (No_Profile,
kono
parents:
diff changeset
380 No_Implementation_Extensions,
kono
parents:
diff changeset
381 Restricted_Tasking,
kono
parents:
diff changeset
382 Restricted,
kono
parents:
diff changeset
383 Ravenscar,
kono
parents:
diff changeset
384 GNAT_Extended_Ravenscar,
kono
parents:
diff changeset
385 GNAT_Ravenscar_EDF);
kono
parents:
diff changeset
386 -- Names of recognized profiles. No_Profile is used to indicate that a
kono
parents:
diff changeset
387 -- restriction came from pragma Restrictions[_Warning], as opposed to
kono
parents:
diff changeset
388 -- pragma Profile[_Warning]. Restricted_Tasking is a non-user profile that
kono
parents:
diff changeset
389 -- contaings the minimal set of restrictions to trigger the user of the
kono
parents:
diff changeset
390 -- restricted tasking runtime. Restricted is the corresponding user profile
kono
parents:
diff changeset
391 -- that also restrict protected types.
kono
parents:
diff changeset
392
kono
parents:
diff changeset
393 subtype Profile_Name_Actual is Profile_Name
kono
parents:
diff changeset
394 range No_Implementation_Extensions .. Profile_Name'Last;
kono
parents:
diff changeset
395 -- Actual used profile names
kono
parents:
diff changeset
396
kono
parents:
diff changeset
397 type Profile_Data is record
kono
parents:
diff changeset
398 Set : Restriction_Flags;
kono
parents:
diff changeset
399 -- Set to True if given restriction must be set for the profile, and
kono
parents:
diff changeset
400 -- False if it need not be set (False does not mean that it must not be
kono
parents:
diff changeset
401 -- set, just that it need not be set). If the flag is True for a
kono
parents:
diff changeset
402 -- parameter restriction, then the Value array gives the maximum value
kono
parents:
diff changeset
403 -- permitted by the profile.
kono
parents:
diff changeset
404
kono
parents:
diff changeset
405 Value : Restriction_Values;
kono
parents:
diff changeset
406 -- An entry in this array is meaningful only if the corresponding flag
kono
parents:
diff changeset
407 -- in Set is True. In that case, the value in this array is the maximum
kono
parents:
diff changeset
408 -- value of the parameter permitted by the profile.
kono
parents:
diff changeset
409 end record;
kono
parents:
diff changeset
410
kono
parents:
diff changeset
411 Profile_Info : constant array (Profile_Name_Actual) of Profile_Data := (
kono
parents:
diff changeset
412
kono
parents:
diff changeset
413 -- No_Implementation_Extensions profile
kono
parents:
diff changeset
414
kono
parents:
diff changeset
415 No_Implementation_Extensions =>
kono
parents:
diff changeset
416
kono
parents:
diff changeset
417 (Set =>
kono
parents:
diff changeset
418 (No_Implementation_Aspect_Specifications => True,
kono
parents:
diff changeset
419 No_Implementation_Attributes => True,
kono
parents:
diff changeset
420 No_Implementation_Identifiers => True,
kono
parents:
diff changeset
421 No_Implementation_Pragmas => True,
kono
parents:
diff changeset
422 No_Implementation_Units => True,
kono
parents:
diff changeset
423 others => False),
kono
parents:
diff changeset
424
kono
parents:
diff changeset
425 -- Value settings for Restricted profile (none
kono
parents:
diff changeset
426
kono
parents:
diff changeset
427 Value =>
kono
parents:
diff changeset
428 (others => 0)),
kono
parents:
diff changeset
429
kono
parents:
diff changeset
430 -- Restricted_Tasking Profile
kono
parents:
diff changeset
431
kono
parents:
diff changeset
432 Restricted_Tasking =>
kono
parents:
diff changeset
433
kono
parents:
diff changeset
434 -- Restrictions for Restricted_Tasking profile
kono
parents:
diff changeset
435
kono
parents:
diff changeset
436 (Set =>
kono
parents:
diff changeset
437 (No_Abort_Statements => True,
kono
parents:
diff changeset
438 No_Asynchronous_Control => True,
kono
parents:
diff changeset
439 No_Dynamic_Attachment => True,
kono
parents:
diff changeset
440 No_Dynamic_Priorities => True,
kono
parents:
diff changeset
441 No_Local_Protected_Objects => True,
kono
parents:
diff changeset
442 No_Protected_Type_Allocators => True,
kono
parents:
diff changeset
443 No_Requeue_Statements => True,
kono
parents:
diff changeset
444 No_Task_Allocators => True,
kono
parents:
diff changeset
445 No_Task_Attributes_Package => True,
kono
parents:
diff changeset
446 No_Task_Hierarchy => True,
kono
parents:
diff changeset
447 No_Terminate_Alternatives => True,
kono
parents:
diff changeset
448 Max_Asynchronous_Select_Nesting => True,
kono
parents:
diff changeset
449 Max_Select_Alternatives => True,
kono
parents:
diff changeset
450 Max_Task_Entries => True,
kono
parents:
diff changeset
451 others => False),
kono
parents:
diff changeset
452
kono
parents:
diff changeset
453 -- Value settings for Restricted_Tasking profile
kono
parents:
diff changeset
454
kono
parents:
diff changeset
455 Value =>
kono
parents:
diff changeset
456 (Max_Asynchronous_Select_Nesting => 0,
kono
parents:
diff changeset
457 Max_Select_Alternatives => 0,
kono
parents:
diff changeset
458 Max_Task_Entries => 0,
kono
parents:
diff changeset
459 others => 0)),
kono
parents:
diff changeset
460
kono
parents:
diff changeset
461 -- Restricted Profile
kono
parents:
diff changeset
462
kono
parents:
diff changeset
463 Restricted =>
kono
parents:
diff changeset
464
kono
parents:
diff changeset
465 -- Restrictions for Restricted profile
kono
parents:
diff changeset
466
kono
parents:
diff changeset
467 (Set =>
kono
parents:
diff changeset
468 (No_Abort_Statements => True,
kono
parents:
diff changeset
469 No_Asynchronous_Control => True,
kono
parents:
diff changeset
470 No_Dynamic_Attachment => True,
kono
parents:
diff changeset
471 No_Dynamic_Priorities => True,
kono
parents:
diff changeset
472 No_Entry_Queue => True,
kono
parents:
diff changeset
473 No_Local_Protected_Objects => True,
kono
parents:
diff changeset
474 No_Protected_Type_Allocators => True,
kono
parents:
diff changeset
475 No_Requeue_Statements => True,
kono
parents:
diff changeset
476 No_Task_Allocators => True,
kono
parents:
diff changeset
477 No_Task_Attributes_Package => True,
kono
parents:
diff changeset
478 No_Task_Hierarchy => True,
kono
parents:
diff changeset
479 No_Terminate_Alternatives => True,
kono
parents:
diff changeset
480 Max_Asynchronous_Select_Nesting => True,
kono
parents:
diff changeset
481 Max_Protected_Entries => True,
kono
parents:
diff changeset
482 Max_Select_Alternatives => True,
kono
parents:
diff changeset
483 Max_Task_Entries => True,
kono
parents:
diff changeset
484 others => False),
kono
parents:
diff changeset
485
kono
parents:
diff changeset
486 -- Value settings for Restricted profile
kono
parents:
diff changeset
487
kono
parents:
diff changeset
488 Value =>
kono
parents:
diff changeset
489 (Max_Asynchronous_Select_Nesting => 0,
kono
parents:
diff changeset
490 Max_Protected_Entries => 1,
kono
parents:
diff changeset
491 Max_Select_Alternatives => 0,
kono
parents:
diff changeset
492 Max_Task_Entries => 0,
kono
parents:
diff changeset
493 others => 0)),
kono
parents:
diff changeset
494
kono
parents:
diff changeset
495 -- Ravenscar Profile
kono
parents:
diff changeset
496
kono
parents:
diff changeset
497 -- Note: the table entries here only represent the
kono
parents:
diff changeset
498 -- required restriction profile for Ravenscar. The
kono
parents:
diff changeset
499 -- full Ravenscar profile also requires:
kono
parents:
diff changeset
500
kono
parents:
diff changeset
501 -- pragma Dispatching_Policy (FIFO_Within_Priorities);
kono
parents:
diff changeset
502 -- pragma Locking_Policy (Ceiling_Locking);
kono
parents:
diff changeset
503 -- pragma Detect_Blocking;
kono
parents:
diff changeset
504
kono
parents:
diff changeset
505 Ravenscar =>
kono
parents:
diff changeset
506
kono
parents:
diff changeset
507 -- Restrictions for Ravenscar = Restricted profile ..
kono
parents:
diff changeset
508
kono
parents:
diff changeset
509 (Set =>
kono
parents:
diff changeset
510 (No_Abort_Statements => True,
kono
parents:
diff changeset
511 No_Asynchronous_Control => True,
kono
parents:
diff changeset
512 No_Dynamic_Attachment => True,
kono
parents:
diff changeset
513 No_Dynamic_Priorities => True,
kono
parents:
diff changeset
514 No_Entry_Queue => True,
kono
parents:
diff changeset
515 No_Local_Protected_Objects => True,
kono
parents:
diff changeset
516 No_Protected_Type_Allocators => True,
kono
parents:
diff changeset
517 No_Requeue_Statements => True,
kono
parents:
diff changeset
518 No_Task_Allocators => True,
kono
parents:
diff changeset
519 No_Task_Attributes_Package => True,
kono
parents:
diff changeset
520 No_Task_Hierarchy => True,
kono
parents:
diff changeset
521 No_Terminate_Alternatives => True,
kono
parents:
diff changeset
522 Max_Asynchronous_Select_Nesting => True,
kono
parents:
diff changeset
523 Max_Protected_Entries => True,
kono
parents:
diff changeset
524 Max_Select_Alternatives => True,
kono
parents:
diff changeset
525 Max_Task_Entries => True,
kono
parents:
diff changeset
526
kono
parents:
diff changeset
527 -- plus these additional restrictions:
kono
parents:
diff changeset
528
kono
parents:
diff changeset
529 No_Calendar => True,
kono
parents:
diff changeset
530 No_Implicit_Heap_Allocations => True,
kono
parents:
diff changeset
531 No_Local_Timing_Events => True,
kono
parents:
diff changeset
532 No_Relative_Delay => True,
kono
parents:
diff changeset
533 No_Select_Statements => True,
kono
parents:
diff changeset
534 No_Specific_Termination_Handlers => True,
kono
parents:
diff changeset
535 No_Task_Termination => True,
kono
parents:
diff changeset
536 Simple_Barriers => True,
kono
parents:
diff changeset
537 others => False),
kono
parents:
diff changeset
538
kono
parents:
diff changeset
539 -- Value settings for Ravenscar (same as Restricted)
kono
parents:
diff changeset
540
kono
parents:
diff changeset
541 Value =>
kono
parents:
diff changeset
542 (Max_Asynchronous_Select_Nesting => 0,
kono
parents:
diff changeset
543 Max_Protected_Entries => 1,
kono
parents:
diff changeset
544 Max_Select_Alternatives => 0,
kono
parents:
diff changeset
545 Max_Task_Entries => 0,
kono
parents:
diff changeset
546 others => 0)),
kono
parents:
diff changeset
547
kono
parents:
diff changeset
548 GNAT_Extended_Ravenscar =>
kono
parents:
diff changeset
549
kono
parents:
diff changeset
550 -- Restrictions for GNAT_Extended_Ravenscar =
kono
parents:
diff changeset
551 -- Restricted profile ..
kono
parents:
diff changeset
552
kono
parents:
diff changeset
553 (Set =>
kono
parents:
diff changeset
554 (No_Abort_Statements => True,
kono
parents:
diff changeset
555 No_Asynchronous_Control => True,
kono
parents:
diff changeset
556 No_Dynamic_Attachment => True,
kono
parents:
diff changeset
557 No_Dynamic_Priorities => True,
kono
parents:
diff changeset
558 No_Local_Protected_Objects => True,
kono
parents:
diff changeset
559 No_Protected_Type_Allocators => True,
kono
parents:
diff changeset
560 No_Requeue_Statements => True,
kono
parents:
diff changeset
561 No_Task_Allocators => True,
kono
parents:
diff changeset
562 No_Task_Attributes_Package => True,
kono
parents:
diff changeset
563 No_Task_Hierarchy => True,
kono
parents:
diff changeset
564 No_Terminate_Alternatives => True,
kono
parents:
diff changeset
565 Max_Asynchronous_Select_Nesting => True,
kono
parents:
diff changeset
566 Max_Select_Alternatives => True,
kono
parents:
diff changeset
567 Max_Task_Entries => True,
kono
parents:
diff changeset
568
kono
parents:
diff changeset
569 -- plus these additional restrictions:
kono
parents:
diff changeset
570
kono
parents:
diff changeset
571 No_Implicit_Task_Allocations => True,
kono
parents:
diff changeset
572 No_Implicit_Protected_Object_Allocations
kono
parents:
diff changeset
573 => True,
kono
parents:
diff changeset
574 No_Local_Timing_Events => True,
kono
parents:
diff changeset
575 No_Select_Statements => True,
kono
parents:
diff changeset
576 No_Specific_Termination_Handlers => True,
kono
parents:
diff changeset
577 No_Task_Termination => True,
kono
parents:
diff changeset
578 Pure_Barriers => True,
kono
parents:
diff changeset
579 others => False),
kono
parents:
diff changeset
580
kono
parents:
diff changeset
581 -- Value settings for Ravenscar (same as Restricted)
kono
parents:
diff changeset
582
kono
parents:
diff changeset
583 Value =>
kono
parents:
diff changeset
584 (Max_Asynchronous_Select_Nesting => 0,
kono
parents:
diff changeset
585 Max_Select_Alternatives => 0,
kono
parents:
diff changeset
586 Max_Task_Entries => 0,
kono
parents:
diff changeset
587 others => 0)),
kono
parents:
diff changeset
588
kono
parents:
diff changeset
589 -- GNAT_Ravenscar_EDF Profile
kono
parents:
diff changeset
590
kono
parents:
diff changeset
591 -- Note: the table entries here only represent the
kono
parents:
diff changeset
592 -- required restriction profile for GNAT_Ravenscar_EDF.
kono
parents:
diff changeset
593 -- The full GNAT_Ravenscar_EDF profile also requires:
kono
parents:
diff changeset
594
kono
parents:
diff changeset
595 -- pragma Dispatching_Policy (EDF_Across_Priorities);
kono
parents:
diff changeset
596 -- pragma Locking_Policy (Ceiling_Locking);
kono
parents:
diff changeset
597 -- pragma Detect_Blocking;
kono
parents:
diff changeset
598
kono
parents:
diff changeset
599 GNAT_Ravenscar_EDF =>
kono
parents:
diff changeset
600
kono
parents:
diff changeset
601 -- Restrictions for Ravenscar = Restricted profile ..
kono
parents:
diff changeset
602
kono
parents:
diff changeset
603 (Set =>
kono
parents:
diff changeset
604 (No_Abort_Statements => True,
kono
parents:
diff changeset
605 No_Asynchronous_Control => True,
kono
parents:
diff changeset
606 No_Dynamic_Attachment => True,
kono
parents:
diff changeset
607 No_Dynamic_Priorities => True,
kono
parents:
diff changeset
608 No_Entry_Queue => True,
kono
parents:
diff changeset
609 No_Local_Protected_Objects => True,
kono
parents:
diff changeset
610 No_Protected_Type_Allocators => True,
kono
parents:
diff changeset
611 No_Requeue_Statements => True,
kono
parents:
diff changeset
612 No_Task_Allocators => True,
kono
parents:
diff changeset
613 No_Task_Attributes_Package => True,
kono
parents:
diff changeset
614 No_Task_Hierarchy => True,
kono
parents:
diff changeset
615 No_Terminate_Alternatives => True,
kono
parents:
diff changeset
616 Max_Asynchronous_Select_Nesting => True,
kono
parents:
diff changeset
617 Max_Protected_Entries => True,
kono
parents:
diff changeset
618 Max_Select_Alternatives => True,
kono
parents:
diff changeset
619 Max_Task_Entries => True,
kono
parents:
diff changeset
620
kono
parents:
diff changeset
621 -- plus these additional restrictions:
kono
parents:
diff changeset
622
kono
parents:
diff changeset
623 No_Calendar => True,
kono
parents:
diff changeset
624 No_Implicit_Heap_Allocations => True,
kono
parents:
diff changeset
625 No_Local_Timing_Events => True,
kono
parents:
diff changeset
626 No_Relative_Delay => True,
kono
parents:
diff changeset
627 No_Select_Statements => True,
kono
parents:
diff changeset
628 No_Specific_Termination_Handlers => True,
kono
parents:
diff changeset
629 No_Task_Termination => True,
kono
parents:
diff changeset
630 Simple_Barriers => True,
kono
parents:
diff changeset
631 others => False),
kono
parents:
diff changeset
632
kono
parents:
diff changeset
633 -- Value settings for Ravenscar (same as Restricted)
kono
parents:
diff changeset
634
kono
parents:
diff changeset
635 Value =>
kono
parents:
diff changeset
636 (Max_Asynchronous_Select_Nesting => 0,
kono
parents:
diff changeset
637 Max_Protected_Entries => 1,
kono
parents:
diff changeset
638 Max_Select_Alternatives => 0,
kono
parents:
diff changeset
639 Max_Task_Entries => 0,
kono
parents:
diff changeset
640 others => 0)));
kono
parents:
diff changeset
641
kono
parents:
diff changeset
642 end System.Rident;