Commit 625036d3 authored by yoogx's avatar yoogx
Browse files

* Reflect change in PolyORB-HI/Ada API to avoid secondary stack

        For openaadl/ocarina#141
parent 8e4478ab
......@@ -164,6 +164,7 @@ package Ocarina.Backends.PO_HI_Ada.Runtime is
RE_Encapsulate, -- PolyORB_HI.Messages.Encapsulate
RE_Not_Empty, -- PolyORB_HI.Messages.Not_Empty
RE_Valid, -- PolyORB_HI.Messages.Valid
RE_Size, -- PolyORB_HI.Messages.Size
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
......@@ -262,6 +263,7 @@ package Ocarina.Backends.PO_HI_Ada.Runtime is
RE_Encapsulate => RU_PolyORB_HI_Messages,
RE_Not_Empty => RU_PolyORB_HI_Messages,
RE_Valid => RU_PolyORB_HI_Messages,
RE_Size => 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,
......
......@@ -35,6 +35,7 @@ with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Nutils;
with Ocarina.ME_AADL.AADL_Instances.Entities;
with Ocarina.Backends.Ada_Values;
with Ocarina.Backends.Utils;
with Ocarina.Backends.Properties;
......@@ -54,6 +55,7 @@ package body Ocarina.Backends.PO_HI_Ada.Transport is
use Ocarina.Backends.Ada_Tree.Nutils;
use Ocarina.Backends.PO_HI_Ada.Mapping;
use Ocarina.Backends.PO_HI_Ada.Runtime;
use Ocarina.Backends.Ada_Values;
package AAU renames Ocarina.ME_AADL.AADL_Instances.Nutils;
package ADN renames Ocarina.Backends.Ada_Tree.Nodes;
......@@ -510,6 +512,8 @@ package body Ocarina.Backends.PO_HI_Ada.Transport is
Alternatives : constant List_Id := New_List (ADN.K_List_Id);
N : Node_Id;
T : Node_Id;
Msg_T : Node_Id;
begin
pragma Assert (AAU.Is_Process (E));
......@@ -539,22 +543,38 @@ package body Ocarina.Backends.PO_HI_Ada.Transport is
N := Make_Used_Package (RU (RU_PolyORB_HI_Generated_Deployment));
Append_Node_To_List (N, Declarations);
N :=
Make_Range_Constraint
(Make_Literal (New_Integer_Value (1, 1, 10)),
Make_Subprogram_Call
(RE (RE_Size),
Make_List_Id (Make_Defining_Identifier (PN (P_Message)))));
Msg_T :=
Make_Subprogram_Call
(RE (RE_Stream_Element_Array),
Make_List_Id (N));
N :=
Make_Object_Declaration
(Defining_Identifier => Make_Defining_Identifier (PN (P_Msg)),
Constant_Present => True,
Object_Definition => RE (RE_Stream_Element_Array),
Expression =>
Make_Subprogram_Call
(RE (RE_Encapsulate),
Make_List_Id
(Make_Defining_Identifier (PN (P_Message)),
Make_Defining_Identifier (PN (P_From)),
Make_Defining_Identifier (PN (P_Entity)))));
Constant_Present => False,
Object_Definition => Msg_T);
Append_Node_To_List (N, Declarations);
-- Statements
-- Call Encapsulate
N := Make_Subprogram_Call
(RE (RE_Encapsulate),
Make_List_Id
(Make_Defining_Identifier (PN (P_Message)),
Make_Defining_Identifier (PN (P_From)),
Make_Defining_Identifier (PN (P_Entity)),
Make_Defining_Identifier (PN (P_Msg))));
Append_Node_To_List (N, Statements);
-- The if/elsif statement: for each thread of the current
-- process, we generate a case statement alternative to
-- call its specific sending routine.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment