ocarina-backends-po_hi_ada-runtime.ads 16.8 KB
Newer Older
1
2
3
4
5
6
7
8
------------------------------------------------------------------------------
--                                                                          --
--                           OCARINA COMPONENTS                             --
--                                                                          --
--   O C A R I N A . B A C K E N D S . P O _ H I _ A D A . R U N T I M E    --
--                                                                          --
--                                 S p e c                                  --
--                                                                          --
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--    Copyright (C) 2006-2009 Telecom ParisTech, 2010-2015 ESA & ISAE.      --
--                                                                          --
-- Ocarina  is free software; you can redistribute it and/or modify under   --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
-- sion. Ocarina is distributed in the hope that it will be useful, but     --
-- WITHOUT ANY WARRANTY; without even the implied warranty of               --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     --
--                                                                          --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception,   --
-- version 3.1, as published by the Free Software Foundation.               --
--                                                                          --
-- You should have received a copy of the GNU General Public License and    --
-- a copy of the GCC Runtime Library Exception along with this program;     --
-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
-- <http://www.gnu.org/licenses/>.                                          --
26
--                                                                          --
jhugues's avatar
jhugues committed
27
28
--                 Ocarina is maintained by the TASTE project               --
--                      (taste-users@lists.tuxfamily.org)                   --
29
30
31
32
33
34
35
36
37
38
39
--                                                                          --
------------------------------------------------------------------------------

