File : s-init.adb
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
4 -- --
5 -- S Y S T E M . I N I T --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 2003-2014, 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 Ada Core Technologies, Inc. --
29 -- --
30 ------------------------------------------------------------------------------
31
32 -- This is a bare board implementation of this package
33
34 with System.BB.CPU_Primitives;
35 with System.BB.Parameters; use System.BB.Parameters;
36 with System.Tasking;
37
38 package body System.Init is
39
40 ------------------------
41 -- Local procedures --
42 ------------------------
43
44 -- These procedures are called by the binder.
45
46 procedure Initialize;
47 pragma Export (C, Initialize, "__gnat_initialize");
48
49 procedure Finalize;
50 pragma Export (C, Finalize, "__gnat_finalize");
51
52 --------------
53 -- Finalize --
54 --------------
55
56 procedure Finalize is
57 begin
58 null;
59 end Finalize;
60
61 ----------------
62 -- Initialize --
63 ----------------
64
65 procedure Initialize is
66 begin
67 null;
68 end Initialize;
69
70 ---------------------
71 -- Install_Handler --
72 ---------------------
73
74 procedure Install_Handler is
75 begin
76 BB.CPU_Primitives.Install_Error_Handlers;
77 end Install_Handler;
78
79 ------------------------
80 -- Runtime_Initialize --
81 ------------------------
82
83 procedure Runtime_Initialize is
84 begin
85 -- Ensure that the tasking run time is initialized when using this run
86 -- time. This initialization is required by the support for exceptions
87 -- (which uses thread local storage). The initialization routine has the
88 -- required machinery to prevent multiple calls to Initialize.
89
90 System.Tasking.Initialize;
91
92 Install_Handler;
93 end Runtime_Initialize;
94
95 ----------------------
96 -- Runtime_Finalize --
97 ----------------------
98
99 procedure Runtime_Finalize is
100 begin
101 null;
102 end Runtime_Finalize;
103 end System.Init;