annotate gcc/ada/libgnat/s-parint.ads @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
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 RUN-TIME COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- S Y S T E M . P A R T I T I O N _ I N T E R F A C E --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
9 -- Copyright (C) 1995-2019, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNARL 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 unit may be used directly from an application program by providing
kono
parents:
diff changeset
33 -- an appropriate WITH, and the interface can be expected to remain stable.
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 with Ada.Exceptions;
kono
parents:
diff changeset
36 with Ada.Streams;
kono
parents:
diff changeset
37 with Interfaces;
kono
parents:
diff changeset
38 with System.RPC;
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 package System.Partition_Interface is
kono
parents:
diff changeset
41 pragma Elaborate_Body;
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 type DSA_Implementation_Name is (No_DSA, GARLIC_DSA, PolyORB_DSA);
kono
parents:
diff changeset
44 DSA_Implementation : constant DSA_Implementation_Name := No_DSA;
kono
parents:
diff changeset
45 -- Identification of this DSA implementation variant
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 PCS_Version : constant := 1;
kono
parents:
diff changeset
48 -- Version of the PCS API (for Exp_Dist consistency check)
kono
parents:
diff changeset
49 --
kono
parents:
diff changeset
50 -- This version number is matched against corresponding element of
kono
parents:
diff changeset
51 -- Exp_Dist.PCS_Version_Number to ensure that the versions of Exp_Dist
kono
parents:
diff changeset
52 -- and the PCS are consistent.
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 -- RCI receiving stubs contain a table of descriptors for all user
kono
parents:
diff changeset
55 -- subprograms exported by the unit.
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 type Subprogram_Id is new Natural;
kono
parents:
diff changeset
58 First_RCI_Subprogram_Id : constant := 2;
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 type RCI_Subp_Info is record
kono
parents:
diff changeset
61 Addr : System.Address;
kono
parents:
diff changeset
62 -- Local address of the proxy object
kono
parents:
diff changeset
63 end record;
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 type RCI_Subp_Info_Access is access all RCI_Subp_Info;
kono
parents:
diff changeset
66 type RCI_Subp_Info_Array is array (Integer range <>) of
kono
parents:
diff changeset
67 aliased RCI_Subp_Info;
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 subtype Unit_Name is String;
kono
parents:
diff changeset
70 -- Name of Ada units
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 type Main_Subprogram_Type is access procedure;
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 type RACW_Stub_Type is tagged record
kono
parents:
diff changeset
75 Origin : RPC.Partition_ID;
kono
parents:
diff changeset
76 Receiver : Interfaces.Unsigned_64;
kono
parents:
diff changeset
77 Addr : Interfaces.Unsigned_64;
kono
parents:
diff changeset
78 Asynchronous : Boolean;
kono
parents:
diff changeset
79 end record;
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 type RACW_Stub_Type_Access is access RACW_Stub_Type;
kono
parents:
diff changeset
82 -- This type is used by the expansion to implement distributed objects.
kono
parents:
diff changeset
83 -- Do not change its definition or its layout without updating
kono
parents:
diff changeset
84 -- exp_dist.adb.
kono
parents:
diff changeset
85
kono
parents:
diff changeset
86 type RAS_Proxy_Type is tagged limited record
kono
parents:
diff changeset
87 All_Calls_Remote : Boolean;
kono
parents:
diff changeset
88 Receiver : System.Address;
kono
parents:
diff changeset
89 Subp_Id : Subprogram_Id;
kono
parents:
diff changeset
90 end record;
kono
parents:
diff changeset
91
kono
parents:
diff changeset
92 type RAS_Proxy_Type_Access is access RAS_Proxy_Type;
kono
parents:
diff changeset
93 pragma No_Strict_Aliasing (RAS_Proxy_Type_Access);
kono
parents:
diff changeset
94 -- This type is used by the expansion to implement distributed objects.
kono
parents:
diff changeset
95 -- Do not change its definition or its layout without updating
kono
parents:
diff changeset
96 -- Exp_Dist.Build_Remote_Subprogram_Proxy_Type.
kono
parents:
diff changeset
97
kono
parents:
diff changeset
98 -- The Request_Access type is used for communication between the PCS
kono
parents:
diff changeset
99 -- and the RPC receiver generated by the compiler: it contains all the
kono
parents:
diff changeset
100 -- necessary information for the receiver to process an incoming call.
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 type RST_Access is access all Ada.Streams.Root_Stream_Type'Class;
kono
parents:
diff changeset
103 type Request_Access is record
kono
parents:
diff changeset
104 Params : RST_Access;
kono
parents:
diff changeset
105 -- A stream describing the called subprogram and its parameters
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 Result : RST_Access;
kono
parents:
diff changeset
108 -- A stream where the result, raised exception, or out values,
kono
parents:
diff changeset
109 -- are marshalled.
kono
parents:
diff changeset
110 end record;
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 procedure Check
kono
parents:
diff changeset
113 (Name : Unit_Name;
kono
parents:
diff changeset
114 Version : String;
kono
parents:
diff changeset
115 RCI : Boolean := True);
kono
parents:
diff changeset
116 -- Use by the main subprogram to check that a remote receiver
kono
parents:
diff changeset
117 -- unit has the same version than the caller's one.
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 function Same_Partition
kono
parents:
diff changeset
120 (Left : not null access RACW_Stub_Type;
kono
parents:
diff changeset
121 Right : not null access RACW_Stub_Type) return Boolean;
kono
parents:
diff changeset
122 -- Determine whether Left and Right correspond to objects instantiated
kono
parents:
diff changeset
123 -- on the same partition, for enforcement of E.4(19).
kono
parents:
diff changeset
124
kono
parents:
diff changeset
125 function Get_Active_Partition_ID (Name : Unit_Name) return RPC.Partition_ID;
kono
parents:
diff changeset
126 -- Similar in some respects to RCI_Locator.Get_Active_Partition_ID
kono
parents:
diff changeset
127
kono
parents:
diff changeset
128 function Get_Active_Version (Name : Unit_Name) return String;
kono
parents:
diff changeset
129 -- Similar in some respects to Get_Active_Partition_ID
kono
parents:
diff changeset
130
kono
parents:
diff changeset
131 function Get_Local_Partition_ID return RPC.Partition_ID;
kono
parents:
diff changeset
132 -- Return the Partition_ID of the current partition
kono
parents:
diff changeset
133
kono
parents:
diff changeset
134 function Get_Passive_Partition_ID
kono
parents:
diff changeset
135 (Name : Unit_Name) return RPC.Partition_ID;
kono
parents:
diff changeset
136 -- Return the Partition_ID of the given shared passive partition
kono
parents:
diff changeset
137
kono
parents:
diff changeset
138 function Get_Passive_Version (Name : Unit_Name) return String;
kono
parents:
diff changeset
139 -- Return the version corresponding to a shared passive unit
kono
parents:
diff changeset
140
kono
parents:
diff changeset
141 function Get_RCI_Package_Receiver
kono
parents:
diff changeset
142 (Name : Unit_Name) return Interfaces.Unsigned_64;
kono
parents:
diff changeset
143 -- Similar in some respects to RCI_Locator.Get_RCI_Package_Receiver
kono
parents:
diff changeset
144
kono
parents:
diff changeset
145 procedure Get_Unique_Remote_Pointer
kono
parents:
diff changeset
146 (Handler : in out RACW_Stub_Type_Access);
kono
parents:
diff changeset
147 -- Get a unique pointer on a remote object
kono
parents:
diff changeset
148
kono
parents:
diff changeset
149 procedure Raise_Program_Error_Unknown_Tag
kono
parents:
diff changeset
150 (E : Ada.Exceptions.Exception_Occurrence);
kono
parents:
diff changeset
151 pragma No_Return (Raise_Program_Error_Unknown_Tag);
kono
parents:
diff changeset
152 -- Raise Program_Error with the same message as E one
kono
parents:
diff changeset
153
kono
parents:
diff changeset
154 type RPC_Receiver is access procedure (R : Request_Access);
kono
parents:
diff changeset
155 procedure Register_Receiving_Stub
kono
parents:
diff changeset
156 (Name : Unit_Name;
kono
parents:
diff changeset
157 Receiver : RPC_Receiver;
kono
parents:
diff changeset
158 Version : String := "";
kono
parents:
diff changeset
159 Subp_Info : System.Address;
kono
parents:
diff changeset
160 Subp_Info_Len : Integer);
kono
parents:
diff changeset
161 -- Register the fact that the Name receiving stub is now elaborated.
kono
parents:
diff changeset
162 -- Register the access value to the package RPC_Receiver procedure.
kono
parents:
diff changeset
163
kono
parents:
diff changeset
164 procedure Get_RAS_Info
kono
parents:
diff changeset
165 (Name : Unit_Name;
kono
parents:
diff changeset
166 Subp_Id : Subprogram_Id;
kono
parents:
diff changeset
167 Proxy_Address : out Interfaces.Unsigned_64);
kono
parents:
diff changeset
168 -- Look up the address of the proxy object for the given subprogram
kono
parents:
diff changeset
169 -- in the named unit, or Null_Address if not present on the local
kono
parents:
diff changeset
170 -- partition.
kono
parents:
diff changeset
171
kono
parents:
diff changeset
172 procedure Register_Passive_Package
kono
parents:
diff changeset
173 (Name : Unit_Name;
kono
parents:
diff changeset
174 Version : String := "");
kono
parents:
diff changeset
175 -- Register a passive package
kono
parents:
diff changeset
176
kono
parents:
diff changeset
177 generic
kono
parents:
diff changeset
178 RCI_Name : String;
kono
parents:
diff changeset
179 Version : String;
kono
parents:
diff changeset
180 package RCI_Locator is
kono
parents:
diff changeset
181 pragma Unreferenced (Version);
kono
parents:
diff changeset
182
kono
parents:
diff changeset
183 function Get_RCI_Package_Receiver return Interfaces.Unsigned_64;
kono
parents:
diff changeset
184 function Get_Active_Partition_ID return RPC.Partition_ID;
kono
parents:
diff changeset
185 end RCI_Locator;
kono
parents:
diff changeset
186 -- RCI package information caching
kono
parents:
diff changeset
187
kono
parents:
diff changeset
188 procedure Run (Main : Main_Subprogram_Type := null);
kono
parents:
diff changeset
189 -- Run the main subprogram
kono
parents:
diff changeset
190
kono
parents:
diff changeset
191 end System.Partition_Interface;