package Ocarina.Backends.PO_HI_Ada.Runtime is

   --  Runtime Units

   type RU_Id is
     (RU_Null,
      RU_Ada,
      RU_Ada_Exceptions,
yoogx's avatar
yoogx committed
40
41
      RU_Ada_Interrupts,
      RU_Ada_Interrupts_Names,
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
      RU_Ada_Real_Time,
      RU_Ada_Strings,
      RU_Ada_Strings_Bounded,
      RU_Ada_Strings_Bounded_Generic_Bounded_Length,
      RU_Ada_Strings_Wide_Bounded,
      RU_Ada_Strings_Wide_Bounded_Generic_Bounded_Length,
      RU_Ada_Synchronous_Task_Control,
      RU_ASN1_Types,
      RU_PolyORB_HI_Generated,
      RU_PolyORB_HI_Generated_Activity,
      RU_PolyORB_HI_Generated_Deployment,
      RU_PolyORB_HI_Generated_Marshallers,
      RU_PolyORB_HI_Generated_Naming,
      RU_PolyORB_HI_Generated_Subprograms,
      RU_PolyORB_HI_Generated_Transport,
      RU_PolyORB_HI_Generated_Types,
      RU_PolyORB_HI,
      RU_PolyORB_HI_Errors,
      RU_PolyORB_HI_Hybrid_Task_Driver,
      RU_PolyORB_HI_Hybrid_Task_Driver_Driver,
      RU_PolyORB_HI_Aperiodic_Task,
      RU_PolyORB_HI_Background_Task,
64
      RU_PolyORB_HI_Null_Task,
65
66
67
      RU_PolyORB_HI_Periodic_Task,
      RU_PolyORB_HI_Sporadic_Task,
      RU_PolyORB_HI_Hybrid_Task,
yoogx's avatar
yoogx committed
68
      RU_PolyORB_HI_ISR_Task,
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
      RU_PolyORB_HI_Port_Kinds,
      RU_PolyORB_HI_Marshallers_G,
      RU_PolyORB_HI_Port_Type_Marshallers,
      RU_PolyORB_HI_Time_Marshallers,
      RU_PolyORB_HI_Messages,
      RU_PolyORB_HI_Output_Low_Level,
      RU_PolyORB_HI_Output,
      RU_PolyORB_HI_Protocols,
      RU_PolyORB_HI_Streams,
      RU_PolyORB_HI_Suspenders,
      RU_PolyORB_HI_Thread_Interrogators,
      RU_PolyORB_HI_Transport_Low_Level,
      RU_PolyORB_HI_Utils,
      RU_Interfaces,
      RU_Interfaces_C,
      RU_Standard,
      RU_System);

   --  Runtime Entities

   type RE_Id is
     (RE_Null,                       --  Workaround to denote a null RE
      RE_Off,                        --  Off
      RE_On,                         --  On
      RE_True,                       --  True
      RE_False,                      --  False
      RE_Get_Count,                  --  PO_HI_GEN.Activity.Get_Count
      RE_Get_Sender,                 --  PO_HI_GEN.Activity.Get_Sender
      RE_Get_Value,                  --  PO_HI_GEN.Activity.Get_Value
      RE_Next_Value,                 --  PO_HI_GEN.Activity.Next_Value
      RE_Put_Value,                  --  PO_HI_GEN.Activity.Put_Value
      RE_Receive_Input,              --  PO_HI_GEN.Activity.Receive_Input
      RE_Store_Incoming_Message,     --  PO_HI_GEN.Activity.Store_Incom...
      RE_Wait_For_Incoming_Events,   --  PO_HI_GEN.Activity.Wait_For_In...
      RE_Node_Type,                  --  PO_HI_GEN.Deployment.Node_Type
      RE_Entity_Type,                --  PO_HI_GEN.Deployment.Entity_Type
      RE_Entity_Table,               --  PO_HI_GEN.Deployment.Entity_Table
      RE_Port_Type_1,                --  PO_HI_GEN.Deployment.Port_Type
      RE_Port_Image,                 --  PO_HI_GEN.Deployment.Port_Image
      RE_Max_Port_Image_Size,        --  PO_HI_GEN.Deployment.Max_Port_Image...
      RE_Deliver,                    --  PO_HI_GEN.Transport.Deliver
      RE_Send_2,                     --  PO_HI_GEN.Transport.Send
      RE_Clock,                      --  Ada.Real_Time.Clock
      RE_Nanoseconds,                --  Ada.Real_Time.Nanoseconds
      RE_Microseconds,               --  Ada.Real_Time.Microseconds
      RE_Milliseconds,               --  Ada.Real_Time.Milliseconds
      RE_Seconds,                    --  Ada.Real_Time.Seconds
      RE_Minutes,                    --  Ada.Real_Time.Minutes
      RE_Time,                       --  Ada.Real_Time.Time
      RE_Time_Span,                  --  Ada.Real_Time.Time_Span
      RE_Set_True,                   --  Ada.Synchronous_Task_Control.Set_True
      RE_Integer_8,                  --  Interfaces.Integer_8
      RE_Integer_16,                 --  Interfaces.Integer_16
      RE_Integer_32,                 --  Interfaces.Integer_32
      RE_Integer_64,                 --  Interfaces.Integer_64
      RE_Unsigned_8,                 --  Interfaces.Unsigned_8
      RE_Unsigned_16,                --  Interfaces.Unsigned_16
      RE_Unsigned_32,                --  Interfaces.Unsigned_32
      RE_Unsigned_64,                --  Interfaces.Unsigned_64
      RE_Char_Array,                 --  Interfaces.C.char_array
      RE_Nul,                        --  Interfaces.C.nul
      RE_Error_Kind,                 --  Po..HI.Error_Kind
      RE_Error_None,                 --  Po..HI.Error_Kind
      RE_Error_Transport,            --  Po..HI.Error_Kind
      RE_Marshall_1,                 --  Po..HI.Port_Type_Marshallers.Marshall
      RE_Unmarshall_1,               --  Po..HI.Port_.._Marshallers.Unmarshall
      RE_Marshall_2,                 --  Po..HI.Time_Marshallers.Marshall
      RE_Unmarshall_2,               --  Po..HI.Time_Marshallers.Unmarshall
      RE_Port_Kind,                  --  Po..HI.Port_Kinds.Port_Kind

139
140
141
   --  IMPORTANT: The order of the 9 enumerators below and the fact
   --  they are consecutive must NOT be modified unless you know
   --  exactly what you are doing!
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179

      RE_In_Event_Port,              --  Po..HI.Port_Kinds.In_Event_Port
      RE_In_Event_Data_Port,         --  Po..HI.Port_Kinds.In_Event_Data_Port
      RE_In_Data_Port,               --  Po..HI.Port_Kinds.In_Data_Port
      RE_In_Out_Event_Port,          --  Po..HI.Port_Kinds.In_Out_Event_Port
      RE_In_Out_Event_Data_Port,     --  Po..HI.Po..nds.In_Out_Event_Data_Port
      RE_In_Out_Data_Port,           --  Po..HI.Port_Kinds.In_Out_Data_Port
      RE_Out_Event_Port,             --  Po..HI.Port_Kinds.Out_Event_Port
      RE_Out_Event_Data_Port,        --  Po..HI.Port_Kinds.Out_Event_Data_Port
      RE_Out_Data_Port,              --  PolyORB_HI.Port_Kinds.Out_Data_Port
      RE_Overflow_Handling_Protocol, --  Po..HI.Port_Kinds.Over..ing_Protocol
      RE_DropOldest,                 --  Po..HI.Port_Kinds.DropOldest
      RE_DropNewest,                 --  Po..HI.Port_Kinds.DropNewest
      RE_Error,                      --  Po..HI.Port_Kinds.Error
      RE_Stream_Element_Array,       --  Po..HI.Streams.Stream_Element_Array
      RE_Stream_Element_Offset,      --  Po..HI.Stream_Element_Offset
      RE_Write,                      --  Polyorb_HI.Messages.Write
      RE_Header_Size,                --  Polyorb_HI.Messages.Header_Size
      RE_Message_Type,               --  Polyorb_HI.Messages.Message_Type
      RE_Reallocate,                 --  Polyorb_HI.Messages.Reallocate
      RE_Sender,                     --  Polyorb_HI.Messages.Sender
      RE_Encapsulate,                --  Polyorb_HI.Messages.Encapsulate
      RE_Naming_Entry,               --  PolyORB_HI.Transport.Naming_Entry
      RE_To_HI_String,               --  PolyORB_HI.Utils.To_HI_String
      RE_Naming_Table_Type,          --  PolyORB_HI.Utils.Naming_Table_Type
      RE_Corresponding_Port,         --  PolyORB_HI.Utils.Corresponding_Port
      RE_Non_Blocking_Receive,       --  Po..HI.Protocols.Non_Blocking_Receive
      RE_Send_1,                     --  Po..HI.Protocols.Send
      RE_Initialize,                 --  Po..HI.Transport_Low_Level.Initialize
      RE_Send_3,                     --  Po..HI.Transport_Low_Level.Send
      RE_Hybrid_Task_Info,           --  Po..HI.Hybrid_...pes.Hybrid_Task_Info
      RE_Hybrid_Task_Info_Array,     --  PO..HI.Hybrid..es.Hybrid_.._Info_Array
      RE_Driver_Suspender,           --  PO..HI.Hybrid..es.Driver_Suspender
      RE_Boolean,                    --  Standard.Boolean
      RE_Integer,                    --  Standard.Integer
      RE_Natural,                    --  Standard.Natural
      RE_Positive,                   --  Standard.Positive
      RE_Float,                      --  Standard.Float
yoogx's avatar
yoogx committed
180
      RE_Long_Float,                 --  Standard.Long_Float
181
182
183
184
185
186
187
188
189
190
191
      RE_String,                     --  Standard.String
      RE_Character,                  --  Standard.Character
      RE_Wide_Character,             --  Standard.Wide_Character
      RE_Suspend_Forever,            --  Suspenders.Suspend_Forever
      RE_Unblock_All_Tasks,          --  Suspenders.Unblock_All_Tasks
      RE_System_Startup_Time,        --  Suspenders.System_Startup_Time
      RE_Address,                    --  System.Address
      RE_Null_Address,               --  System.Null_Address
      RE_Default_Priority,           --  System.Default_Priority
      RE_Priority);                  --  System.Priority

