1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
5 -- S Y S T E M . R I D E N T --
9 -- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
27 -- This package defines the set of restriction identifiers. It is a generic
28 -- package that is instantiated by the compiler/binder in package Rident, and
29 -- is instantiated in package System.Restrictions for use at run-time.
31 -- The reason that we make this a generic package is so that in the case of
32 -- the instantiation in Rident for use at compile time and bind time, we can
33 -- generate normal image tables for the enumeration types, which are needed
34 -- for diagnostic and informational messages. At run-time we really do not
35 -- want to waste the space for these image tables, and they are not needed,
36 -- so we can do the instantiation under control of Discard_Names to remove
40 package System.Rident is
42 -- The following enumeration type defines the set of restriction
43 -- identifiers not taking a parameter that are implemented in GNAT.
44 -- To add a new restriction identifier, add an entry with the name
45 -- to be used in the pragma, and add appropriate calls to the
46 -- Restrict.Check_Restriction routine.
48 type Restriction_Id is (
50 -- The following cases are checked for consistency in the binder
52 Boolean_Entry_Barriers, -- GNAT (Ravenscar)
53 No_Abort_Statements, -- (RM D.7(5), H.4(3))
54 No_Access_Subprograms, -- (RM H.4(17))
55 No_Allocators, -- (RM H.4(7))
56 No_Asynchronous_Control, -- (RM D.7(10))
58 No_Delay, -- (RM H.4(21))
59 No_Dispatch, -- (RM H.4(19))
60 No_Dynamic_Interrupts, -- GNAT
61 No_Dynamic_Priorities, -- (RM D.9(9))
62 No_Enumeration_Maps, -- GNAT
63 No_Entry_Calls_In_Elaboration_Code, -- GNAT
64 No_Entry_Queue, -- GNAT (Ravenscar)
65 No_Exception_Handlers, -- GNAT
66 No_Exception_Registration, -- GNAT
67 No_Exceptions, -- (RM H.4(12))
68 No_Finalization, -- GNAT
69 No_Fixed_Point, -- (RM H.4(15))
70 No_Floating_Point, -- (RM H.4(14))
71 No_IO, -- (RM H.4(20))
72 No_Implicit_Conditionals, -- GNAT
73 No_Implicit_Dynamic_Code, -- GNAT
74 No_Implicit_Heap_Allocations, -- (RM D.8(8), H.4(3))
75 No_Implicit_Loops, -- GNAT
76 No_Initialize_Scalars, -- GNAT
77 No_Local_Allocators, -- (RM H.4(8))
78 No_Local_Protected_Objects, -- GNAT
79 No_Nested_Finalization, -- (RM D.7(4))
80 No_Protected_Type_Allocators, -- GNAT
81 No_Protected_Types, -- (RM H.4(5))
82 No_Recursion, -- (RM H.4(22))
83 No_Reentrancy, -- (RM H.4(23))
84 No_Relative_Delay, -- GNAT (Ravenscar)
86 No_Secondary_Stack, -- GNAT
87 No_Select_Statements, -- GNAT (Ravenscar)
88 No_Standard_Storage_Pools, -- GNAT
90 No_Task_Allocators, -- (RM D.7(7))
91 No_Task_Attributes, -- GNAT
92 No_Task_Hierarchy, -- (RM D.7(3), H.4(3))
93 No_Task_Termination, -- GNAT (Ravenscar)
95 No_Terminate_Alternatives, -- (RM D.7(6))
96 No_Unchecked_Access, -- (RM H.4(18))
97 No_Unchecked_Conversion, -- (RM H.4(16))
98 No_Unchecked_Deallocation, -- (RM H.4(9))
99 No_Wide_Characters, -- GNAT
100 Static_Priorities, -- GNAT
101 Static_Storage_Size, -- GNAT
103 -- The following cases do not require partition-wide checks
105 Immediate_Reclamation, -- (RM H.4(10))
106 No_Implementation_Attributes, -- GNAT
107 No_Implementation_Pragmas, -- GNAT
108 No_Implementation_Restrictions, -- GNAT
109 No_Elaboration_Code, -- GNAT
111 Not_A_Restriction_Id);
113 subtype All_Restrictions is Restriction_Id range
114 Boolean_Entry_Barriers .. No_Elaboration_Code;
115 -- All restrictions except Not_A_Restriction_Id
117 -- The following range of Restriction identifiers is checked for
118 -- consistency across a partition. The generated ali file is marked
119 -- for each entry to show one of three possibilities:
121 -- Corresponding restriction is set (so unit does not violate it)
122 -- Corresponding restriction is not violated
123 -- Corresponding restriction is violated
125 subtype Partition_Restrictions is Restriction_Id range
126 Boolean_Entry_Barriers .. Static_Storage_Size;
128 -- The following set of Restriction identifiers is not checked for
129 -- consistency across a partition. The generated ali file still
130 -- contains indications of the above three possibilities for the
131 -- purposes of listing applicable restrictions.
133 subtype Compilation_Unit_Restrictions is Restriction_Id range
134 Immediate_Reclamation .. No_Elaboration_Code;
136 -- The following enumeration type defines the set of restriction
137 -- parameter identifiers taking a parameter that are implemented in
138 -- GNAT. To add a new restriction parameter identifier, add an entry
139 -- with the name to be used in the pragma, and add appropriate
140 -- calls to Restrict.Check_Restriction.
142 -- Note: the GNAT implementation currently only accomodates restriction
143 -- parameter identifiers whose expression value is a non-negative
144 -- integer. This is true for all language defined parameters.
146 type Restriction_Parameter_Id is (
147 Max_Asynchronous_Select_Nesting, -- (RM D.7(18), H.4(3))
148 Max_Entry_Queue_Depth, -- GNAT
149 Max_Protected_Entries, -- (RM D.7(14))
150 Max_Select_Alternatives, -- (RM D.7(12))
151 Max_Storage_At_Blocking, -- (RM D.7(17))
152 Max_Task_Entries, -- (RM D.7(13), H.4(3))
153 Max_Tasks, -- (RM D.7(19), H.4(3))
154 Not_A_Restriction_Parameter_Id);