File : s-init.ads


   1 ------------------------------------------------------------------------------
   2 --                                                                          --
   3 --                  GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS                --
   4 --                                                                          --
   5 --                             S Y S T E M . I N I T                        --
   6 --                                                                          --
   7 --                                   S p e c                                --
   8 --                                                                          --
   9 --          Copyright (C) 2003-2015, 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 --                                                                          --
  19 --                                                                          --
  20 --                                                                          --
  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 -- GNARL was developed by the GNARL team at Florida State University.       --
  28 -- Extensive contributions were provided by AdaCore.                        --
  29 --                                                                          --
  30 ------------------------------------------------------------------------------
  31 
  32 --  This unit contains initialization circuits that are system dependent
  33 
  34 --  This package is for use with configurable runtimes, and replaces init.c
  35 
  36 pragma Restrictions (No_Elaboration_Code);
  37 --  The procedure Install_Handler is called by the binder generated file before
  38 --  any elaboration code, so we use the No_Elaboration_Code restriction to be
  39 --  enfore full static preelaboration.
  40 
  41 package System.Init is
  42    pragma Preelaborate;
  43 
  44    procedure Install_Handler;
  45    pragma Export (C, Install_Handler, "__gnat_install_handler");
  46    --  Install signal handlers. This procedure is called by Runtime_Initialize,
  47    --  but it may also be called by the tasking runtime when a task is created.
  48 
  49    procedure Runtime_Initialize;
  50    pragma Export (C, Runtime_Initialize, "__gnat_runtime_initialize");
  51    --  This procedure is called by adainit before the elaboration of other
  52    --  units. It usually installs handler for the synchronous signals. The C
  53    --  profile here is what is expected by the binder-generated main.
  54 
  55    procedure Runtime_Finalize;
  56    pragma Export (C, Runtime_Finalize, "__gnat_runtime_finalize");
  57    --  This procedure is called by adafinal.
  58 private
  59    -----------------------------
  60    -- Binder Generated Values --
  61    -----------------------------
  62 
  63    Gl_Leap_Seconds_Support : Integer := 0;
  64    pragma Export (C, Gl_Leap_Seconds_Support, "__gl_leap_seconds_support");
  65 
  66    Gl_Time_Slice_Val : Integer := -1;
  67    pragma Export (C, Gl_Time_Slice_Val, "__gl_time_slice_val");
  68 
  69    Gl_Wc_Encoding : Character := 'n';
  70    pragma Export (C, Gl_Wc_Encoding, "__gl_wc_encoding");
  71 
  72    Gl_Locking_Policy : Character := ' ';
  73    pragma Export (C, Gl_Locking_Policy, "__gl_locking_policy");
  74 
  75    Gl_Queuing_Policy : Character := ' ';
  76    pragma Export (C, Gl_Queuing_Policy, "__gl_queuing_policy");
  77 
  78    Gl_Task_Dispatching_Policy : Character := ' ';
  79    pragma Export (C, Gl_Task_Dispatching_Policy,
  80                      "__gl_task_dispatching_policy");
  81 
  82    Gl_Priority_Specific_Dispatching : Address := Null_Address;
  83    pragma Export (C, Gl_Priority_Specific_Dispatching,
  84                      "__gl_priority_specific_dispatching");
  85 
  86    Gl_Num_Specific_Dispatching : Integer := 0;
  87    pragma Export (C, Gl_Num_Specific_Dispatching,
  88                   "__gl_num_specific_dispatching");
  89 
  90    Gl_Restrictions : Address := Null_Address;
  91    pragma Export (C, Gl_Restrictions, "__gl_restrictions");
  92 
  93    Gl_Interrupt_States : Address := Null_Address;
  94    pragma Export (C, Gl_Interrupt_States, "__gl_interrupt_states");
  95 
  96    Gl_Num_Interrupt_States : Integer := 0;
  97    pragma Export (C, Gl_Num_Interrupt_States, "__gl_num_interrupt_states");
  98 
  99    Gl_Unreserve_All_Interrupts : Integer := 0;
 100    pragma Export (C, Gl_Unreserve_All_Interrupts,
 101                   "__gl_unreserve_all_interrupts");
 102 
 103    Gl_Exception_Tracebacks : Integer := 0;
 104    pragma Export (C, Gl_Exception_Tracebacks, "__gl_exception_tracebacks");
 105 
 106    Gl_Exception_Tracebacks_Symbolic : Integer := 0;
 107    pragma Export (C, Gl_Exception_Tracebacks_Symbolic,
 108                   "__gl_exception_tracebacks_symbolic");
 109 
 110    Gl_Detect_Blocking : Integer := 0;
 111    pragma Export (C, Gl_Detect_Blocking, "__gl_detect_blocking");
 112 
 113    Gl_Default_Stack_Size : Integer := 0;
 114    pragma Export (C, Gl_Default_Stack_Size, "__gl_default_stack_size");
 115 
 116    Gl_Bind_Env_Addr : Address := Null_Address;
 117    pragma Export (C, Gl_Bind_Env_Addr, "__gl_bind_env_addr");
 118 
 119    --  The following two variables are deliberately commented out. They are
 120    --  referenced by the binder generated file, but they cannot be shared among
 121    --  different versions of System.Init. The reason is that the ravenscar
 122    --  version of System.Tasking (s-taskin-raven.adb) redefines these variables
 123    --  because the ravenscar/sfp runtime doesn't use System.Init, while the
 124    --  ravenscar/full runtime does.
 125 
 126    --  Gl_Main_Priority : Integer := -1;
 127    --  pragma Export (C, Gl_Main_Priority, "__gl_main_priority");
 128 
 129    --  Gl_Main_CPU : Integer := -1;
 130    --  pragma Export (C, Gl_Main_CPU, "__gl_main_cpu");
 131 
 132 end System.Init;