Commit 542d1933 authored by jdelange's avatar jdelange

- backends/ocarina-backends-c_tree-nutils.ads

   * Declare the Offset variable to be included in 
     activity.c generated file.

 - backends/ocarina-backends-po_hi_c-activity.adb
   * Call __po_hi_task_wait_offset when the task
     use the Dispatch_Offset property

 - backends/ocarina-backends-po_hi_c-runtime.ads
   * Declare the __po_hi_task_wait_offset function
     of PolyORB-HI-C


git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@4908 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 4c6296fb
......@@ -215,6 +215,7 @@ package Ocarina.Backends.C_Tree.Nutils is
V_Dev_Id,
V_Entity,
V_Period,
V_Offset,
V_Port,
V_Pkt,
V_Thread,
......
......@@ -371,6 +371,7 @@ package body Ocarina.Backends.PO_HI_C.Activity is
procedure Make_Send_Out_Ports;
procedure Make_Task_Blocking;
procedure Make_Fetch_In_Ports;
procedure Make_Wait_Offset;
procedure Make_Thread_Compute_Entrypoint;
procedure Make_Ports_Compute_Entrypoint;
procedure Make_Activate_Entrypoint;
......@@ -782,6 +783,41 @@ package body Ocarina.Backends.PO_HI_C.Activity is
end loop;
end Make_Send_Out_Ports;
----------------------
-- Make_Wait_Offset --
----------------------
procedure Make_Wait_Offset is
D : Time_Type;
begin
if Get_Thread_Dispatch_Protocol (E) /= Thread_Periodic then
return;
end if;
D := Get_Dispatch_Offset (E);
if D /= Null_Time then
N := Make_Variable_Declaration
(Make_Defining_Identifier (VN (V_Offset)),
RE (RE_Time_T));
Append_Node_To_List (N, Statements);
N := Map_Time (D, VN (V_Offset));
Append_Node_To_List
(N, Statements);
Append_Node_To_List
(CTU.Make_Call_Profile
(RE (RE_Wait_Offset),
Make_List_Id
(Make_Variable_Address
(Make_Defining_Identifier
(VN (V_Offset))))),
WStatements);
end if;
end Make_Wait_Offset;
-------------------------
-- Make_Fetch_In_Ports --
-------------------------
......@@ -1161,6 +1197,8 @@ package body Ocarina.Backends.PO_HI_C.Activity is
-- behaviour of subprograms and does not have to worry
-- about sending and receiving ports.
Make_Wait_Offset;
-- Get IN ports values and dequeue them
if Has_In_Ports (E) then
......
......@@ -69,6 +69,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Minutes, -- __po_hi_minutes
RE_Create_Periodic_Task, -- __po_hi_create_periodic_task
RE_Create_Sporadic_Task, -- __po_hi_create_sporadic_task
RE_Wait_Offset, -- __po_hi_task_wait_offset
RE_Wait_For_Next_Period, -- __po_hi_task_wait_for_next_period
RE_Initialize, -- __po_hi_initialize
RE_Initialize_Early, -- __po_hi_initialize_early
......@@ -328,6 +329,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Simulate_WCET => RH_PO_HI_Utils,
RE_Compute_Miss => RH_PO_HI_Utils,
RE_Deployment_Endiannesses => RH_PO_HI_Transport,
RE_Wait_Offset => RH_PO_HI_Task,
RE_Wait_For_Next_Period => RH_PO_HI_Task,
RE_Compute_Next_Period => RH_PO_HI_Task,
RE_Initialize => RH_PO_HI_Main,
......
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