Commit 5019f5ef authored by Julien's avatar Julien

Generated code starting to work for VxWorks

  - Introduce the -k vxworks653 flag
  - First example working with a single partition
parent df7e9a26
......@@ -522,13 +522,13 @@ package body Ocarina.Backends.POK_C.Deployment is
end if;
--
-- If we are using DEOS, we do not need
-- If we are using DEOS or VxWorks, we do not need
-- to write code to configure the kernel, this
-- is done through the XML file of the deos_conf
-- backend.
--
if POK_Flavor = DEOS then
if POK_Flavor = DEOS or else POK_Flavor = VXWORKS then
Reset_Handlings;
Pop_Entity;
......@@ -2488,7 +2488,7 @@ package body Ocarina.Backends.POK_C.Deployment is
-- backend.
--
if POK_Flavor = DEOS then
if POK_Flavor = DEOS or else POK_Flavor = VXWORKS then
Pop_Entity;
Pop_Entity;
......
......@@ -152,7 +152,7 @@ package body Ocarina.Backends.POK_C.Main is
-- Make strcpy(tattr.NAME, "prname")
if POK_Flavor = DEOS then
if POK_Flavor = DEOS or else POK_Flavor = VXWORKS then
N :=
Make_Call_Profile
(Make_Defining_Identifier
......@@ -254,7 +254,7 @@ package body Ocarina.Backends.POK_C.Main is
if POK_Flavor = POK then
Member_Value := Map_Time_To_Millisecond
(Get_Thread_Period (E));
elsif POK_Flavor = DEOS then
elsif POK_Flavor = DEOS or else POK_Flavor = VXWORKS then
Member_Value := Map_Time_To_Nanosecond
(Get_Thread_Period (E));
end if;
......@@ -313,6 +313,8 @@ package body Ocarina.Backends.POK_C.Main is
Capacity := Map_Time_To_Millisecond (TA (1));
elsif POK_Flavor = DEOS then
Capacity := Map_Time_To_Nanosecond (TA (1));
elsif POK_Flavor = VXWORKS then
Capacity := Map_Time_To_Nanosecond (TA (1));
else
Capacity := No_Node;
end if;
......@@ -653,7 +655,9 @@ package body Ocarina.Backends.POK_C.Main is
N := Map_Time (Get_POK_Refresh_Time (F));
end if;
else
if POK_Flavor = DEOS then
if POK_Flavor = DEOS
or else POK_Flavor = VXWORKS
then
--
-- DeOS needs a value to refresh the port.
......
......@@ -162,6 +162,41 @@ package body Ocarina.Backends.POK_C.Runtime is
end loop;
end if;
if POK_Flavor = VXWORKS then
for E in ART_Id loop
RE_Header_Table (E) := RH_ApexType;
end loop;
RE_Header_Table (RE_Periodic_Wait) := RH_ApexTime;
RE_Header_Table (RE_Create_Process) := RH_ApexProcess;
RE_Header_Table (RE_Start) := RH_ApexProcess;
RE_Header_Table (RE_Create_Process) := RH_ApexProcess;
RE_Header_Table (RE_Set_Partition_Mode) := RH_ApexPartition;
RE_Header_Table (RE_Normal) := RH_ApexType;
RE_Header_Table (RE_Process_Attribute_Type) := RH_ApexType;
RE_Header_Table (RE_Fifo) := RH_ApexType;
RE_Header_Table (RE_Pok_Port_Kind_Sampling) := RH_ApexType;
RE_Header_Table (RE_Pok_Port_Kind_Queueing) := RH_ApexType;
RE_Header_Table (RE_Source) := RH_ApexType;
RE_Header_Table (RE_Destination) := RH_ApexType;
RE_Header_Table (RE_Pok_Errno_Empty) := RH_ApexType;
RE_Header_Table (RE_Null) := RH_ApexType;
RE_Header_Table (RE_Normal) := RH_ApexType;
RE_Header_Table (RE_Bool_T) := RH_ApexType;
RE_Header_Table (RE_Uint8_T) := RH_ApexType;
RE_Header_Table (RE_Uint16_T) := RH_ApexType;
RE_Header_Table (RE_Uint32_T) := RH_ApexType;
RE_Header_Table (RE_Uint64_T) := RH_ApexType;
RE_Header_Table (RE_Int8_T) := RH_ApexType;
RE_Header_Table (RE_Int16_T) := RH_ApexType;
RE_Header_Table (RE_Int32_T) := RH_ApexType;
RE_Header_Table (RE_Int64_T) := RH_ApexType;
end if;
if POK_Flavor = ARINC653 then
RH_Service_Table (RH_Assert) := RHS_Null;
RH_Service_Table (RH_Thread) := RHS_Core;
......@@ -365,7 +400,9 @@ package body Ocarina.Backends.POK_C.Runtime is
-- members are in upper case. Otherwise, we use
-- lower case.
if POK_Flavor = ARINC653 or else POK_Flavor = DEOS then
if POK_Flavor = ARINC653 or else POK_Flavor = DEOS
or else POK_Flavor = VXWORKS
then
Name := To_Upper (Name);
else
Name := To_Lower (Name);
......
......@@ -39,6 +39,17 @@ package Ocarina.Backends.POK_C.Runtime is
(RH_Null, -- Workaround to denote a null RH
RH_Activity, -- Activity.h from generated code
RH_Apex, -- apex.h from deos
RH_ApexType, -- apexType.h from vxworks653
RH_ApexProcess, -- apexProcess.h from vxworks653
RH_ApexPartition, -- apexPartition.h from vxworks653
RH_ApexBuffer, -- apexBuffer.h from vxworks653
RH_ApexBlackboard, -- apexBlackboard.h from vxworks653
RH_ApexEvent, -- apexEvent.h from vxworks653
RH_ApexError, -- apexError.h from vxworks653
RH_ApexQueuing, -- apexQueuing.h from vxworks653
RH_ApexSampling, -- apexSampling.h from vxworks653
RH_ApexSemaphore, -- apexSemaphore.h from vxworks653
RH_ApexTime, -- apexTime.h from vxworks653
RH_Assert, -- Assert.h from POK
RH_Blackboard, -- Middleware/blackboard.h from POK
RH_Buffer, -- Middleware/buffer.h from POK
......@@ -67,6 +78,7 @@ package Ocarina.Backends.POK_C.Runtime is
(RHS_Null,
RHS_Generated,
RHS_ARINC653,
RHS_Apex,
RHS_Middleware,
RHS_Protocols,
RHS_Core);
......@@ -522,7 +534,18 @@ package Ocarina.Backends.POK_C.Runtime is
RH_Thread => RHS_Core,
RH_Time => RHS_Core,
RH_Errno => RHS_Null,
RH_Kernel => RHS_Core,
RH_ApexType => RHS_Apex,
RH_ApexProcess => RHS_Apex,
RH_ApexPartition => RHS_Apex,
RH_ApexBuffer => RHS_Apex,
RH_ApexBlackboard => RHS_Apex,
RH_ApexEvent => RHS_Apex,
RH_ApexError => RHS_Apex,
RH_ApexQueuing => RHS_Apex,
RH_ApexSampling => RHS_Apex,
RH_ApexSemaphore => RHS_Apex,
RH_ApexTime => RHS_Apex,
RH_Kernel => RHS_Core,
RH_Error => RHS_Core,
RH_Partition => RHS_Core,
RH_Port => RHS_Middleware,
......
......@@ -128,7 +128,7 @@ package body Ocarina.Backends.POK_C is
C_Tree.Generator.Generate (C_Root);
end if;
if POK_Flavor /= DEOS then
if POK_Flavor /= DEOS and then POK_Flavor /= VXWORKS then
Makefile.Visit (Instance_Root);
end if;
......@@ -200,7 +200,8 @@ package body Ocarina.Backends.POK_C is
function Use_ARINC653_API return Boolean is
begin
return POK_Flavor = ARINC653 or else POK_Flavor = DEOS;
return POK_Flavor = ARINC653 or else POK_Flavor = DEOS
or else POK_Flavor = VXWORKS;
end Use_ARINC653_API;
----------
......@@ -225,6 +226,10 @@ package body Ocarina.Backends.POK_C is
POK_Flavor := DEOS;
end if;
if Parameter = "vxworks653" then
POK_Flavor := VXWORKS;
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, DEOS);
type POK_Flavor_Type is (POK, ARINC653, DEOS, VXWORKS);
POK_Flavor : POK_Flavor_Type := POK;
......
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