]>
Commit | Line | Data |
---|---|---|
cacbc350 RK |
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 | -- -- | |
fbf5a39b | 9 | -- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- |
cacbc350 RK |
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 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. -- | |
21 | -- -- | |
22 | -- As a special exception, if other files instantiate generics from this -- | |
23 | -- unit, or you link this unit with other files to produce an executable, -- | |
24 | -- this unit does not by itself cause the resulting executable to be -- | |
25 | -- covered by the GNU General Public License. This exception does not -- | |
26 | -- however invalidate any other reasons why the executable file might be -- | |
27 | -- covered by the GNU Public License. -- | |
28 | -- -- | |
29 | -- GNAT was originally developed by the GNAT team at New York University. -- | |
71ff80dc | 30 | -- Extensive contributions were provided by Ada Core Technologies Inc. -- |
cacbc350 RK |
31 | -- -- |
32 | ------------------------------------------------------------------------------ | |
33 | ||
34 | -- This is the default version used for all systems for which no special | |
35 | -- target-specific version of this package is provided. | |
36 | ||
37 | -- This package defines some system dependent parameters for GNAT. These | |
38 | -- are values that are referenced by the runtime library and are therefore | |
39 | -- relevant to the target machine. | |
40 | ||
41 | -- The parameters whose value is defined in the spec are not generally | |
42 | -- expected to be changed. If they are changed, it will be necessary to | |
43 | -- recompile the run-time library. | |
44 | ||
45 | -- The parameters which are defined by functions can be changed by modifying | |
46 | -- the body of System.Parameters in file s-parame.adb. A change to this body | |
47 | -- requires only rebinding and relinking of the application. | |
48 | ||
49 | -- Note: do not introduce any pragma Inline statements into this unit, since | |
50 | -- otherwise the relinking and rebinding capability would be deactivated. | |
51 | ||
52 | package System.Parameters is | |
53 | pragma Pure (Parameters); | |
54 | ||
55 | --------------------------------------- | |
56 | -- Task And Stack Allocation Control -- | |
57 | --------------------------------------- | |
58 | ||
59 | type Task_Storage_Size is new Integer; | |
60 | -- Type used in tasking units for task storage size | |
61 | ||
62 | type Size_Type is new Task_Storage_Size; | |
63 | -- Type used to provide task storage size to runtime | |
64 | ||
65 | Unspecified_Size : constant Size_Type := Size_Type'First; | |
66 | -- Value used to indicate that no size type is set | |
67 | ||
68 | subtype Ratio is Size_Type range -1 .. 100; | |
69 | Dynamic : constant Size_Type := -1; | |
70 | -- The secondary stack ratio is a constant between 0 and 100 which | |
71 | -- determines the percentage of the allocated task stack that is | |
72 | -- used by the secondary stack (the rest being the primary stack). | |
73 | -- The special value of minus one indicates that the secondary | |
74 | -- stack is to be allocated from the heap instead. | |
75 | ||
76 | Sec_Stack_Ratio : constant Ratio := Dynamic; | |
77 | -- This constant defines the handling of the secondary stack | |
78 | ||
79 | Sec_Stack_Dynamic : constant Boolean := Sec_Stack_Ratio = Dynamic; | |
80 | -- Convenient Boolean for testing for dynamic secondary stack | |
81 | ||
82 | function Default_Stack_Size return Size_Type; | |
83 | -- Default task stack size used if none is specified | |
84 | ||
85 | function Minimum_Stack_Size return Size_Type; | |
86 | -- Minimum task stack size permitted | |
87 | ||
88 | function Adjust_Storage_Size (Size : Size_Type) return Size_Type; | |
89 | -- Given the storage size stored in the TCB, return the Storage_Size | |
90 | -- value required by the RM for the Storage_Size attribute. The | |
91 | -- required adjustment is as follows: | |
92 | -- | |
93 | -- when Size = Unspecified_Size, return Default_Stack_Size | |
94 | -- when Size < Minimum_Stack_Size, return Minimum_Stack_Size | |
95 | -- otherwise return given Size | |
96 | ||
fbf5a39b AC |
97 | Default_Env_Stack_Size : constant Size_Type := 8_192_000; |
98 | -- Assumed size of the environment task, if no other information | |
99 | -- is available. This value is used when stack checking is | |
100 | -- enabled and no GNAT_STACK_LIMIT environment variable is set. | |
101 | ||
cacbc350 RK |
102 | Stack_Grows_Down : constant Boolean := True; |
103 | -- This constant indicates whether the stack grows up (False) or | |
104 | -- down (True) in memory as functions are called. It is used for | |
105 | -- proper implementation of the stack overflow check. | |
106 | ||
107 | ---------------------------------------------- | |
108 | -- Characteristics of types in Interfaces.C -- | |
109 | ---------------------------------------------- | |
110 | ||
111 | long_bits : constant := Long_Integer'Size; | |
112 | -- Number of bits in type long and unsigned_long. The normal convention | |
113 | -- is that this is the same as type Long_Integer, but this is not true | |
114 | -- of all targets. For example, in OpenVMS long /= Long_Integer. | |
115 | ||
116 | ---------------------------------------------- | |
117 | -- Behavior of Pragma Finalize_Storage_Only -- | |
118 | ---------------------------------------------- | |
119 | ||
120 | -- Garbage_Collected is a Boolean constant whose value indicates the | |
121 | -- effect of the pragma Finalize_Storage_Entry on a controlled type. | |
122 | ||
123 | -- Garbage_Collected = False | |
124 | ||
125 | -- The system releases all storage on program termination only, | |
126 | -- but not other garbage collection occurs, so finalization calls | |
127 | -- are ommitted only for outer level onjects can be omitted if | |
128 | -- pragma Finalize_Storage_Only is used. | |
129 | ||
130 | -- Garbage_Collected = True | |
131 | ||
132 | -- The system provides full garbage collection, so it is never | |
133 | -- necessary to release storage for controlled objects for which | |
134 | -- a pragma Finalize_Storage_Only is used. | |
135 | ||
136 | Garbage_Collected : constant Boolean := False; | |
137 | -- The storage mode for this system (release on program exit) | |
138 | ||
07fc65c4 GB |
139 | --------------------- |
140 | -- Tasking Profile -- | |
141 | --------------------- | |
142 | ||
143 | -- In the following sections, constant parameters are defined to | |
fbf5a39b AC |
144 | -- allow some optimizations and fine tuning within the tasking run time |
145 | -- based on restrictions on the tasking features. | |
07fc65c4 GB |
146 | |
147 | ---------------------- | |
148 | -- Locking Strategy -- | |
149 | ---------------------- | |
150 | ||
151 | Single_Lock : constant Boolean := False; | |
152 | -- Indicates whether a single lock should be used within the tasking | |
153 | -- run-time to protect internal structures. If True, a single lock | |
154 | -- will be used, meaning less locking/unlocking operations, but also | |
155 | -- more global contention. In general, Single_Lock should be set to | |
156 | -- True on single processor machines, and to False to multi-processor | |
157 | -- systems, but this can vary from application to application and also | |
158 | -- depends on the scheduling policy. | |
159 | ||
160 | ------------------- | |
161 | -- Task Abortion -- | |
162 | ------------------- | |
163 | ||
164 | No_Abort : constant Boolean := False; | |
165 | -- This constant indicates whether abort statements and asynchronous | |
166 | -- transfer of control (ATC) are disallowed. If set to True, it is | |
167 | -- assumed that neither construct is used, and the run time does not | |
168 | -- need to defer/undefer abort and check for pending actions at | |
169 | -- completion points. A value of True for No_Abort corresponds to: | |
170 | -- pragma Restrictions (No_Abort_Statements); | |
171 | -- pragma Restrictions (Max_Asynchronous_Select_Nesting => 0); | |
172 | ||
173 | ---------------------- | |
174 | -- Dynamic Priority -- | |
175 | ---------------------- | |
176 | ||
177 | Dynamic_Priority_Support : constant Boolean := True; | |
178 | -- This constant indicates whether dynamic changes of task priorities | |
179 | -- are allowed (True means normal RM mode in which such changes are | |
180 | -- allowed). In particular, if this is False, then we do not need to | |
181 | -- poll for pending base priority changes at every abort completion | |
182 | -- point. A value of False for Dynamic_Priority_Support corresponds | |
183 | -- to pragma Restrictions (No_Dynamic_Priorities); | |
184 | ||
fbf5a39b AC |
185 | --------------------- |
186 | -- Task Attributes -- | |
187 | --------------------- | |
188 | ||
189 | Default_Attribute_Count : constant := 4; | |
190 | -- Number of pre-allocated Address-sized task attributes stored in the | |
191 | -- task control block. | |
192 | ||
07fc65c4 GB |
193 | -------------------- |
194 | -- Runtime Traces -- | |
195 | -------------------- | |
196 | ||
197 | Runtime_Traces : constant Boolean := False; | |
198 | -- This constant indicates whether the runtime outputs traces to a | |
199 | -- predefined output or not (True means that traces are output). | |
200 | -- See System.Traces for more details. | |
201 | ||
cacbc350 | 202 | end System.Parameters; |