]>
Commit | Line | Data |
---|---|---|
cacbc350 RK |
1 | ------------------------------------------------------------------------------ |
2 | -- -- | |
3 | -- GNAT RUN-TIME COMPONENTS -- | |
4 | -- -- | |
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 -- | |
6 | -- -- | |
7 | -- S p e c -- | |
8 | -- -- | |
7324bf49 | 9 | -- Copyright (C) 1995-2004 Free Software Foundation, Inc. -- |
cacbc350 RK |
10 | -- -- |
11 | -- GNARL 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 2, or (at your option) any later ver- -- | |
14 | -- sion. GNARL 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. See the GNU General Public License -- | |
17 | -- for more details. You should have received a copy of the GNU General -- | |
18 | -- Public License distributed with GNARL; see file COPYING. If not, write -- | |
19 | -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- | |
20 | -- MA 02111-1307, USA. -- | |
21 | -- -- | |
22 | -- As a special exception, if other files instantiate generics from this -- | |
23 | -- unit, or you link this unit with other files to produce an executable, -- | |
24 | -- this unit does not by itself cause the resulting executable to be -- | |
25 | -- covered by the GNU General Public License. This exception does not -- | |
26 | -- however invalidate any other reasons why the executable file might be -- | |
27 | -- covered by the GNU Public License. -- | |
28 | -- -- | |
29 | -- GNAT was originally developed by the GNAT team at New York University. -- | |
71ff80dc | 30 | -- Extensive contributions were provided by Ada Core Technologies Inc. -- |
cacbc350 RK |
31 | -- -- |
32 | ------------------------------------------------------------------------------ | |
33 | ||
fbf5a39b AC |
34 | -- This unit may be used directly from an application program by providing |
35 | -- an appropriate WITH, and the interface can be expected to remain stable. | |
36 | ||
cacbc350 | 37 | with Ada.Exceptions; |
16db96c5 | 38 | with Ada.Streams; |
cacbc350 RK |
39 | with Interfaces; |
40 | with System.RPC; | |
41 | ||
42 | package System.Partition_Interface is | |
43 | ||
44 | pragma Elaborate_Body; | |
45 | ||
48ab1182 | 46 | type DSA_Implementation_Name is (No_DSA, GARLIC_DSA, PolyORB_DSA); |
af4b9434 AC |
47 | DSA_Implementation : constant DSA_Implementation_Name := No_DSA; |
48 | ||
c885d7a1 AC |
49 | -- RCI receiving stubs contain a table of descriptors for |
50 | -- all user subprograms exported by the unit. | |
51 | ||
cacbc350 | 52 | type Subprogram_Id is new Natural; |
c885d7a1 AC |
53 | First_RCI_Subprogram_Id : constant := 2; |
54 | ||
55 | type RCI_Subp_Info is record | |
56 | Addr : System.Address; | |
57 | -- Local address of the proxy object | |
58 | end record; | |
59 | ||
60 | type RCI_Subp_Info_Access is access all RCI_Subp_Info; | |
61 | type RCI_Subp_Info_Array is array (Integer range <>) of | |
62 | aliased RCI_Subp_Info; | |
cacbc350 RK |
63 | |
64 | subtype Unit_Name is String; | |
65 | -- Name of Ada units | |
66 | ||
67 | type Main_Subprogram_Type is access procedure; | |
68 | ||
69 | type RACW_Stub_Type is tagged record | |
70 | Origin : RPC.Partition_ID; | |
71 | Receiver : Interfaces.Unsigned_64; | |
72 | Addr : Interfaces.Unsigned_64; | |
73 | Asynchronous : Boolean; | |
74 | end record; | |
c885d7a1 | 75 | |
cacbc350 RK |
76 | type RACW_Stub_Type_Access is access RACW_Stub_Type; |
77 | -- This type is used by the expansion to implement distributed objects. | |
78 | -- Do not change its definition or its layout without updating | |
79 | -- exp_dist.adb. | |
80 | ||
c885d7a1 AC |
81 | type RAS_Proxy_Type is tagged limited record |
82 | All_Calls_Remote : Boolean; | |
83 | Receiver : System.Address; | |
84 | Subp_Id : Subprogram_Id; | |
85 | end record; | |
86 | ||
87 | type RAS_Proxy_Type_Access is access RAS_Proxy_Type; | |
88 | pragma No_Strict_Aliasing (RAS_Proxy_Type_Access); | |
89 | -- This type is used by the expansion to implement distributed objects. | |
90 | -- Do not change its definition or its layout without updating | |
91 | -- Exp_Dist.Build_Remote_Supbrogram_Proxy_Type. | |
92 | ||
16db96c5 AC |
93 | -- The Request_Access type is used for communication between the PCS |
94 | -- and the RPC receiver generated by the compiler: it contains all the | |
95 | -- necessary information for the receiver to process an incoming call. | |
96 | ||
97 | type RST_Access is access all Ada.Streams.Root_Stream_Type'Class; | |
98 | type Request_Access is record | |
99 | Params : RST_Access; | |
100 | -- A stream describing the called subprogram and its parameters | |
101 | ||
102 | Result : RST_Access; | |
103 | -- A stream where the result, raised exception, or out values, | |
104 | -- are marshalled. | |
105 | end record; | |
106 | ||
cacbc350 | 107 | procedure Check |
c885d7a1 AC |
108 | (Name : Unit_Name; |
109 | Version : String; | |
110 | RCI : Boolean := True); | |
cacbc350 RK |
111 | -- Use by the main subprogram to check that a remote receiver |
112 | -- unit has has the same version than the caller's one. | |
113 | ||
bd7f7a65 AC |
114 | function Same_Partition |
115 | (Left : access RACW_Stub_Type; | |
116 | Right : access RACW_Stub_Type) return Boolean; | |
117 | -- Determine whether Left and Right correspond to objects instantiated | |
118 | -- on the same partition, for enforcement of E.4(19). | |
119 | ||
c885d7a1 | 120 | function Get_Active_Partition_ID (Name : Unit_Name) return RPC.Partition_ID; |
48ab1182 | 121 | -- Similar in some respects to RCI_Locator.Get_Active_Partition_ID |
cacbc350 | 122 | |
c885d7a1 | 123 | function Get_Active_Version (Name : Unit_Name) return String; |
cacbc350 RK |
124 | -- Similar in some respects to Get_Active_Partition_ID |
125 | ||
126 | function Get_Local_Partition_ID return RPC.Partition_ID; | |
127 | -- Return the Partition_ID of the current partition | |
128 | ||
129 | function Get_Passive_Partition_ID | |
c885d7a1 | 130 | (Name : Unit_Name) return RPC.Partition_ID; |
cacbc350 RK |
131 | -- Return the Partition_ID of the given shared passive partition |
132 | ||
133 | function Get_Passive_Version (Name : Unit_Name) return String; | |
134 | -- Return the version corresponding to a shared passive unit | |
135 | ||
136 | function Get_RCI_Package_Receiver | |
c885d7a1 | 137 | (Name : Unit_Name) return Interfaces.Unsigned_64; |
48ab1182 | 138 | -- Similar in some respects to RCI_Locator.Get_RCI_Package_Receiver |
cacbc350 RK |
139 | |
140 | procedure Get_Unique_Remote_Pointer | |
141 | (Handler : in out RACW_Stub_Type_Access); | |
142 | -- Get a unique pointer on a remote object | |
143 | ||
cacbc350 | 144 | procedure Raise_Program_Error_Unknown_Tag |
c885d7a1 | 145 | (E : Ada.Exceptions.Exception_Occurrence); |
cacbc350 RK |
146 | pragma No_Return (Raise_Program_Error_Unknown_Tag); |
147 | -- Raise Program_Error with the same message as E one | |
148 | ||
16db96c5 | 149 | type RPC_Receiver is access procedure (R : Request_Access); |
cacbc350 | 150 | procedure Register_Receiving_Stub |
c885d7a1 | 151 | (Name : Unit_Name; |
16db96c5 | 152 | Receiver : RPC_Receiver; |
c885d7a1 AC |
153 | Version : String := ""; |
154 | Subp_Info : System.Address; | |
155 | Subp_Info_Len : Integer); | |
cacbc350 RK |
156 | -- Register the fact that the Name receiving stub is now elaborated. |
157 | -- Register the access value to the package RPC_Receiver procedure. | |
158 | ||
c885d7a1 AC |
159 | procedure Get_RAS_Info |
160 | (Name : Unit_Name; | |
161 | Subp_Id : Subprogram_Id; | |
162 | Proxy_Address : out Interfaces.Unsigned_64); | |
163 | -- Look up the address of the proxy object for the given subprogram | |
164 | -- in the named unit, or Null_Address if not present on the local | |
165 | -- partition. | |
166 | ||
cacbc350 | 167 | procedure Register_Passive_Package |
c885d7a1 AC |
168 | (Name : Unit_Name; |
169 | Version : String := ""); | |
cacbc350 RK |
170 | -- Register a passive package |
171 | ||
172 | generic | |
173 | RCI_Name : String; | |
48ab1182 | 174 | package RCI_Locator is |
cacbc350 RK |
175 | function Get_RCI_Package_Receiver return Interfaces.Unsigned_64; |
176 | function Get_Active_Partition_ID return RPC.Partition_ID; | |
48ab1182 | 177 | end RCI_Locator; |
cacbc350 RK |
178 | -- RCI package information caching |
179 | ||
c885d7a1 | 180 | procedure Run (Main : Main_Subprogram_Type := null); |
cacbc350 RK |
181 | -- Run the main subprogram |
182 | ||
183 | end System.Partition_Interface; |