Commit fca3678e authored by Julien's avatar Julien
Browse files

Start to generate DEOS specific code

parent ab215fe1
......@@ -390,7 +390,7 @@ package body Ocarina.Backends.POK_C.Deployment is
U : Node_Id;
Processes : List_Id;
begin
if POK_Flavor = ARINC653 then
if POK_Flavor = ARINC653 or else POK_Flavor = DEOS then
CTU.Append_Node_To_List
(RE (RE_Pok_Sched_Rr),
CTN.Values (System_Partitions_Scheduler));
......
......@@ -113,14 +113,14 @@ package body Ocarina.Backends.POK_C.Main is
and then ARINC653_Discipline = Priority_Based
then
if POK_Flavor = ARINC653 then
if Use_ARINC653_API then
return RE (RE_Priority);
else
return RE (RE_Pok_Port_Queueing_Discipline_Fifo);
end if;
end if;
if POK_Flavor = ARINC653 then
if Use_ARINC653_API then
return RE (RE_Fifo);
else
return RE (RE_Pok_Port_Queueing_Discipline_Fifo);
......@@ -138,7 +138,7 @@ package body Ocarina.Backends.POK_C.Main is
Member_Value : Node_Id;
begin
-- Initializes thread attributes.
if POK_Flavor = POK then
if Use_ARINC653_API then
N :=
POK_Make_Function_Call_With_Assert
(RF (RE_Pok_Thread_Attr_Init),
......@@ -151,7 +151,7 @@ package body Ocarina.Backends.POK_C.Main is
-- Make tattr.entry = entrypoint
if POK_Flavor = ARINC653 then
if Use_ARINC653_API then
N :=
Make_Expression
(Left_Expr =>
......@@ -183,7 +183,7 @@ package body Ocarina.Backends.POK_C.Main is
if Get_Thread_Priority (E) /= 0 then
N := Make_Literal (New_Int_Value (Get_Thread_Priority (E), 1, 10));
if POK_Flavor = ARINC653 then
if Use_ARINC653_API then
N :=
Make_Expression
(Left_Expr =>
......@@ -207,7 +207,7 @@ package body Ocarina.Backends.POK_C.Main is
end if;
if Get_Thread_Deadline (E) /= Null_Time then
if POK_Flavor = ARINC653 then
if Use_ARINC653_API then
Member_Value :=
Map_Time_To_Millisecond (Get_Thread_Deadline (E));
else
......@@ -326,7 +326,7 @@ package body Ocarina.Backends.POK_C.Main is
end if;
if POK_Flavor = ARINC653 then
if Use_ARINC653_API then
Append_Node_To_List
(POK_Make_Function_Call_With_Assert
(RF (RE_Create_Process),
......
......@@ -124,6 +124,10 @@ package body Ocarina.Backends.POK_C.Runtime is
Initialized := True;
if POK_Flavor = DEOS then
RE_Header_Table (RE_Create_Process) := RH_Apex;
end if;
if POK_Flavor = ARINC653 then
RH_Service_Table (RH_Assert) := RHS_Null;
RH_Service_Table (RH_Thread) := RHS_Core;
......@@ -327,7 +331,7 @@ package body Ocarina.Backends.POK_C.Runtime is
-- members are in upper case. Otherwise, we use
-- lower case.
if POK_Flavor = ARINC653 then
if POK_Flavor = ARINC653 or else POK_Flavor = DEOS then
Name := To_Upper (Name);
else
Name := To_Lower (Name);
......@@ -562,7 +566,7 @@ package body Ocarina.Backends.POK_C.Runtime is
function Get_Errcode_OK return Node_Id is
begin
if POK_Flavor = ARINC653 then
if POK_Flavor = ARINC653 or else POK_Flavor = DEOS then
return RE (RE_No_Error);
else
return RE (RE_Pok_Errno_Ok);
......
......@@ -38,6 +38,7 @@ package Ocarina.Backends.POK_C.Runtime is
type RH_Id is
(RH_Null, -- Workaround to denote a null RH
RH_Activity, -- Activity.h from generated code
RH_Apex, -- apex.h from deos
RH_Assert, -- Assert.h from POK
RH_Blackboard, -- Middleware/blackboard.h from POK
RH_Buffer, -- Middleware/buffer.h from POK
......@@ -512,6 +513,7 @@ package Ocarina.Backends.POK_C.Runtime is
(RH_Null => RHS_Null,
RH_Activity => RHS_Generated,
RH_Assert => RHS_Null,
RH_Apex => RHS_Null,
RH_Blackboard => RHS_Middleware,
RH_Buffer => RHS_Middleware,
RH_Event => RHS_Core,
......@@ -534,7 +536,7 @@ package Ocarina.Backends.POK_C.Runtime is
RH_Subprograms => RHS_Generated,
RH_Deployment => RHS_Generated);
RE_Header_Table : constant array (RE_Id) of RH_Id :=
RE_Header_Table : array (RE_Id) of RH_Id :=
(
-- Runtime functions associations
RE_Pok_Thread_Sleep => RH_Thread,
......
......@@ -196,6 +196,11 @@ package body Ocarina.Backends.POK_C is
Leave_Directory;
end Generate;
function Use_ARINC653_API return Boolean is
begin
return POK_Flavor = ARINC653 or else POK_Flavor = DEOS;
end Use_ARINC653_API;
----------
-- Init --
----------
......@@ -214,6 +219,10 @@ package body Ocarina.Backends.POK_C is
POK_Flavor := ARINC653;
end if;
if Parameter = "deos" then
POK_Flavor := DEOS;
end if;
if Parameter = "no-assert" then
Add_Assertions := False;
end if;
......
......@@ -33,7 +33,7 @@
package Ocarina.Backends.POK_C is
type POK_Flavor_Type is (POK, ARINC653);
type POK_Flavor_Type is (POK, ARINC653, DEOS);
POK_Flavor : POK_Flavor_Type := POK;
......@@ -54,6 +54,9 @@ package Ocarina.Backends.POK_C is
-- Display a message when a modeling pattern is not correct
-- about ports.
function Use_ARINC653_API return Boolean;
-- Indicate if the Flavor uses the ARINC653 API.
private
C_Root : Node_Id;
-- The root of the C trees
......
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