Debian Codegraph @

gcc/ada/libgnat/s-parame.ads

raw
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-2025, 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 -- Default version used when no target-specific version is provided
33
34 -- This package defines a number of system-dependent parameters for GNAT.
35 -- These are values that are referenced by the runtime library and are
36 -- therefore relevant to the target machine. This includes the default and
37 -- minimum size and the length of a task name.
38
39 -- The parameters whose value is defined in the spec are not generally
40 -- expected to be changed. If they are changed, it will be necessary to
41 -- recompile the run-time library.
42
43 -- The parameters which are defined by functions can be changed by modifying
44 -- the body of System.Parameters in file s-parame.adb. A change to this body
45 -- requires only rebinding and relinking of the application.
46
47 -- Note: do not introduce any pragma Inline statements into this unit, since
48 -- otherwise the relinking and rebinding capability would be deactivated.
49
50 package System.Parameters is
51 pragma Pure;
52
53 ---------------------------------------
54 -- Task And Stack Allocation Control --
55 ---------------------------------------
56
57 type Size_Type is range -Memory_Size / 2 .. Memory_Size / 2 - 1;
58 -- Type used to provide task stack sizes to the runtime. Sized to permit
59 -- stack sizes of up to half the total addressable memory space. This may
60 -- seem excessively large (even for 32-bit systems), however there are many
61 -- instances of users requiring large stack sizes (for example string
62 -- processing).
63
64 Unspecified_Size : constant Size_Type := Size_Type'First;
65 -- Value used to indicate that no size type is set
66
67 function Default_Stack_Size return Size_Type;
68 -- Default task stack size used if none is specified
69
70 function Minimum_Stack_Size return Size_Type;
71 -- Minimum task stack size permitted
72
73 function Adjust_Storage_Size (Size : Size_Type) return Size_Type;
74 -- Given the storage size stored in the TCB, return the Storage_Size
75 -- value required by the RM for the Storage_Size attribute. The
76 -- required adjustment is as follows:
77 --
78 -- when Size = Unspecified_Size, return Default_Stack_Size
79 -- when Size < Minimum_Stack_Size, return Minimum_Stack_Size
80 -- otherwise return given Size
81
82 Default_Env_Stack_Size : constant Size_Type := 8_192_000;
83 -- Assumed size of the environment task, if no other information is
84 -- available. This value is used when stack checking is enabled and
85 -- no GNAT_STACK_LIMIT environment variable is set.
86
87 Stack_Grows_Down : constant Boolean := True;
88 -- This constant indicates whether the stack grows up (False) or
89 -- down (True) in memory as functions are called. It is used for
90 -- proper implementation of the stack overflow check.
91
92 Runtime_Default_Sec_Stack_Size : constant Size_Type := 10 * 1024;
93 -- The run-time chosen default size for secondary stacks that may be
94 -- overridden by the user with the use of binder -D switch.
95
96 Sec_Stack_Dynamic : constant Boolean := True;
97 -- Indicates if secondary stacks can grow and shrink at run-time. If False,
98 -- the size of a secondary stack is fixed at the point of its creation.
99
100 ------------------------------------
101 -- Characteristics of time_t type --
102 ------------------------------------
103
104 time_t_bits : constant := Long_Integer'Size;
105 -- Number of bits in type time_t
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 may not be true
114 -- of all targets.
115
116 ptr_bits : constant := Standard'Address_Size;
117 subtype C_Address is System.Address;
118 -- Number of bits in Interfaces.C pointers, normally a standard address
119
120 C_Malloc_Linkname : constant String := "__gnat_malloc";
121 -- Name of runtime function used to allocate such a pointer
122
123 ----------------------------------------------
124 -- Behavior of Pragma Finalize_Storage_Only --
125 ----------------------------------------------
126
127 -- Garbage_Collected is a Boolean constant whose value indicates the
128 -- effect of the pragma Finalize_Storage_Entry on a controlled type.
129
130 -- Garbage_Collected = False
131
132 -- The system releases all storage on program termination only,
133 -- but not other garbage collection occurs, so finalization calls
134 -- are omitted only for outer level objects can be omitted if
135 -- pragma Finalize_Storage_Only is used.
136
137 -- Garbage_Collected = True
138
139 -- The system provides full garbage collection, so it is never
140 -- necessary to release storage for controlled objects for which
141 -- a pragma Finalize_Storage_Only is used.
142
143 Garbage_Collected : constant Boolean := False;
144 -- The storage mode for this system (release on program exit)
145
146 ---------------------
147 -- Tasking Profile --
148 ---------------------
149
150 -- In the following sections, constant parameters are defined to
151 -- allow some optimizations and fine tuning within the tasking run time
152 -- based on restrictions on the tasking features.
153
154 -------------------
155 -- Task Abortion --
156 -------------------
157
158 No_Abort : constant Boolean := False;
159 -- This constant indicates whether abort statements and asynchronous
160 -- transfer of control (ATC) are disallowed. If set to True, it is
161 -- assumed that neither construct is used, and the run time does not
162 -- need to defer/undefer abort and check for pending actions at
163 -- completion points. A value of True for No_Abort corresponds to:
164 -- pragma Restrictions (No_Abort_Statements);
165 -- pragma Restrictions (Max_Asynchronous_Select_Nesting => 0);
166
167 ---------------------
168 -- Task Attributes --
169 ---------------------
170
171 Max_Attribute_Count : constant := 32;
172 -- Number of task attributes stored in the task control block
173
174 -----------------------
175 -- Task Image Length --
176 -----------------------
177
178 Max_Task_Image_Length : constant := 256;
179 -- This constant specifies the maximum length of a task's image
180
181 ------------------------------
182 -- Exception Message Length --
183 ------------------------------
184
185 Default_Exception_Msg_Max_Length : constant := 200;
186 -- This constant specifies the default number of characters to allow
187 -- in an exception message (200 is minimum required by RM 11.4.1(18)).
188
189 end System.Parameters;