Commit cb11468e authored by julien.delange's avatar julien.delange

continue to separate socket driver from the rest



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@545 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 9f0d4613
......@@ -229,8 +229,8 @@ package body Ocarina.Backends.PO_HI_C.Main is
(CTN.Naming_Node (Backend_Node (Identifier (E))));
P : constant Node_Id := CTN.Entity (U);
N : Node_Id;
S : Node_Id;
C : Node_Id;
S : Node_Id;
Spec : Node_Id;
Declarations : constant List_Id := New_List
(CTN.K_Declaration_List);
......@@ -257,8 +257,18 @@ package body Ocarina.Backends.PO_HI_C.Main is
Main_Function := Make_Function_Implementation
(Spec, Declarations, Statements);
N := CTU.Make_Call_Profile (RE (RE_Initialize));
Append_Node_To_List (N, CTN.Statements (Main_Function));
if Process_Use_Defaults_Sockets (E) then
Add_Include
(Make_Include_Clause
(Make_Defining_Identifier
(Get_String_Name
("drivers/po_hi_driver_sockets"))));
N := Make_Call_Profile
(Make_Defining_Identifier
(Get_String_Name ("__po_hi_driver_sockets_init")),
No_List);
Append_Node_To_List (N, CTN.Statements (Main_Function));
end if;
-- Visit all devices attached to the parent system that
-- share the same processor as process E.
......@@ -279,6 +289,11 @@ package body Ocarina.Backends.PO_HI_C.Main is
end loop;
end if;
-- Here, we should automatically initialize the sockets layer
N := CTU.Make_Call_Profile (RE (RE_Initialize));
Append_Node_To_List (N, CTN.Statements (Main_Function));
if not AAU.Is_Empty (Subcomponents (E)) then
S := First_Node (Subcomponents (E));
while Present (S) loop
......
......@@ -542,7 +542,7 @@ package body Ocarina.Backends.PO_HI_C.Naming is
end if;
Set_Deployment_Header;
Set_Str_To_Name_Buffer ("__PO_HI_NEED_");
Set_Str_To_Name_Buffer ("__PO_HI_NEED_DRIVER_");
Get_Name_String_And_Append (Driver_Name);
Driver_Name := Name_Find;
......
......@@ -3567,6 +3567,10 @@ package body Ocarina.Backends.Utils is
end Is_Using_Virtual_Bus;
-------------------------------------------
-- Get_Corresponding_Port_In_Component --
-------------------------------------------
function Get_Corresponding_Port_In_Component (Port : Node_Id) return Node_Id
is
function Get_Corresponding_Port_In_Component_Rec
......@@ -3606,7 +3610,6 @@ package body Ocarina.Backends.Utils is
return No_Node;
end Get_Corresponding_Port_In_Component_Rec;
Parent : Node_Id;
Tmp : Node_Id;
R : Node_Id;
......@@ -3640,4 +3643,60 @@ package body Ocarina.Backends.Utils is
return No_Node;
end Get_Corresponding_Port_In_Component;
-----------------------------------
-- Process_Use_Default_Sockets --
-----------------------------------
function Process_Use_Defaults_Sockets (The_Process : Node_Id)
return Boolean is
C : Node_Id;
F : Node_Id;
B : Node_Id;
C_End : Node_Id;
End_List : List_Id;
begin
if not AAU.Is_Empty (Features (The_Process)) then
F := First_Node (Features (The_Process));
while Present (F) loop
-- We make two iteration to traverse (1) the sources
-- of F then (2) the destinations of F.
End_List := Sources (F);
for I in Boolean'Range loop
if not AAU.Is_Empty (End_List) then
C_End := First_Node (End_List);
while Present (C_End) loop
-- Get the connection involving C_End
C := Extra_Item (C_End);
-- Get the bus of the connection
B := Get_Bound_Bus (C);
if Get_Transport_API (B, The_Process)
= Transport_BSD_Sockets then
return True;
end if;
C_End := Next_Node (C_End);
end loop;
end if;
End_List := Destinations (F);
end loop;
F := Next_Node (F);
end loop;
end if;
return False;
end Process_Use_Defaults_Sockets;
end Ocarina.Backends.Utils;
......@@ -484,4 +484,7 @@ package Ocarina.Backends.Utils is
return Node_Id;
-- Return the port connected the port given in parameter
-- inside the component.
function Process_Use_Defaults_Sockets (The_Process : Node_Id)
return Boolean;
end Ocarina.Backends.Utils;
Markdown is supported
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