111
|
1 ------------------------------------------------------------------------------
|
|
2 -- --
|
|
3 -- GNAT COMPILER COMPONENTS --
|
|
4 -- --
|
|
5 -- S Y S T E M . P A R A M E T E R S --
|
|
6 -- --
|
|
7 -- S p e c --
|
|
8 -- --
|
|
9 -- Copyright (C) 1992-2017, Free Software Foundation, Inc. --
|
|
10 -- --
|
|
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 3, 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. --
|
|
17 -- --
|
|
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
|
|
19 -- additional permissions described in the GCC Runtime Library Exception, --
|
|
20 -- version 3.1, as published by the Free Software Foundation. --
|
|
21 -- --
|
|
22 -- You should have received a copy of the GNU General Public License and --
|
|
23 -- a copy of the GCC Runtime Library Exception along with this program; --
|
|
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
|
|
25 -- <http://www.gnu.org/licenses/>. --
|
|
26 -- --
|
|
27 -- GNAT was originally developed by the GNAT team at New York University. --
|
|
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
|
|
29 -- --
|
|
30 ------------------------------------------------------------------------------
|
|
31
|
|
32 -- This is the HP version of this package
|
|
33
|
|
34 -- This package defines some system dependent parameters for GNAT. These
|
|
35 -- are values that are referenced by the runtime library and are therefore
|
|
36 -- relevant to the target machine.
|
|
37
|
|
38 -- The parameters whose value is defined in the spec are not generally
|
|
39 -- expected to be changed. If they are changed, it will be necessary to
|
|
40 -- recompile the run-time library.
|
|
41
|
|
42 -- The parameters which are defined by functions can be changed by modifying
|
|
43 -- the body of System.Parameters in file s-parame.adb. A change to this body
|
|
44 -- requires only rebinding and relinking of the application.
|
|
45
|
|
46 -- Note: do not introduce any pragma Inline statements into this unit, since
|
|
47 -- otherwise the relinking and rebinding capability would be deactivated.
|
|
48
|
|
49 package System.Parameters is
|
|
50 pragma Pure;
|
|
51
|
|
52 ---------------------------------------
|
|
53 -- Task And Stack Allocation Control --
|
|
54 ---------------------------------------
|
|
55
|
|
56 type Task_Storage_Size is new Integer;
|
|
57 -- Type used in tasking units for task storage size
|
|
58
|
|
59 type Size_Type is new Task_Storage_Size;
|
|
60 -- Type used to provide task storage size to runtime
|
|
61
|
|
62 Unspecified_Size : constant Size_Type := Size_Type'First;
|
|
63 -- Value used to indicate that no size type is set
|
|
64
|
|
65 function Default_Stack_Size return Size_Type;
|
|
66 -- Default task stack size used if none is specified
|
|
67
|
|
68 function Minimum_Stack_Size return Size_Type;
|
|
69 -- Minimum task stack size permitted
|
|
70
|
|
71 function Adjust_Storage_Size (Size : Size_Type) return Size_Type;
|
|
72 -- Given the storage size stored in the TCB, return the Storage_Size
|
|
73 -- value required by the RM for the Storage_Size attribute. The
|
|
74 -- required adjustment is as follows:
|
|
75 --
|
|
76 -- when Size = Unspecified_Size, return Default_Stack_Size
|
|
77 -- when Size < Minimum_Stack_Size, return Minimum_Stack_Size
|
|
78 -- otherwise return given Size
|
|
79
|
|
80 Default_Env_Stack_Size : constant Size_Type := 8_192_000;
|
|
81 -- Assumed size of the environment task, if no other information
|
|
82 -- is available. This value is used when stack checking is
|
|
83 -- enabled and no GNAT_STACK_LIMIT environment variable is set.
|
|
84
|
|
85 Stack_Grows_Down : constant Boolean := False;
|
|
86 -- This constant indicates whether the stack grows up (False) or
|
|
87 -- down (True) in memory as functions are called. It is used for
|
|
88 -- proper implementation of the stack overflow check.
|
|
89
|
|
90 Runtime_Default_Sec_Stack_Size : constant Size_Type := 10 * 1024;
|
|
91 -- The run-time chosen default size for secondary stacks that may be
|
|
92 -- overriden by the user with the use of binder -D switch.
|
|
93
|
|
94 function Default_Sec_Stack_Size return Size_Type;
|
|
95 -- The default initial size for secondary stacks that reflects any user
|
|
96 -- specified default via the binder -D switch.
|
|
97
|
|
98 Sec_Stack_Dynamic : constant Boolean := True;
|
|
99 -- Indicates if secondary stacks can grow and shrink at run-time. If False,
|
|
100 -- the size of a secondary stack is fixed at the point of its creation.
|
|
101
|
|
102 ----------------------------------------------
|
|
103 -- Characteristics of Types in Interfaces.C --
|
|
104 ----------------------------------------------
|
|
105
|
|
106 long_bits : constant := Long_Integer'Size;
|
|
107 -- Number of bits in type long and unsigned_long. The normal convention
|
|
108 -- is that this is the same as type Long_Integer, but this may not be true
|
|
109 -- of all targets.
|
|
110
|
|
111 ptr_bits : constant := Standard'Address_Size;
|
|
112 subtype C_Address is System.Address;
|
|
113 -- Number of bits in Interfaces.C pointers, normally a standard address
|
|
114
|
|
115 C_Malloc_Linkname : constant String := "__gnat_malloc";
|
|
116 -- Name of runtime function used to allocate such a pointer
|
|
117
|
|
118 ----------------------------------------------
|
|
119 -- Behavior of Pragma Finalize_Storage_Only --
|
|
120 ----------------------------------------------
|
|
121
|
|
122 -- Garbage_Collected is a Boolean constant whose value indicates the
|
|
123 -- effect of the pragma Finalize_Storage_Entry on a controlled type.
|
|
124
|
|
125 -- Garbage_Collected = False
|
|
126
|
|
127 -- The system releases all storage on program termination only,
|
|
128 -- but not other garbage collection occurs, so finalization calls
|
|
129 -- are omitted only for outer level objects can be omitted if
|
|
130 -- pragma Finalize_Storage_Only is used.
|
|
131
|
|
132 -- Garbage_Collected = True
|
|
133
|
|
134 -- The system provides full garbage collection, so it is never
|
|
135 -- necessary to release storage for controlled objects for which
|
|
136 -- a pragma Finalize_Storage_Only is used.
|
|
137
|
|
138 Garbage_Collected : constant Boolean := False;
|
|
139 -- The storage mode for this system (release on program exit)
|
|
140
|
|
141 ---------------------
|
|
142 -- Tasking Profile --
|
|
143 ---------------------
|
|
144
|
|
145 -- In the following sections, constant parameters are defined to
|
|
146 -- allow some optimizations and fine tuning within the tasking run time
|
|
147 -- based on restrictions on the tasking features.
|
|
148
|
|
149 ----------------------
|
|
150 -- Locking Strategy --
|
|
151 ----------------------
|
|
152
|
|
153 Single_Lock : constant Boolean := False;
|
|
154 -- Indicates whether a single lock should be used within the tasking
|
|
155 -- run-time to protect internal structures. If True, a single lock
|
|
156 -- will be used, meaning less locking/unlocking operations, but also
|
|
157 -- more global contention. In general, Single_Lock should be set to
|
|
158 -- True on single processor machines, and to False to multi-processor
|
|
159 -- systems, but this can vary from application to application and also
|
|
160 -- depends on the scheduling policy.
|
|
161
|
|
162 -------------------
|
|
163 -- Task Abortion --
|
|
164 -------------------
|
|
165
|
|
166 No_Abort : constant Boolean := False;
|
|
167 -- This constant indicates whether abort statements and asynchronous
|
|
168 -- transfer of control (ATC) are disallowed. If set to True, it is
|
|
169 -- assumed that neither construct is used, and the run time does not
|
|
170 -- need to defer/undefer abort and check for pending actions at
|
|
171 -- completion points. A value of True for No_Abort corresponds to:
|
|
172 -- pragma Restrictions (No_Abort_Statements);
|
|
173 -- pragma Restrictions (Max_Asynchronous_Select_Nesting => 0);
|
|
174
|
|
175 ---------------------
|
|
176 -- Task Attributes --
|
|
177 ---------------------
|
|
178
|
|
179 Max_Attribute_Count : constant := 32;
|
|
180 -- Number of task attributes stored in the task control block
|
|
181
|
|
182 -----------------------
|
|
183 -- Task Image Length --
|
|
184 -----------------------
|
|
185
|
|
186 Max_Task_Image_Length : constant := 256;
|
|
187 -- This constant specifies the maximum length of a task's image
|
|
188
|
|
189 ------------------------------
|
|
190 -- Exception Message Length --
|
|
191 ------------------------------
|
|
192
|
|
193 Default_Exception_Msg_Max_Length : constant := 200;
|
|
194 -- This constant specifies the default number of characters to allow
|
|
195 -- in an exception message (200 is minimum required by RM 11.4.1(18)).
|
|
196
|
|
197 end System.Parameters;
|