Commit 7ae0ece9 authored by yoogx's avatar yoogx

* Suppress RTSJ backend

parent 9e2e4ba4
......@@ -62,8 +62,7 @@ TREE_PIDL_SPECS = src/core/tree/ocarina-me_aadl-aadl_tree-nodes.idl \
src/backends/ocarina-backends-asn1_tree-nodes.idl \
src/backends/ocarina-backends-xml_tree-nodes.idl \
src/backends/ocarina-backends-pn-nodes.idl \
src/backends/ocarina-backends-mast_tree-nodes.idl \
src/backends/ocarina-backends-rtsj_tree-nodes.idl
src/backends/ocarina-backends-mast_tree-nodes.idl
TREE_ADA_SPECS = ${addprefix $(top_builddir)/, $(TREE_PIDL_SPECS:.idl=.ads)}
TREE_ADA_BODIES = ${addprefix $(top_builddir)/, $(TREE_PIDL_SPECS:.idl=.adb)}
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2016 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -267,9 +267,6 @@ package body Ocarina.Backends.Build_Utils is
when PolyORB_HI_C =>
Language := Language_C;
when PolyORB_HI_RTSJ =>
Language := Language_RTSJ;
when others =>
raise Program_Error;
end case;
......
This diff is collapsed.
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- OCARINA.BACKENDS.PO_HI_RTSJ.ACTIVITY --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. Ocarina is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
-- This package contains routine to build the subtree relative to the
-- <Node>_Activity package that contains the mapping of periodic threads
-- and shared data.
package Ocarina.Backends.PO_HI_RTSJ.Activity is
package Source_File is
procedure Visit (E : Node_Id);
end Source_File;
end Ocarina.Backends.PO_HI_RTSJ.Activity;
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- OCARINA.BACKENDS.PO_HI_RTSJ.DEPLOYMENT --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. Ocarina is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
-- This package contains routine to build the subtree relative to the
-- PolyORB_HI_Generated.Deployment package that contains deployment
-- information on the distributed application "seen" by a given node.
package Ocarina.Backends.PO_HI_RTSJ.Deployment is
package Source_File is
procedure Visit (E : Node_Id);
end Source_File;
end Ocarina.Backends.PO_HI_RTSJ.Deployment;
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- OCARINA.BACKENDS.PO_HI_RTSJ.GENERATED_TYPES --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. Ocarina is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
-- This package contains routine to build the subtree relative to the
-- <Node>_Types package that contains the mapping data components.
package Ocarina.Backends.PO_HI_RTSJ.Generated_Types is
package Source_File is
procedure Visit (E : Node_Id);
end Source_File;
end Ocarina.Backends.PO_HI_RTSJ.Generated_Types;
This diff is collapsed.
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- O C A R I N A . B A C K E N D S . P O _ H I _ R T S J . M A I N --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. Ocarina is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
-- This package contains routine to build the subtree relative to the
-- <Node> subprogram that contains the main subprogram corresponding
-- to each node
package Ocarina.Backends.PO_HI_RTSJ.Main is
package Source_File is
procedure Visit (E : Node_Id);
end Source_File;
end Ocarina.Backends.PO_HI_RTSJ.Main;
This diff is collapsed.
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- O C A R I N A . B A C K E N D S . P O _ H I _ R T S J . M A P P I N G --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. Ocarina is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
-- This package contains routines to map entities from the AADL tree
-- into entities of the PolyORB-HI Java tree
with Ocarina.Backends.Properties; use Ocarina.Backends.Properties;
package Ocarina.Backends.PO_HI_RTSJ.Mapping is
function Map_Distributed_Application (E : Node_Id) return Node_Id;
function Map_HI_Node (E : Node_Id) return Node_Id;
function Map_HI_Unit (E : Node_Id) return Node_Id;
function Map_RTSJ_Defining_Identifier
(E : Node_Id;
Is_Obj : Boolean := False) return Node_Id;
function Map_RTSJ_Enumerator_Name (E : Node_Id) return Name_Id;
function Map_RTSJ_Subprogram_Identifier (E : Node_Id) return Node_Id;
function Map_RTSJ_Subprogram_Spec (E : Node_Id) return Node_Id;
function Map_RTSJ_Subprogram_Body (E : Node_Id) return Node_Id;
function Map_Handler_Identifier
(E : Node_Id;
TaskHandler : Boolean := False;
EventHandler : Boolean := False) return Node_Id;
function Map_Handler_Class_Identifier
(E : Node_Id;
TaskHandler : Boolean := False;
EventHandler : Boolean := False) return Node_Id;
function Map_Priority_Identifier (E : Node_Id) return Node_Id;
function Map_Task_Job_Identifier (E : Node_Id) return Node_Id;
function Map_Task_Ports_Router_Identifier (E : Node_Id) return Node_Id;
function Map_Task_Port_Identifier (E : Node_Id) return Node_Id;
function Map_Task_Entries_Identifier (E : Node_Id) return Node_Id;
function Map_Task_Deliver_Identifier (E : Node_Id) return Node_Id;
function Map_Task_Send_Identifier (E : Node_Id) return Node_Id;
function Map_Port_Default_Entry (E : Node_Id) return Node_Id;
function Map_Port_Default_Value (E : Node_Id) return Node_Id;
function Map_Port_Destinations_Tab (E : Node_Id) return Node_Id;
function Map_Subprogram_Param_Identifier (E : Node_Id) return Node_Id;
function Map_Time_Unit (T : Time_Type) return Node_Id;
function Map_Time_Value (T : Time_Type) return Node_Id;
procedure Bind_AADL_To_Main (G : Node_Id; A : Node_Id);
procedure Bind_AADL_To_Activity (G : Node_Id; A : Node_Id);
procedure Bind_AADL_To_Deployment (G : Node_Id; A : Node_Id);
procedure Bind_AADL_To_Subprogram (G : Node_Id; A : Node_Id);
procedure Bind_AADL_To_Naming (G : Node_Id; A : Node_Id);
procedure Bind_AADL_To_Generated_Types (G : Node_Id; A : Node_Id);
procedure Bind_AADL_To_Transport_High_Level (G : Node_Id; A : Node_Id);
end Ocarina.Backends.PO_HI_RTSJ.Mapping;
This diff is collapsed.
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- O C A R I N A . B A C K E N D S . P O _ H I _ R T S J . N A M I N G --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. Ocarina is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
-- This package contains routine to build the subtree relative to the
-- <Node>_Naming package that contains the mapping of DATA types and
-- subprograms
package Ocarina.Backends.PO_HI_RTSJ.Naming is
package Source_File is
procedure Visit (E : Node_Id);
end Source_File;
end Ocarina.Backends.PO_HI_RTSJ.Naming;
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- O C A R I N A . B A C K E N D S . P O _ H I _ R T S J . R U N T I M E --
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. Ocarina is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
with GNAT.OS_Lib; use GNAT.OS_Lib;
with GNAT.Case_Util;
with Utils; use Utils;
with Charset; use Charset;
with Ocarina.Namet; use Ocarina.Namet;
with Ocarina.Backends.RTSJ_Tree.Nodes;
with Ocarina.Backends.RTSJ_Tree.Nutils;
package body Ocarina.Backends.PO_HI_RTSJ.Runtime is
use Ocarina.Backends.RTSJ_Tree.Nodes;
use Ocarina.Backends.RTSJ_Tree.Nutils;
Initialized : Boolean := False;
-- Arrays of runtime entities and unit designators
RED : array (RE_Id) of Node_Id := (RE_Id'Range => No_Node);
RHD : array (RH_Id) of Node_Id := (RH_Id'Range => No_Node);
type Casing_Rule is record
Size : Natural;
From : String_Access;
Into : String_Access;
end record;
Rules : array (1 .. 64) of Casing_Rule;
Rules_Last : Natural := 0;
procedure Apply_Casing_Rules (S : in out String);
-- Apply the registered casing rule on the String S
procedure Register_Casing_Rule (S : String);
-- Register a custom casing rule
------------------------
-- Apply_Casing_Rules --
------------------------
procedure Apply_Casing_Rules (S : in out String) is
New_Word : Boolean := True;
Length : Natural := S'Length;
S1 : constant String := To_Lower (S);
begin
GNAT.Case_Util.To_Mixed (S);
for I in S'Range loop
if New_Word then
New_Word := False;
for J in 1 .. Rules_Last loop
if Rules (J).Size <= Length
and then S1 (I .. I + Rules (J).Size - 1) = Rules (J).From.all
then
S (I .. I + Rules (J).Size - 1) := Rules (J).Into.all;
end if;
end loop;
end if;
if S (I) = '_' then
New_Word := True;
for J in 1 .. Rules_Last loop
if Rules (J).Size <= Length
and then S1 (I .. I + Rules (J).Size - 1) = Rules (J).From.all
then
S (I .. I + Rules (J).Size - 1) := Rules (J).Into.all;
end if;
end loop;
end if;
Length := Length - 1;
end loop;
end Apply_Casing_Rules;
----------------
-- Initialize --
----------------
procedure Initialize is
Name : Name_Id;
N : Node_Id;
begin
-- Initialize the runtime only once
if Initialized then
return;
end if;
Initialized := True;
Register_Casing_Rule ("AADL");
for E in RM_Id loop
Set_Str_To_Name_Buffer (RM_Id'Image (E));
Set_Str_To_Name_Buffer (Name_Buffer (4 .. Name_Len));
Apply_Casing_Rules (Name_Buffer (1 .. Name_Len));
Name :=
To_RTSJ_Conventional_Name
(Get_String_Name (Name_Buffer (1 .. Name_Len)),
True);
Name :=
Add_Prefix_To_Name ("fr.enst.ocarina.polyORB_HI_runtime.", Name);
N := New_Node (K_Defining_Identifier);
Set_Name (N, Name);
RHD (E) := Make_Import_Statement (N);
end loop;
for E in RN_Id loop
Set_Str_To_Name_Buffer (RN_Id'Image (E));
Set_Str_To_Name_Buffer (Name_Buffer (4 .. Name_Len));
Apply_Casing_Rules (Name_Buffer (1 .. Name_Len));
Name :=
To_RTSJ_Conventional_Name
(Get_String_Name (Name_Buffer (1 .. Name_Len)),
True);
Name := Add_Prefix_To_Name ("javax.realtime.", Name);
N := New_Node (K_Defining_Identifier);
Set_Name (N, Name);
RHD (E) := Make_Import_Statement (N);
end loop;
for E in RC_Id loop
Set_Str_To_Name_Buffer (RC_Id'Image (E));
Set_Str_To_Name_Buffer (Name_Buffer (4 .. Name_Len));
Apply_Casing_Rules (Name_Buffer (1 .. Name_Len));
Name := To_Upper (Name_Find);
RED (E) := New_Node (K_Defining_Identifier);
Set_Name (RED (E), Name);
end loop;
for E in RV_Id loop
Set_Str_To_Name_Buffer (RV_Id'Image (E));
Set_Str_To_Name_Buffer (Name_Buffer (4 .. Name_Len));
Apply_Casing_Rules (Name_Buffer (1 .. Name_Len));
Name :=
To_RTSJ_Conventional_Name
(Get_String_Name (Name_Buffer (1 .. Name_Len)),
False);
RED (E) := New_Node (K_Defining_Identifier);
Set_Name (RED (E), Name);
end loop;
for E in RT_Id loop
Set_Str_To_Name_Buffer (RT_Id'Image (E));
Set_Str_To_Name_Buffer (Name_Buffer (4 .. Name_Len));
Apply_Casing_Rules (Name_Buffer (1 .. Name_Len));
Name :=
To_RTSJ_Conventional_Name
(Get_String_Name (Name_Buffer (1 .. Name_Len)),
True);
RED (E) := New_Node (K_Defining_Identifier);
Set_Name (RED (E), Name);
end loop;
end Initialize;
-----------
-- Reset --
-----------
procedure Reset is
begin
RED := (RE_Id'Range => No_Node);
RHD := (RH_Id'Range => No_Node);
Rules_Last := 0;
Initialized := False;
end Reset;
--------
-- RE --
--------
function RE (Id : RE_Id) return Node_Id is
begin
if RE_Header_Table (Id) /= RH_Null then
Add_Import (RH (RE_Header_Table (Id)));
end if;
return Copy_Node (RED (Id));
end RE;
--------
-- RH --
--------
function RH (Id : RH_Id) return Node_Id is
begin
return Copy_Node (RHD (Id));
end RH;
--------------------------
-- Register_Casing_Rule --
--------------------------
procedure Register_Casing_Rule (S : String) is
begin
Rules_Last := Rules_Last + 1;
Rules (Rules_Last).Size := S'Length;
Rules (Rules_Last).Into := new String'(S);
Rules (Rules_Last).From := new String'(S);
To_Lower (Rules (Rules_Last).From.all);
end Register_Casing_Rule;
end Ocarina.Backends.PO_HI_RTSJ.Runtime;
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- O C A R I N A . B A C K E N D S . P O _ H I _ R T S J . R U N T I M E --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. Ocarina is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
package Ocarina.Backends.PO_HI_RTSJ.Runtime is
-- Headers file that can be included
type RH_Id is
(RH_Null,
--
RH_Suspenders, -- Runtime imports
RH_Utils,
RH_Context,
RH_Deployment,
RH_Periodic_Task,
RH_Sporadic_Task,
RH_Hybrid_Task,
RH_Program_Exception,
RH_Task_Handler,
RH_Event_Handler,
RH_TimeUnit,
RH_Generated_Type,
RH_Message,
RH_Marshallers,
RH_Transport_High_Level,
RH_Transport_Low_Level_Sockets,
RH_In_Port,
RH_Out_Port,
RH_Ports_Router,
--
RH_Immortal_Memory, -- javax.realtime imports
RH_No_Heap_Realtime_Thread);
-- Runtime Entities
type RE_Id is
(RE_Null,
--
RE_Job,
RE_Initialize_Entrypoint,
RE_Recover_Entrypoint,
RE_Handle_Event,
RE_Wait_For_Events,
RE_Periodic_Task,
RE_Sporadic_Task,
RE_Hybrid_Task,
RE_Suspend_Forever,
RE_Unblock_All_Tasks,
RE_Wait_Initialization,
RE_Compute_System_Priority,
RE_Store,
RE_Set,
RE_Copy,
RE_Put_Int,
RE_Get_Int,
RE_Rewind,