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 --
10 -- Copyright (C) 1995-2000 Free Software Foundation, Inc. --
12 -- GNARL is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNARL; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
23 -- As a special exception, if other files instantiate generics from this --
24 -- unit, or you link this unit with other files to produce an executable, --
25 -- this unit does not by itself cause the resulting executable to be --
26 -- covered by the GNU General Public License. This exception does not --
27 -- however invalidate any other reasons why the executable file might be --
28 -- covered by the GNU Public License. --
30 -- GNAT was originally developed by the GNAT team at New York University. --
31 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
33 ------------------------------------------------------------------------------
39 package System
.Partition_Interface
is
41 pragma Elaborate_Body
;
43 type Subprogram_Id
is new Natural;
44 -- This type is used exclusively by stubs
46 subtype Unit_Name
is String;
49 type Main_Subprogram_Type
is access procedure;
51 type RACW_Stub_Type
is tagged record
52 Origin
: RPC
.Partition_ID
;
53 Receiver
: Interfaces
.Unsigned_64
;
54 Addr
: Interfaces
.Unsigned_64
;
55 Asynchronous
: Boolean;
57 type RACW_Stub_Type_Access
is access RACW_Stub_Type
;
58 -- This type is used by the expansion to implement distributed objects.
59 -- Do not change its definition or its layout without updating
65 RCI
: in Boolean := True);
66 -- Use by the main subprogram to check that a remote receiver
67 -- unit has has the same version than the caller's one.
69 function Get_Active_Partition_ID
71 return RPC
.Partition_ID
;
72 -- Similar in some respects to RCI_Info.Get_Active_Partition_ID
74 function Get_Active_Version
77 -- Similar in some respects to Get_Active_Partition_ID
79 function Get_Local_Partition_ID
return RPC
.Partition_ID
;
80 -- Return the Partition_ID of the current partition
82 function Get_Passive_Partition_ID
84 return RPC
.Partition_ID
;
85 -- Return the Partition_ID of the given shared passive partition
87 function Get_Passive_Version
(Name
: Unit_Name
) return String;
88 -- Return the version corresponding to a shared passive unit
90 function Get_RCI_Package_Receiver
92 return Interfaces
.Unsigned_64
;
93 -- Similar in some respects to RCI_Info.Get_RCI_Package_Receiver
95 procedure Get_Unique_Remote_Pointer
96 (Handler
: in out RACW_Stub_Type_Access
);
97 -- Get a unique pointer on a remote object
100 (Rsh_Command
: in String;
101 Name_Is_Host
: in Boolean;
102 General_Name
: in String;
103 Command_Line
: in String);
104 -- General_Name represents the name of the machine or the name of the
105 -- partition (depending on the value of Name_Is_Host). Command_Line
106 -- holds the extra options that will be given on the command line.
107 -- Rsh_Command is typically "rsh", that will be used to launch the
110 procedure Raise_Program_Error_For_E_4_18
;
111 pragma No_Return
(Raise_Program_Error_For_E_4_18
);
112 -- Raise Program_Error with an error message explaining why it has been
113 -- raised. The rule in E.4 (18) is tricky and misleading for most users
114 -- of the distributed systems annex.
116 procedure Raise_Program_Error_Unknown_Tag
117 (E
: in Ada
.Exceptions
.Exception_Occurrence
);
118 pragma No_Return
(Raise_Program_Error_Unknown_Tag
);
119 -- Raise Program_Error with the same message as E one
121 procedure Register_Receiving_Stub
122 (Name
: in Unit_Name
;
123 Receiver
: in RPC
.RPC_Receiver
;
124 Version
: in String := "");
125 -- Register the fact that the Name receiving stub is now elaborated.
126 -- Register the access value to the package RPC_Receiver procedure.
128 procedure Register_Passive_Package
129 (Name
: in Unit_Name
;
130 Version
: in String := "");
131 -- Register a passive package
136 function Get_RCI_Package_Receiver
return Interfaces
.Unsigned_64
;
137 function Get_Active_Partition_ID
return RPC
.Partition_ID
;
139 -- RCI package information caching
141 procedure Run
(Main
: in Main_Subprogram_Type
:= null);
142 -- Run the main subprogram
144 end System
.Partition_Interface
;