Commit 8fdc5849 authored by Maxime Perrotin's avatar Maxime Perrotin
parents 21255e74 83ba4e8e
......@@ -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-2017 ESA & ISAE. --
-- --
-- PolyORB-HI is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -32,6 +32,7 @@
-- $Id: hello.adb 6273 2009-03-25 17:36:51Z lasnier $
with PolyORB_HI.Output;
with PolyORB_HI.Utils;
package body Hello is
......@@ -41,9 +42,10 @@ package body Hello is
procedure Hello_Spg_1 is
use PolyORB_HI.Output;
use PolyORB_HI.Utils;
begin
Put_Line (Normal, "Hello! This is task ONE");
Put_Line (Normal, "Hello! This is task " & Get_Task_Id'Img);
end Hello_Spg_1;
-----------------
......
......@@ -66,11 +66,11 @@ end Task.impl_2;
processor cpurm
properties
Deployment::Execution_Platform => LEON_ORK;
Deployment::Execution_Platform => Native;
end cpurm;
processor implementation cpurm.impl
properties
properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
end cpurm.impl;
......@@ -91,7 +91,7 @@ end node_a.impl;
-- System --
------------
system rma
system rma
end rma;
system implementation rma.ERC32
......
......@@ -12,6 +12,7 @@ ADA_SPECS_WITH_BODY = $(srcdir)/polyorb_hi-aperiodic_task.ads \
$(srcdir)/polyorb_hi-output.ads \
$(srcdir)/polyorb_hi-periodic_task.ads \
$(srcdir)/polyorb_hi-port_kinds.ads \
$(srcdir)/polyorb_hi-port_types.ads \
$(srcdir)/polyorb_hi-protocols.ads \
$(srcdir)/polyorb_hi-sporadic_task.ads \
$(srcdir)/polyorb_hi-suspenders.ads \
......
......@@ -58,7 +58,9 @@ pragma Restrictions (No_Unchecked_Deallocation); -- J.13 (4)
-- GNAT Specific restrictions
pragma Restrictions (No_Streams); -- GNAT specific
-- pragma Restrictions (No_Streams); -- GNAT specific
-- XXX: this restriction cannot be fullfilled by some drivers relying
-- on Ada.Streams
-- pragma Restrictions (No_Direct_Boolean_Operators); -- GNAT specific
-- For the use of "and then" and "or else" in boolean operations
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2017 ESA & ISAE. --
-- --
-- PolyORB-HI is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -34,6 +34,7 @@ pragma SPARK_Mode (Off);
with PolyORB_HI.Output;
with PolyORB_HI.Suspenders;
pragma Elaborate_All (PolyORB_HI.Suspenders);
with PolyORB_HI.Utils;
package body PolyORB_HI.Periodic_Task is
......@@ -42,6 +43,7 @@ package body PolyORB_HI.Periodic_Task is
use PolyORB_HI.Errors;
use PolyORB_HI.Output;
use PolyORB_HI.Suspenders;
use PolyORB_HI.Utils;
use PolyORB_HI_Generated.Deployment;
Next_Deadline_Val : Time;
......@@ -52,6 +54,10 @@ package body PolyORB_HI.Periodic_Task is
Error : Error_Kind;
begin
-- Register task
Set_Task_Id (Entity);
-- Run the initialize entrypoint (if any)
Activate_Entrypoint;
......
------------------------------------------------------------------------------
-- --
-- PolyORB HI COMPONENTS --
-- --
-- P O L Y O R B _ H I . P O R T _ T Y P E S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2017 ESA & ISAE. --
-- --
-- PolyORB-HI 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. PolyORB-HI 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/>. --
-- --
-- PolyORB-HI/Ada is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
with Ada.Unchecked_Conversion;
with PolyORB_HI.Utils; use PolyORB_HI.Utils;
package body PolyORB_HI.Port_Types is
-------------------
-- Internal_Code --
-------------------
function Internal_Code (P : Port_Type) return Unsigned_16 is
function To_Internal_Code is new Ada.Unchecked_Conversion
(Port_Type, Unsigned_16);
begin
return Swap_Bytes (To_Internal_Code (P));
end Internal_Code;
------------------------
-- Corresponding_Port --
------------------------
function Corresponding_Port (I : Unsigned_16) return Port_Type is
function To_Corresponding_Port is new Ada.Unchecked_Conversion
(Unsigned_16, Port_Type);
begin
return To_Corresponding_Port (Swap_Bytes (I));
end Corresponding_Port;
end PolyORB_HI.Port_Types;
------------------------------------------------------------------------------
-- --
-- PolyORB HI COMPONENTS --
-- --
-- P O L Y O R B _ H I . P O R T _ T Y P E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2017 ESA & ISAE. --
-- --
-- PolyORB-HI 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. PolyORB-HI 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/>. --
-- --
-- PolyORB-HI/Ada is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
with PolyORB_HI_Generated.Deployment; use PolyORB_HI_Generated.Deployment;
with Interfaces; use Interfaces;
package PolyORB_HI.Port_Types is
function Internal_Code (P : Port_Type) return Unsigned_16;
function Corresponding_Port (I : Unsigned_16) return Port_Type;
end PolyORB_HI.Port_Types;
......@@ -31,6 +31,7 @@
with PolyORB_HI.Output;
with PolyORB_HI.Suspenders;
with PolyORB_HI.Utils;
package body PolyORB_HI.Sporadic_Task is
......@@ -39,6 +40,7 @@ package body PolyORB_HI.Sporadic_Task is
use PolyORB_HI.Output;
use PolyORB_HI_Generated.Deployment;
use PolyORB_HI.Suspenders;
use PolyORB_HI.Utils;
Next_Deadline_Val : Time;
......@@ -52,6 +54,10 @@ package body PolyORB_HI.Sporadic_Task is
Error : Error_Kind;
begin
-- Register task
Set_Task_Id (Entity);
-- Run the initialize entrypoint (if any)
Activate_Entrypoint;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2016 ESA & ISAE. --
-- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2017 ESA & ISAE. --
-- --
-- PolyORB-HI is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -38,6 +38,7 @@ with PolyORB_HI.Streams;
with PolyORB_HI.Time_Marshallers;
with PolyORB_HI.Unprotected_Queue;
with POlyORB_HI.Utils;
with POlyORB_HI.Port_Types;
package body PolyORB_HI.Thread_Interrogators is
......@@ -46,6 +47,7 @@ package body PolyORB_HI.Thread_Interrogators is
use type PolyORB_HI.Streams.Stream_Element_Offset;
use PolyORB_HI.Output;
use PolyORB_HI.Port_Kinds;
use POlyORB_HI.Port_Types;
use PolyORB_HI.Utils;
--------
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2017 ESA & ISAE. --
-- --
-- PolyORB-HI is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -29,6 +29,8 @@
-- --
------------------------------------------------------------------------------
with Ada.Task_Identification; use Ada.Task_Identification;
package body PolyORB_HI.Utils is
------------------
......@@ -90,28 +92,6 @@ package body PolyORB_HI.Utils is
end if;
end Swap_Bytes;
-------------------
-- Internal_Code --
-------------------
function Internal_Code (P : Port_Type) return Unsigned_16 is
function To_Internal_Code is new Ada.Unchecked_Conversion
(Port_Type, Unsigned_16);
begin
return Swap_Bytes (To_Internal_Code (P));
end Internal_Code;
------------------------
-- Corresponding_Port --
------------------------
function Corresponding_Port (I : Unsigned_16) return Port_Type is
function To_Corresponding_Port is new Ada.Unchecked_Conversion
(Unsigned_16, Port_Type);
begin
return To_Corresponding_Port (Swap_Bytes (I));
end Corresponding_Port;
------------------
-- Parse_String --
------------------
......@@ -131,4 +111,30 @@ package body PolyORB_HI.Utils is
return Last;
end Parse_String;
-----------------
-- Set_Task_Id --
-----------------
Task_Id_Mapping : array (Entity_Type'Range) of Task_Id;
procedure Set_Task_Id (My_Id : Entity_Type) is
begin
Task_Id_Mapping (My_Id) := Current_Task;
end Set_Task_Id;
-----------------
-- Get_Task_Id --
-----------------
function Get_Task_Id return Entity_Type is
My_Task_Id : constant Task_Id := Current_Task;
begin
for J in Task_Id_Mapping'Range loop
if Task_Id_Mapping (J) = Current_Task then
return J;
end if;
end loop;
return Entity_Type'First;
end Get_Task_Id;
end PolyORB_HI.Utils;
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2017 ESA & ISAE. --
-- --
-- PolyORB-HI is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -69,9 +69,6 @@ package PolyORB_HI.Utils is
function Corresponding_Node is new Ada.Unchecked_Conversion
(Unsigned_8, Node_Type);
function Internal_Code (P : Port_Type) return Unsigned_16;
function Corresponding_Port (I : Unsigned_16) return Port_Type;
function Swap_Bytes (B : Interfaces.Unsigned_16)
return Interfaces.Unsigned_16;
-- Swap bytes iff the host is little endian. This function is
......@@ -119,6 +116,13 @@ package PolyORB_HI.Utils is
type Naming_Table_Type is array (Node_Type'Range)
of PolyORB_HI.Utils.Naming_Entry;
---------------------
-- Task_Id mapping --
---------------------
procedure Set_Task_Id (My_Id : Entity_Type);
function Get_Task_Id return Entity_Type;
private
type HI_String is record
......
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