192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
   RE_Unit_Table : constant array (RE_Id) of RU_Id :=
     (RE_Null                       => RU_Null,
      RE_Off                        => RU_Null,
      RE_On                         => RU_Null,
      RE_True                       => RU_Null,
      RE_False                      => RU_Null,
      RE_Get_Count                  => RU_PolyORB_HI_Generated_Activity,
      RE_Get_Sender                 => RU_PolyORB_HI_Generated_Activity,
      RE_Get_Value                  => RU_PolyORB_HI_Generated_Activity,
      RE_Next_Value                 => RU_PolyORB_HI_Generated_Activity,
      RE_Put_Value                  => RU_PolyORB_HI_Generated_Activity,
      RE_Receive_Input              => RU_PolyORB_HI_Generated_Activity,
      RE_Store_Incoming_Message     => RU_PolyORB_HI_Generated_Activity,
      RE_Wait_For_Incoming_Events   => RU_PolyORB_HI_Generated_Activity,
      RE_Node_Type                  => RU_PolyORB_HI_Generated_Deployment,
      RE_Entity_Type                => RU_PolyORB_HI_Generated_Deployment,
      RE_Entity_Table               => RU_PolyORB_HI_Generated_Deployment,
      RE_Port_Type_1                => RU_PolyORB_HI_Generated_Deployment,
      RE_Port_Image                 => RU_PolyORB_HI_Generated_Deployment,
      RE_Max_Port_Image_Size        => RU_PolyORB_HI_Generated_Deployment,
      RE_Deliver                    => RU_PolyORB_HI_Generated_Transport,
      RE_Send_2                     => RU_PolyORB_HI_Generated_Transport,
      RE_Clock                      => RU_Ada_Real_Time,
      RE_Nanoseconds                => RU_Ada_Real_Time,
      RE_Microseconds               => RU_Ada_Real_Time,
      RE_Milliseconds               => RU_Ada_Real_Time,
      RE_Seconds                    => RU_Ada_Real_Time,
      RE_Minutes                    => RU_Ada_Real_Time,
      RE_Time                       => RU_Ada_Real_Time,
      RE_Time_Span                  => RU_Ada_Real_Time,
      RE_Set_True                   => RU_Ada_Synchronous_Task_Control,
      RE_Integer_8                  => RU_Interfaces,
      RE_Integer_16                 => RU_Interfaces,
      RE_Integer_32                 => RU_Interfaces,
      RE_Integer_64                 => RU_Interfaces,
      RE_Unsigned_8                 => RU_Interfaces,
      RE_Unsigned_16                => RU_Interfaces,
      RE_Unsigned_32                => RU_Interfaces,
      RE_Unsigned_64                => RU_Interfaces,
      RE_Char_Array                 => RU_Interfaces_C,
      RE_Nul                        => RU_Interfaces_C,
      RE_Error_Kind                 => RU_PolyORB_HI_Errors,
      RE_Error_None                 => RU_PolyORB_HI_Errors,
      RE_Error_Transport            => RU_PolyORB_HI_Errors,
      RE_Marshall_1                 => RU_PolyORB_HI_Port_Type_Marshallers,
      RE_Unmarshall_1               => RU_PolyORB_HI_Port_Type_Marshallers,
      RE_Marshall_2                 => RU_PolyORB_HI_Time_Marshallers,
      RE_Unmarshall_2               => RU_PolyORB_HI_Time_Marshallers,
      RE_Port_Kind                  => RU_PolyORB_HI_Port_Kinds,
      RE_In_Event_Port              => RU_PolyORB_HI_Port_Kinds,
      RE_In_Event_Data_Port         => RU_PolyORB_HI_Port_Kinds,
      RE_In_Data_Port               => RU_PolyORB_HI_Port_Kinds,
      RE_In_Out_Event_Port          => RU_PolyORB_HI_Port_Kinds,
      RE_In_Out_Event_Data_Port     => RU_PolyORB_HI_Port_Kinds,
      RE_In_Out_Data_Port           => RU_PolyORB_HI_Port_Kinds,
      RE_Out_Event_Port             => RU_PolyORB_HI_Port_Kinds,
      RE_Out_Event_Data_Port        => RU_PolyORB_HI_Port_Kinds,
      RE_Out_Data_Port              => RU_PolyORB_HI_Port_Kinds,
      RE_Overflow_Handling_Protocol => RU_PolyORB_HI_Port_Kinds,
      RE_DropOldest                 => RU_PolyORB_HI_Port_Kinds,
      RE_DropNewest                 => RU_PolyORB_HI_Port_Kinds,
      RE_Error                      => RU_PolyORB_HI_Port_Kinds,
      RE_Write                      => RU_PolyORB_HI_Messages,
      RE_Header_Size                => RU_PolyORB_HI_Messages,
      RE_Message_Type               => RU_PolyORB_HI_Messages,
      RE_Reallocate                 => RU_PolyORB_HI_Messages,
      RE_Sender                     => RU_PolyORB_HI_Messages,
      RE_Encapsulate                => RU_PolyORB_HI_Messages,
      RE_Naming_Entry               => RU_PolyORB_HI_Utils,
      RE_To_HI_String               => RU_PolyORB_HI_Utils,
      RE_Naming_Table_Type          => RU_PolyORB_HI_Utils,
      RE_Corresponding_Port         => RU_PolyORB_HI_Utils,
      RE_Non_Blocking_Receive       => RU_PolyORB_HI_Protocols,
      RE_Send_1                     => RU_PolyORB_HI_Protocols,
      RE_Stream_Element_Array       => RU_PolyORB_HI_Streams,
      RE_Stream_Element_Offset      => RU_PolyORB_HI_Streams,
      RE_Initialize                 => RU_PolyORB_HI_Transport_Low_Level,
      RE_Send_3                     => RU_PolyORB_HI_Transport_Low_Level,
      RE_Hybrid_Task_Info           => RU_PolyORB_HI_Hybrid_Task_Driver,
      RE_Hybrid_Task_Info_Array     => RU_PolyORB_HI_Hybrid_Task_Driver,
      RE_Driver_Suspender           => RU_PolyORB_HI_Hybrid_Task_Driver,
      RE_Boolean                    => RU_Standard,
      RE_Integer                    => RU_Standard,
      RE_Natural                    => RU_Standard,
      RE_Positive                   => RU_Standard,
      RE_Float                      => RU_Standard,
      RE_Long_Float                 => RU_Standard,
      RE_String                     => RU_Standard,
      RE_Character                  => RU_Standard,
      RE_Wide_Character             => RU_Standard,
      RE_Suspend_Forever            => RU_PolyORB_HI_Suspenders,
      RE_Unblock_All_Tasks          => RU_PolyORB_HI_Suspenders,
      RE_System_Startup_Time        => RU_PolyORB_HI_Suspenders,
      RE_Address                    => RU_System,
      RE_Null_Address               => RU_System,
      RE_Default_Priority           => RU_System,
      RE_Priority                   => RU_System);
289
290
291
292
293
294
295

   procedure Initialize;
   procedure Reset;

   function RE (Id : RE_Id; Withed : Boolean := True) return Node_Id;
   --  Return a designator for entity Id

296
297
298
   function RU
     (Id : RU_Id; Withed : Boolean := True; Elaborated : Boolean := False)
     return Node_Id;
299
300
301
   --  Return a node for Unit Id

end Ocarina.Backends.PO_HI_Ada.Runtime;