From 12bb75c683261cd0cf49907728a2bbdc53e62c68 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 29 Dec 2014 21:11:35 -0500 Subject: [PATCH] * Sampling port works for the C code part * Needs to automatically generate the inter-partitions configuration --- src/backends/ocarina-backends-pok_c-main.adb | 25 +++++++++++++-- .../ocarina-backends-pok_c-runtime.adb | 31 ++++++++++++------- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/src/backends/ocarina-backends-pok_c-main.adb b/src/backends/ocarina-backends-pok_c-main.adb index 0f8a4258..56546a58 100644 --- a/src/backends/ocarina-backends-pok_c-main.adb +++ b/src/backends/ocarina-backends-pok_c-main.adb @@ -648,7 +648,17 @@ package body Ocarina.Backends.POK_C.Main is N := Map_Time (Get_POK_Refresh_Time (F)); end if; else - N := CTU.Make_Literal (CV.New_Int_Value (0, 1, 10)); + if POK_Flavor = DEOS then + + -- + -- DeOS needs a value to refresh the port. + -- + + N := CTU.Make_Literal + (CV.New_Int_Value (1_000_000, 1, 10)); + else + N := CTU.Make_Literal (CV.New_Int_Value (0, 1, 10)); + end if; end if; Append_Node_To_List (N, Call_Parameters); @@ -777,7 +787,17 @@ package body Ocarina.Backends.POK_C.Main is end if; else - N := CTU.Make_Literal (CV.New_Int_Value (0, 1, 10)); + if POK_Flavor = DEOS then + + -- + -- DeOS needs a value to refresh the port. + -- + + N := CTU.Make_Literal + (CV.New_Int_Value (1_000_000, 1, 10)); + else + N := CTU.Make_Literal (CV.New_Int_Value (0, 1, 10)); + end if; end if; Append_Node_To_List (N, Call_Parameters); @@ -978,6 +998,7 @@ package body Ocarina.Backends.POK_C.Main is Statements := New_List (CTN.K_Statement_List); Add_Include (E => RH (RH_Activity)); + Add_Include (E => RH (RH_Gtypes)); if Use_ARINC653_API then Process_Variable_Type := RE (RE_Process_Id_Type); diff --git a/src/backends/ocarina-backends-pok_c-runtime.adb b/src/backends/ocarina-backends-pok_c-runtime.adb index 7f4eaa29..176bf9dd 100644 --- a/src/backends/ocarina-backends-pok_c-runtime.adb +++ b/src/backends/ocarina-backends-pok_c-runtime.adb @@ -131,19 +131,28 @@ package body Ocarina.Backends.POK_C.Runtime is if POK_Flavor = DEOS then + for E in ART_Id loop + RE_Header_Table (E) := RH_Apex; + end loop; + + RE_Header_Table (RE_Pok_Port_Kind_Sampling) := RH_Apex; + RE_Header_Table (RE_Source) := RH_Apex; + RE_Header_Table (RE_Destination) := RH_Apex; + RE_Header_Table (RE_Pok_Errno_Empty) := RH_Apex; + RE_Header_Table (RE_Null) := RH_Apex; + RE_Header_Table (RE_Normal) := RH_Apex; + RE_Header_Table (RE_Bool_T) := RH_Apex; + RE_Header_Table (RE_Uint8_T) := RH_Apex; + RE_Header_Table (RE_Uint16_T) := RH_Apex; + RE_Header_Table (RE_Uint32_T) := RH_Apex; + RE_Header_Table (RE_Uint64_T) := RH_Apex; + RE_Header_Table (RE_Int8_T) := RH_Apex; + RE_Header_Table (RE_Int16_T) := RH_Apex; + RE_Header_Table (RE_Int32_T) := RH_Apex; + RE_Header_Table (RE_Int64_T) := RH_Apex; + for E in ARF_Id loop RE_Header_Table (E) := RH_Apex; - RE_Header_Table (RE_Null) := RH_Apex; - RE_Header_Table (RE_Normal) := RH_Apex; - RE_Header_Table (RE_Bool_T) := RH_Apex; - RE_Header_Table (RE_Uint8_T) := RH_Apex; - RE_Header_Table (RE_Uint16_T) := RH_Apex; - RE_Header_Table (RE_Uint32_T) := RH_Apex; - RE_Header_Table (RE_Uint64_T) := RH_Apex; - RE_Header_Table (RE_Int8_T) := RH_Apex; - RE_Header_Table (RE_Int16_T) := RH_Apex; - RE_Header_Table (RE_Int32_T) := RH_Apex; - RE_Header_Table (RE_Int64_T) := RH_Apex; end loop; for E in ART_Id loop -- GitLab