1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
5 -- S Y S T E M . P A R A M E T E R S --
9 -- Copyright (C) 1992-2008, 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, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
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. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 -- This is the default VxWorks version of the package
36 -- This package defines some system dependent parameters for GNAT. These
37 -- are values that are referenced by the runtime library and are therefore
38 -- relevant to the target machine.
40 -- The parameters whose value is defined in the spec are not generally
41 -- expected to be changed. If they are changed, it will be necessary to
42 -- recompile the run-time library.
44 -- The parameters which are defined by functions can be changed by modifying
45 -- the body of System.Parameters in file s-parame.adb. A change to this body
46 -- requires only rebinding and relinking of the application.
48 -- Note: do not introduce any pragma Inline statements into this unit, since
49 -- otherwise the relinking and rebinding capability would be deactivated.
51 package System.Parameters is
54 ---------------------------------------
55 -- Task And Stack Allocation Control --
56 ---------------------------------------
58 type Task_Storage_Size is new Integer;
59 -- Type used in tasking units for task storage size
61 type Size_Type is new Task_Storage_Size;
62 -- Type used to provide task storage size to runtime
64 Unspecified_Size : constant Size_Type := Size_Type'First;
65 -- Value used to indicate that no size type is set
67 subtype Ratio is Size_Type range -1 .. 100;
68 Dynamic : constant Size_Type := -1;
69 -- The secondary stack ratio is a constant between 0 and 100 which
70 -- determines the percentage of the allocated task stack that is
71 -- used by the secondary stack (the rest being the primary stack).
72 -- The special value of minus one indicates that the secondary
73 -- stack is to be allocated from the heap instead.
75 Sec_Stack_Ratio : constant Ratio := Dynamic;
76 -- This constant defines the handling of the secondary stack
78 Sec_Stack_Dynamic : constant Boolean := Sec_Stack_Ratio = Dynamic;
79 -- Convenient Boolean for testing for dynamic secondary stack
81 function Default_Stack_Size return Size_Type;
82 -- Default task stack size used if none is specified
84 function Minimum_Stack_Size return Size_Type;
85 -- Minimum task stack size permitted
87 function Adjust_Storage_Size (Size : Size_Type) return Size_Type;
88 -- Given the storage size stored in the TCB, return the Storage_Size
89 -- value required by the RM for the Storage_Size attribute. The
90 -- required adjustment is as follows:
92 -- when Size = Unspecified_Size, return Default_Stack_Size
93 -- when Size < Minimum_Stack_Size, return Minimum_Stack_Size
94 -- otherwise return given Size
96 Default_Env_Stack_Size : constant Size_Type := 14_336;
97 -- Assumed size of the environment task, if no other information
98 -- is available. This value is used when stack checking is
99 -- enabled and no GNAT_STACK_LIMIT environment variable is set.
100 -- This value is chosen as the VxWorks default stack size is 20kB,
101 -- and a little more than 4kB is necessary for the run time.
103 Stack_Grows_Down : constant Boolean := True;
104 -- This constant indicates whether the stack grows up (False) or
105 -- down (True) in memory as functions are called. It is used for
106 -- proper implementation of the stack overflow check.
108 ----------------------------------------------
109 -- Characteristics of types in Interfaces.C --
110 ----------------------------------------------
112 long_bits : constant := Long_Integer'Size;
113 -- Number of bits in type long and unsigned_long. The normal convention
114 -- is that this is the same as type Long_Integer, but this is not true
115 -- of all targets. For example, in OpenVMS long /= Long_Integer.
117 ----------------------------------------------
118 -- Behavior of Pragma Finalize_Storage_Only --
119 ----------------------------------------------
121 -- Garbage_Collected is a Boolean constant whose value indicates the
122 -- effect of the pragma Finalize_Storage_Entry on a controlled type.
124 -- Garbage_Collected = False
126 -- The system releases all storage on program termination only,
127 -- but not other garbage collection occurs, so finalization calls
128 -- are omitted only for outer level objects can be omitted if
129 -- pragma Finalize_Storage_Only is used.
131 -- Garbage_Collected = True
133 -- The system provides full garbage collection, so it is never
134 -- necessary to release storage for controlled objects for which
135 -- a pragma Finalize_Storage_Only is used.
137 Garbage_Collected : constant Boolean := False;
138 -- The storage mode for this system (release on program exit)
140 ---------------------
141 -- Tasking Profile --
142 ---------------------
144 -- In the following sections, constant parameters are defined to
145 -- allow some optimizations and fine tuning within the tasking run time
146 -- based on restrictions on the tasking features.
148 ----------------------
149 -- Locking Strategy --
150 ----------------------
152 Single_Lock : constant Boolean := False;
153 -- Indicates whether a single lock should be used within the tasking
154 -- run-time to protect internal structures. If True, a single lock
155 -- will be used, meaning less locking/unlocking operations, but also
156 -- more global contention. In general, Single_Lock should be set to
157 -- True on single processor machines, and to False to multi-processor
158 -- systems, but this can vary from application to application and also
159 -- depends on the scheduling policy.
165 No_Abort : constant Boolean := False;
166 -- This constant indicates whether abort statements and asynchronous
167 -- transfer of control (ATC) are disallowed. If set to True, it is
168 -- assumed that neither construct is used, and the run time does not
169 -- need to defer/undefer abort and check for pending actions at
170 -- completion points. A value of True for No_Abort corresponds to:
171 -- pragma Restrictions (No_Abort_Statements);
172 -- pragma Restrictions (Max_Asynchronous_Select_Nesting => 0);
174 ---------------------
175 -- Task Attributes --
176 ---------------------
178 Default_Attribute_Count : constant := 4;
179 -- Number of pre-allocated Address-sized task attributes stored in the
180 -- task control block.
186 Runtime_Traces : constant Boolean := False;
187 -- This constant indicates whether the runtime outputs traces to a
188 -- predefined output or not (True means that traces are output).
189 -- See System.Traces for more details.
191 -----------------------
192 -- Task Image Length --
193 -----------------------
195 Max_Task_Image_Length : constant := 32;
196 -- This constant specifies the maximum length of a task's image
198 ------------------------------
199 -- Exception Message Length --
200 ------------------------------
202 Default_Exception_Msg_Max_Length : constant := 200;
203 -- This constant specifies the default number of characters to allow
204 -- in an exception message (200 is minimum required by RM 11.4.1(18)).
206 end System.Parameters;