1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
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 --
11 -- Copyright (C) 1995-2000 Free Software Foundation, Inc. --
13 -- GNARL is free software; you can redistribute it and/or modify it under --
14 -- 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- --
16 -- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNARL; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
24 -- 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, --
26 -- this unit does not by itself cause the resulting executable to be --
27 -- covered by the GNU General Public License. This exception does not --
28 -- however invalidate any other reasons why the executable file might be --
29 -- covered by the GNU Public License. --
31 -- GNAT was originally developed by the GNAT team at New York University. --
32 -- Extensive contributions were provided by Ada Core Technologies Inc. --
34 ------------------------------------------------------------------------------
40 package System
.Partition_Interface
is
42 pragma Elaborate_Body
;
44 type Subprogram_Id
is new Natural;
45 -- This type is used exclusively by stubs
47 subtype Unit_Name
is String;
50 type Main_Subprogram_Type
is access procedure;
52 type RACW_Stub_Type
is tagged record
53 Origin
: RPC
.Partition_ID
;
54 Receiver
: Interfaces
.Unsigned_64
;
55 Addr
: Interfaces
.Unsigned_64
;
56 Asynchronous
: Boolean;
58 type RACW_Stub_Type_Access
is access RACW_Stub_Type
;
59 -- This type is used by the expansion to implement distributed objects.
60 -- Do not change its definition or its layout without updating
66 RCI
: in Boolean := True);
67 -- Use by the main subprogram to check that a remote receiver
68 -- unit has has the same version than the caller's one.
70 function Get_Active_Partition_ID
72 return RPC
.Partition_ID
;
73 -- Similar in some respects to RCI_Info.Get_Active_Partition_ID
75 function Get_Active_Version
78 -- Similar in some respects to Get_Active_Partition_ID
80 function Get_Local_Partition_ID
return RPC
.Partition_ID
;
81 -- Return the Partition_ID of the current partition
83 function Get_Passive_Partition_ID
85 return RPC
.Partition_ID
;
86 -- Return the Partition_ID of the given shared passive partition
88 function Get_Passive_Version
(Name
: Unit_Name
) return String;
89 -- Return the version corresponding to a shared passive unit
91 function Get_RCI_Package_Receiver
93 return Interfaces
.Unsigned_64
;
94 -- Similar in some respects to RCI_Info.Get_RCI_Package_Receiver
96 procedure Get_Unique_Remote_Pointer
97 (Handler
: in out RACW_Stub_Type_Access
);
98 -- Get a unique pointer on a remote object
101 (Rsh_Command
: in String;
102 Name_Is_Host
: in Boolean;
103 General_Name
: in String;
104 Command_Line
: in String);
105 -- General_Name represents the name of the machine or the name of the
106 -- partition (depending on the value of Name_Is_Host). Command_Line
107 -- holds the extra options that will be given on the command line.
108 -- Rsh_Command is typically "rsh", that will be used to launch the
111 procedure Raise_Program_Error_For_E_4_18
;
112 pragma No_Return
(Raise_Program_Error_For_E_4_18
);
113 -- Raise Program_Error with an error message explaining why it has been
114 -- raised. The rule in E.4 (18) is tricky and misleading for most users
115 -- of the distributed systems annex.
117 procedure Raise_Program_Error_Unknown_Tag
118 (E
: in Ada
.Exceptions
.Exception_Occurrence
);
119 pragma No_Return
(Raise_Program_Error_Unknown_Tag
);
120 -- Raise Program_Error with the same message as E one
122 procedure Register_Receiving_Stub
123 (Name
: in Unit_Name
;
124 Receiver
: in RPC
.RPC_Receiver
;
125 Version
: in String := "");
126 -- Register the fact that the Name receiving stub is now elaborated.
127 -- Register the access value to the package RPC_Receiver procedure.
129 procedure Register_Passive_Package
130 (Name
: in Unit_Name
;
131 Version
: in String := "");
132 -- Register a passive package
137 function Get_RCI_Package_Receiver
return Interfaces
.Unsigned_64
;
138 function Get_Active_Partition_ID
return RPC
.Partition_ID
;
140 -- RCI package information caching
142 procedure Run
(Main
: in Main_Subprogram_Type
:= null);
143 -- Run the main subprogram
145 end System
.Partition_Interface
;