File : s-parame.ads


     ------------------------------------------------------------------------------
     --                                                                          --
     --                         GNAT COMPILER COMPONENTS                         --
     --                                                                          --
   5 --                    S Y S T E M . P A R A M E T E R S                     --
     --                                                                          --
     --                                 S p e c                                  --
     --                                                                          --
     --                            $Revision: 1.45 $
  10 --                                                                          --
     --          Copyright (C) 1992-2001 Free Software Foundation, Inc.          --
     --                                                                          --
     -- GNAT is free software;  you can  redistribute it  and/or modify it under --
     -- terms of the  GNU General Public License as published  by the Free Soft- --
  15 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
     -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
     -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
     -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
     -- for  more details.  You should have  received  a copy of the GNU General --
  20 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
     -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
     -- MA 02111-1307, USA.                                                      --
     --                                                                          --
     -- As a special exception,  if other files  instantiate  generics from this --
  25 -- unit, or you link  this unit with other files  to produce an executable, --
     -- this  unit  does not  by itself cause  the resulting  executable  to  be --
     -- covered  by the  GNU  General  Public  License.  This exception does not --
     -- however invalidate  any other reasons why  the executable file  might be --
     -- covered by the  GNU Public License.                                      --
  30 --                                                                          --
     -- GNAT was originally developed  by the GNAT team at  New York University. --
     -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
     --                                                                          --
     ------------------------------------------------------------------------------
  35 
     --  This is the default version used for all systems for which no special
     --  target-specific version of this package is provided.
     
     --  This package defines some system dependent parameters for GNAT. These
  40 --  are values that are referenced by the runtime library and are therefore
     --  relevant to the target machine.
     
     --  The parameters whose value is defined in the spec are not generally
     --  expected to be changed. If they are changed, it will be necessary to
  45 --  recompile the run-time library.
     
     --  The parameters which are defined by functions can be changed by modifying
     --  the body of System.Parameters in file s-parame.adb. A change to this body
     --  requires only rebinding and relinking of the application.
  50 
     --  Note: do not introduce any pragma Inline statements into this unit, since
     --  otherwise the relinking and rebinding capability would be deactivated.
     
     package System.Parameters is
  55 pragma Pure (Parameters);
     
        ---------------------------------------
        -- Task And Stack Allocation Control --
        ---------------------------------------
  60 
        type Task_Storage_Size is new Integer;
        --  Type used in tasking units for task storage size
     
        type Size_Type is new Task_Storage_Size;
  65    --  Type used to provide task storage size to runtime
     
        Unspecified_Size : constant Size_Type := Size_Type'First;
        --  Value used to indicate that no size type is set
     
  70    subtype Ratio is Size_Type range -1 .. 100;
        Dynamic : constant Size_Type := -1;
        --  The secondary stack ratio is a constant between 0 and 100 which
        --  determines the percentage of the allocated task stack that is
        --  used by the secondary stack (the rest being the primary stack).
  75    --  The special value of minus one indicates that the secondary
        --  stack is to be allocated from the heap instead.
     
        Sec_Stack_Ratio : constant Ratio := Dynamic;
        --  This constant defines the handling of the secondary stack
  80 
        Sec_Stack_Dynamic : constant Boolean := Sec_Stack_Ratio = Dynamic;
        --  Convenient Boolean for testing for dynamic secondary stack
     
        function Default_Stack_Size return Size_Type;
  85    --  Default task stack size used if none is specified
     
        function Minimum_Stack_Size return Size_Type;
        --  Minimum task stack size permitted
     
  90    function Adjust_Storage_Size (Size : Size_Type) return Size_Type;
        --  Given the storage size stored in the TCB, return the Storage_Size
        --  value required by the RM for the Storage_Size attribute. The
        --  required adjustment is as follows:
        --
  95    --    when Size = Unspecified_Size, return Default_Stack_Size
        --    when Size < Minimum_Stack_Size, return Minimum_Stack_Size
        --    otherwise return given Size
     
        Stack_Grows_Down  : constant Boolean := True;
 100    --  This constant indicates whether the stack grows up (False) or
        --  down (True) in memory as functions are called. It is used for
        --  proper implementation of the stack overflow check.
     
        ----------------------------------------------
 105    -- Characteristics of types in Interfaces.C --
        ----------------------------------------------
     
        long_bits : constant := Long_Integer'Size;
        --  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
        --  of all targets. For example, in OpenVMS long /= Long_Integer.
     
        ----------------------------------------------
        -- Behavior of Pragma Finalize_Storage_Only --
 115    ----------------------------------------------
     
        --  Garbage_Collected is a Boolean constant whose value indicates the
        --  effect of the pragma Finalize_Storage_Entry on a controlled type.
     
 120    --    Garbage_Collected = False
     
        --      The system releases all storage on program termination only,
        --      but not other garbage collection occurs, so finalization calls
        --      are ommitted only for outer level onjects can be omitted if
 125    --      pragma Finalize_Storage_Only is used.
     
        --    Garbage_Collected = True
     
        --      The system provides full garbage collection, so it is never
 130    --      necessary to release storage for controlled objects for which
        --      a pragma Finalize_Storage_Only is used.
     
        Garbage_Collected : constant Boolean := False;
        --  The storage mode for this system (release on program exit)
 135 
        ---------------------
        -- Tasking Profile --
        ---------------------
     
 140    --  In the following sections, constant parameters are defined to
        --  allow some optimizations within the tasking run time based on
        --  restrictions on the tasking features.
     
        ----------------------
 145    -- Locking Strategy --
        ----------------------
     
        Single_Lock : constant Boolean := False;
        --  Indicates whether a single lock should be used within the tasking
 150    --  run-time to protect internal structures. If True, a single lock
        --  will be used, meaning less locking/unlocking operations, but also
        --  more global contention. In general, Single_Lock should be set to
        --  True on single processor machines, and to False to multi-processor
        --  systems, but this can vary from application to application and also
 155    --  depends on the scheduling policy.
     
        -------------------
        -- Task Abortion --
        -------------------
 160 
        No_Abort : constant Boolean := False;
        --  This constant indicates whether abort statements and asynchronous
        --  transfer of control (ATC) are disallowed. If set to True, it is
        --  assumed that neither construct is used, and the run time does not
 165    --  need to defer/undefer abort and check for pending actions at
        --  completion points. A value of True for No_Abort corresponds to:
        --  pragma Restrictions (No_Abort_Statements);
        --  pragma Restrictions (Max_Asynchronous_Select_Nesting => 0);
     
 170    ----------------------
        -- Dynamic Priority --
        ----------------------
     
        Dynamic_Priority_Support : constant Boolean := True;
 175    --  This constant indicates whether dynamic changes of task priorities
        --  are allowed (True means normal RM mode in which such changes are
        --  allowed). In particular, if this is False, then we do not need to
        --  poll for pending base priority changes at every abort completion
        --  point. A value of False for Dynamic_Priority_Support corresponds
 180    --  to pragma Restrictions (No_Dynamic_Priorities);
     
        --------------------
        -- Runtime Traces --
        --------------------
 185 
        Runtime_Traces : constant Boolean := False;
        --  This constant indicates whether the runtime outputs traces to a
        --  predefined output or not (True means that traces are output).
        --  See System.Traces for more details.
 190 
     end System.Parameters;