OSDN Git Service

2011-08-01 Ed Schonberg <schonberg@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-parame-vms-ia64.ads
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-2010, 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 Integrity OpenVMS version
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    subtype Ratio is Size_Type range -1 .. 100;
66    Dynamic : constant Size_Type := -1;
67    --  The secondary stack ratio is a constant between 0 and 100 which
68    --  determines the percentage of the allocated task stack that is
69    --  used by the secondary stack (the rest being the primary stack).
70    --  The special value of minus one indicates that the secondary
71    --  stack is to be allocated from the heap instead.
72
73    Sec_Stack_Ratio : constant Ratio := Dynamic;
74    --  This constant defines the handling of the secondary stack
75
76    Sec_Stack_Dynamic : constant Boolean := Sec_Stack_Ratio = Dynamic;
77    --  Convenient Boolean for testing for dynamic secondary stack
78
79    function Default_Stack_Size return Size_Type;
80    --  Default task stack size used if none is specified
81
82    function Minimum_Stack_Size return Size_Type;
83    --  Minimum task stack size permitted
84
85    function Adjust_Storage_Size (Size : Size_Type) return Size_Type;
86    --  Given the storage size stored in the TCB, return the Storage_Size
87    --  value required by the RM for the Storage_Size attribute. The
88    --  required adjustment is as follows:
89    --
90    --    when Size = Unspecified_Size, return Default_Stack_Size
91    --    when Size < Minimum_Stack_Size, return Minimum_Stack_Size
92    --    otherwise return given Size
93
94    Default_Env_Stack_Size : constant Size_Type := 8_192_000;
95    --  Assumed size of the environment task, if no other information
96    --  is available. This value is used when stack checking is
97    --  enabled and no GNAT_STACK_LIMIT environment variable is set.
98
99    Stack_Grows_Down  : constant Boolean := True;
100    --  This constant indicates whether the stack grows up (False) or
101    --  down (True) in memory as functions are called. It is used for
102    --  proper implementation of the stack overflow check.
103
104    ----------------------------------------------
105    -- Characteristics of types in Interfaces.C --
106    ----------------------------------------------
107
108    long_bits : constant := 32;
109    --  Number of bits in type long and unsigned_long. The normal convention
110    --  is that this is the same as type Long_Integer, but this is not true
111    --  of all targets. For example, in OpenVMS long /= Long_Integer.
112
113    ptr_bits  : constant := 32;
114    subtype C_Address is System.Address
115      range -2 ** (ptr_bits - 1) .. 2 ** (ptr_bits - 1) - 1;
116    for C_Address'Object_Size use ptr_bits;
117    --  Number of bits in Interaces.C pointers, normally a standard address,
118    --  except on 64-bit VMS where they are 32-bit addresses, for compatibility
119    --  with legacy code.
120    --  System.Aux_DEC.Short_Address can't be used because of elaboration
121    --  circularity.
122
123    C_Malloc_Linkname : constant String := "__gnat_malloc32";
124    --  Name of runtime function used to allocate such a pointer
125
126    ----------------------------------------------
127    -- Behavior of Pragma Finalize_Storage_Only --
128    ----------------------------------------------
129
130    --  Garbage_Collected is a Boolean constant whose value indicates the
131    --  effect of the pragma Finalize_Storage_Entry on a controlled type.
132
133    --    Garbage_Collected = False
134
135    --      The system releases all storage on program termination only,
136    --      but not other garbage collection occurs, so finalization calls
137    --      are omitted only for outer level objects can be omitted if
138    --      pragma Finalize_Storage_Only is used.
139
140    --    Garbage_Collected = True
141
142    --      The system provides full garbage collection, so it is never
143    --      necessary to release storage for controlled objects for which
144    --      a pragma Finalize_Storage_Only is used.
145
146    Garbage_Collected : constant Boolean := False;
147    --  The storage mode for this system (release on program exit)
148
149    ---------------------
150    -- Tasking Profile --
151    ---------------------
152
153    --  In the following sections, constant parameters are defined to
154    --  allow some optimizations and fine tuning within the tasking run time
155    --  based on restrictions on the tasking features.
156
157    ----------------------
158    -- Locking Strategy --
159    ----------------------
160
161    Single_Lock : constant Boolean := False;
162    --  Indicates whether a single lock should be used within the tasking
163    --  run-time to protect internal structures. If True, a single lock
164    --  will be used, meaning less locking/unlocking operations, but also
165    --  more global contention. In general, Single_Lock should be set to
166    --  True on single processor machines, and to False to multi-processor
167    --  systems, but this can vary from application to application and also
168    --  depends on the scheduling policy.
169
170    -------------------
171    -- Task Abortion --
172    -------------------
173
174    No_Abort : constant Boolean := False;
175    --  This constant indicates whether abort statements and asynchronous
176    --  transfer of control (ATC) are disallowed. If set to True, it is
177    --  assumed that neither construct is used, and the run time does not
178    --  need to defer/undefer abort and check for pending actions at
179    --  completion points. A value of True for No_Abort corresponds to:
180    --  pragma Restrictions (No_Abort_Statements);
181    --  pragma Restrictions (Max_Asynchronous_Select_Nesting => 0);
182
183    ---------------------
184    -- Task Attributes --
185    ---------------------
186
187    Default_Attribute_Count : constant := 4;
188    --  Number of pre-allocated Address-sized task attributes stored in the
189    --  task control block.
190
191    --------------------
192    -- Runtime Traces --
193    --------------------
194
195    Runtime_Traces : constant Boolean := False;
196    --  This constant indicates whether the runtime outputs traces to a
197    --  predefined output or not (True means that traces are output).
198    --  See System.Traces for more details.
199
200    -----------------------
201    -- Task Image Length --
202    -----------------------
203
204    Max_Task_Image_Length : constant := 256;
205    --  This constant specifies the maximum length of a task's image
206
207    ------------------------------
208    -- Exception Message Length --
209    ------------------------------
210
211    Default_Exception_Msg_Max_Length : constant := 512;
212    --  This constant specifies the maximum number of characters to allow in an
213    --  exception message (see RM 11.4.1(18)). The value for VMS exceeds the
214    --  default minimum of 200 to allow for the length of chained VMS condition
215    --  handling messages.
216
217 end System.Parameters;