OSDN Git Service

2004-04-19 Arnaud Charlet <charlet@act-europe.fr>
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-parint.ads
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 --                                                                          --
9 --          Copyright (C) 1995-2004 Free Software Foundation, Inc.          --
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. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
31 --                                                                          --
32 ------------------------------------------------------------------------------
33
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
37 with Ada.Exceptions;
38 with Interfaces;
39 with System.RPC;
40
41 package System.Partition_Interface is
42
43    pragma Elaborate_Body;
44
45    type Subprogram_Id is new Natural;
46    --  This type is used exclusively by stubs
47
48    subtype Unit_Name is String;
49    --  Name of Ada units
50
51    type Main_Subprogram_Type is access procedure;
52
53    type RACW_Stub_Type is tagged record
54       Origin       : RPC.Partition_ID;
55       Receiver     : Interfaces.Unsigned_64;
56       Addr         : Interfaces.Unsigned_64;
57       Asynchronous : Boolean;
58    end record;
59    type RACW_Stub_Type_Access is access RACW_Stub_Type;
60    --  This type is used by the expansion to implement distributed objects.
61    --  Do not change its definition or its layout without updating
62    --  exp_dist.adb.
63
64    procedure Check
65      (Name    : in Unit_Name;
66       Version : in String;
67       RCI     : in Boolean := True);
68    --  Use by the main subprogram to check that a remote receiver
69    --  unit has has the same version than the caller's one.
70
71    function Get_Active_Partition_ID
72      (Name : Unit_Name)
73       return RPC.Partition_ID;
74    --  Similar in some respects to RCI_Info.Get_Active_Partition_ID
75
76    function Get_Active_Version
77       (Name : Unit_Name)
78        return String;
79    --  Similar in some respects to Get_Active_Partition_ID
80
81    function Get_Local_Partition_ID return RPC.Partition_ID;
82    --  Return the Partition_ID of the current partition
83
84    function Get_Passive_Partition_ID
85      (Name : Unit_Name)
86      return RPC.Partition_ID;
87    --  Return the Partition_ID of the given shared passive partition
88
89    function Get_Passive_Version (Name : Unit_Name) return String;
90    --  Return the version corresponding to a shared passive unit
91
92    function Get_RCI_Package_Receiver
93      (Name : Unit_Name)
94       return Interfaces.Unsigned_64;
95    --  Similar in some respects to RCI_Info.Get_RCI_Package_Receiver
96
97    procedure Get_Unique_Remote_Pointer
98      (Handler : in out RACW_Stub_Type_Access);
99    --  Get a unique pointer on a remote object
100
101    procedure Raise_Program_Error_Unknown_Tag
102      (E : in Ada.Exceptions.Exception_Occurrence);
103    pragma No_Return (Raise_Program_Error_Unknown_Tag);
104    --  Raise Program_Error with the same message as E one
105
106    procedure Register_Receiving_Stub
107      (Name     : in Unit_Name;
108       Receiver : in RPC.RPC_Receiver;
109       Version  : in String := "");
110    --  Register the fact that the Name receiving stub is now elaborated.
111    --  Register the access value to the package RPC_Receiver procedure.
112
113    procedure Register_Passive_Package
114      (Name    : in Unit_Name;
115       Version : in String := "");
116    --  Register a passive package
117
118    generic
119       RCI_Name : String;
120    package RCI_Info is
121       function Get_RCI_Package_Receiver return Interfaces.Unsigned_64;
122       function Get_Active_Partition_ID return RPC.Partition_ID;
123    end RCI_Info;
124    --  RCI package information caching
125
126    procedure Run (Main : in Main_Subprogram_Type := null);
127    --  Run the main subprogram
128
129 end System.Partition_Interface;