annotate gcc/ada/libgnat/s-parame__vxworks.ads @ 131:84e7813d76e9

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