Commit 1edef6d1 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Synced with master branch in GitHub/OpenAADL/polyorb-hi-ada

parents b943604f 447efaab
PolyORB-HI/Ada runtime
======================
# PolyORB-HI/Ada runtime
[![Build Status](https://travis-ci.org/OpenAADL/polyorb-hi-ada.svg?branch=master)](https://travis-ci.org/OpenAADL/polyorb-hi-ada)
## About
This is the PolyORB-HI/Ada runtime, a high-integrity middleware used
in conjunction with code generation from AADL models using Ocarina.
PolyORB-HI/Ada is a high-integrity middleware. It provides core middleware constructs, and must be used in conjunction with code generation from AADL models by [Ocarina](https://github.com/OpenAADL/ocarina).
The recommended installation process is through the proper
configuration and installation of Ocarina, see Ocarina documentation
for details.
PolyORB-HI/Ada is implemented in [Ada 2012](http://www.ada2012.org), and is compatible with native and Ravenscar Ada runtimes.
It has been tested on Linux, OS X, Windows and RTEMS.
## Installation
The recommended installation process is through the proper configuration and installation of [Ocarina](https://github.com/OpenAADL/ocarina), see Ocarina documentation for details.
## Q&A
Build status for Linux and OS X: [![Build Status](https://travis-ci.org/OpenAADL/polyorb-hi-ada.svg?branch=master)](https://travis-ci.org/OpenAADL/polyorb-hi-ada)
AC_PREREQ(2.57)
AC_INIT(PolyORB-HI/Ada, 2017.1)
AC_INIT(PolyORB-HI/Ada, 2017.x)
AC_CONFIG_SRCDIR(src)
AC_CONFIG_AUX_DIR(support)
......
......@@ -30,6 +30,7 @@ ADA_SPECS = $(ADA_SPECS_WITH_BODY) $(srcdir)/polyorb_hi.ads \
$(srcdir)/polyorb_hi-transport_low_level.ads
ADA_BODIES = $(ADA_SPECS_WITH_BODY:.ads=.adb) \
$(srcdir)/polyorb_hi-output_low_level_gnatruntime.adb \
$(srcdir)/polyorb_hi-output_low_level_leon.adb \
$(srcdir)/polyorb_hi-output_low_level_native.adb \
$(srcdir)/polyorb_hi-transport_low_level_sockets.adb
......
-- Ada restrictions to be supported by the PolyORB HI, for HI targets
-- Ada restrictions to be supported by PolyORB-HI/Ada, for HI targets
--------------------------------------------------------------------------------
-- Enforce Ravenscar profile.
pragma Profile (Ravenscar); -- D.13.1
-- pragma Restrictions (No_Dependence => Ada.Finalization); -- 13.12.1 (12)
-- No controlled types, cannot be enforced for native compilers
-- because of the s-tpoben file.
--------------------------------------------------------------------------------
-- Activate SPARK Mode, even if we do not actually use it on the
-- target: the code has Spark_Mode disabled in some occurences,
-- without this pragma the code would be rejected.
--pragma Spark_Mode (On);
--------------------------------------------------------------------------------
-- The following define restrictions to be supported by the
-- PolyORB-HI, common restrictions
--
-- For each restriction, we list its definition place in the Ada 2005
-- reference manual.
pragma Restrictions (No_Allocators); -- H.4 (7)
-- pragma Restrictions (No_Floating_Point); -- H.4 (14)
pragma Restrictions (No_Access_Subprograms); -- H.4 (17)
pragma Restrictions (No_Unchecked_Access); -- H.4 (18)
pragma Restrictions (No_Dispatch); -- H.4 (19)
pragma Restrictions (No_IO); -- H.4 (20)
pragma Restrictions (No_Recursion); -- H.4 (22)
-- pragma Partition_Elaboration_Policy (Sequential); -- H.6 (3)
-- This policy eases task initial synchronization and the bootstrap
-- of the VM, see Ada 2005 Rationale for more details). (Not yet
-- supported by GNAT for Native platforms)
-- pragma Restriction_Warnings (No_Implementation_Attributes); -- 13.12 (2)
-- Style-check to enforce compliance with pure Ada, but also to avoid
-- the 'Unrestricted_Access attribute, which is GNAT specific.
-- pragma Restrictions (No_Obsolescent_Features); -- 13.12 (4)
-- Deactivated as of 20090702: GPL 2009 deprecated
-- GNAT.Sockets.Initialize, but it might still be required for older
-- compilers supported.
pragma Restrictions (No_Unchecked_Deallocation); -- J.13 (4)
-- Sibling of the No_Allocators restriction.
-- XXX to be replaced with a No_Dependence restriction
-- GNAT Specific restrictions
pragma Restrictions (No_Streams); -- GNAT specific
-- pragma Restrictions (No_Dependence => Ada.Streams); -- 13.12.1 (12)
-- No implicit dependency on Ada.Tags and other object oriented
-- compiler units. Cannot be enforced for native platforms because of
-- the g-socket file
-- pragma Restrictions (No_Direct_Boolean_Operators); -- GNAT specific
-- For the use of "and then" and "or else" in boolean operations
-- pragma Restrictions (No_Exception_Handlers); -- GNAT specific
-- Implied by GNAT Pro 5.03a1 for High-Integrity, for the Ravenscar
-- run-time, cannot be enforced for native compilers because of the
-- s-tpoben file.
-- pragma Restrictions (No_Enumeration_Maps); -- GNAT specific
-- Forbids <type>'Image for enumeration types. Cannot be supported
-- because some examples use it
-- pragma Restrictions (No_Secondary_Stack); -- GNAT specific
-- No unconstrained objects, including arrays, but also forbids
-- string concatenation. (GNAT specific)
-- pragma Restrictions (No_Implicit_Conditionals); -- GNAT specific
-- pragma Restrictions (No_Implicit_Loops); -- GNAT specific
-- Ada restrictions to be supported by PolyORB HI, for native targets
-- Ada restrictions to be supported by PolyORB-HI/Ada, for NATIVE targets
pragma Profile_Warnings (Ravenscar); -- D.13.1
--------------------------------------------------------------------------------
-- Enforce Ravenscar profile.
--
-- Note that NATIVE targets are not Ravenscar compatible, we simply
-- look for warning. The user must run the program with admin rights
-- to have the right scheduling behavior.
--pragma Task_Dispatching_Policy (FIFO_Within_Priotities); -- D.13.1
-- Note: GCC 4.3.5 does not support this policy, changed to binder
-- option "-T0" per section A.3 of the GNAT user manual
pragma Locking_Policy (Ceiling_Locking); -- D.13.1
pragma Profile_Warnings (Ravenscar); -- D.13.1
--------------------------------------------------------------------------------
-- Activate SPARK Mode, even if we do not actually use it on the
-- target: the code has Spark_Mode disabled in some occurences,
-- without this pragma the code would be rejected.
--pragma Spark_Mode (On);
--------------------------------------------------------------------------------
-- The following define restrictions to be supported by the
-- PolyORB-HI, common restrictions
--
-- For each restriction, we list its definition place in the Ada 2005
-- reference manual.
pragma Restrictions (No_Allocators); -- H.4 (7)
-- pragma Restrictions (No_Floating_Point); -- H.4 (14)
pragma Restrictions (No_Access_Subprograms); -- H.4 (17)
pragma Restrictions (No_Unchecked_Access); -- H.4 (18)
pragma Restrictions (No_Dispatch); -- H.4 (19)
pragma Restrictions (No_IO); -- H.4 (20)
pragma Restrictions (No_Recursion); -- H.4 (22)
-- pragma Partition_Elaboration_Policy (Sequential); -- H.6 (3)
-- This policy eases task initial synchronization and the bootstrap
-- of the VM, see Ada 2005 Rationale for more details). (Not yet
-- supported by GNAT for Native platforms)
-- pragma Restriction_Warnings (No_Implementation_Attributes); -- 13.12 (2)
-- Style-check to enforce compliance with pure Ada, but also to avoid
-- the 'Unrestricted_Access attribute, which is GNAT specific.
-- pragma Restrictions (No_Obsolescent_Features); -- 13.12 (4)
-- Deactivated as of 20090702: GPL 2009 deprecated
-- GNAT.Sockets.Initialize, but it might still be required for older
-- compilers supported.
pragma Restrictions (No_Unchecked_Deallocation); -- J.13 (4)
-- Sibling of the No_Allocators restriction.
-- XXX to be replaced with a No_Dependence restriction
-- GNAT Specific restrictions
pragma Restrictions (No_Streams); -- GNAT specific
-- pragma Restrictions (No_Direct_Boolean_Operators); -- GNAT specific
-- For the use of "and then" and "or else" in boolean operations
-- pragma Restrictions (No_Enumeration_Maps); -- GNAT specific
-- Forbids <type>'Image for enumeration types. Cannot be supported
-- because some examples use it
-- pragma Restrictions (No_Implicit_Conditionals); -- GNAT specific
-- pragma Restrictions (No_Implicit_Loops); -- GNAT specific
......@@ -179,8 +179,8 @@ package body PolyORB_HI.Output is
PolyORB_HI.Output_Low_Level.Put ("[");
-- XXX The following is disabled as some cross-runtime do not have
-- the capability to build Duration'Image
-- PolyORB_HI.Output_Low_Level.Put
-- (Duration'Image (To_Duration (Elapsed * 1000)));
PolyORB_HI.Output_Low_Level.Put
(Integer'Image (Integer (To_Duration (Elapsed * 1000))));
PolyORB_HI.Output_Low_Level.Put ("] ");
PolyORB_HI.Output_Low_Level.Put (Text);
end Unprotected_Put;
......
------------------------------------------------------------------------------
-- --
-- PolyORB HI COMPONENTS --
-- --
-- P O L Y O R B _ H I . O U T P U T _ L O W _ L E V E L --
-- --
-- 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) --
-- --
------------------------------------------------------------------------------
package body PolyORB_HI.Output_Low_Level is
---------
-- Put --
---------
procedure Put (S : String) is
begin
null;
end Put;
--------------
-- New_Line --
--------------
procedure New_Line is
begin
null;
end New_Line;
end PolyORB_HI.Output_Low_Level;
......@@ -32,7 +32,7 @@
project PolyORB_HI is
type Target_Type is
("NATIVE", "LEON_ORK", "LEON_GNAT", "ERC32", "MARTEOS", "ARM_CORTEX");
("NATIVE", "LEON_ORK", "LEON_GNAT", "ERC32", "MARTEOS", "GNAT_Runtime");
Target : Target_Type := external ("TARGET", "NATIVE");
type Build_Type is ("Debug", "Release", "Analyzable");
......@@ -123,8 +123,15 @@ project PolyORB_HI is
case Target is
when "NATIVE" | "MARTEOS" =>
for Local_Configuration_Pragmas use "native.adc";
when "LEON_ORK" | "LEON_GNAT" | "ERC32" | "ARM_CORTEX" =>
when "LEON_ORK" | "LEON_GNAT" | "ERC32" =>
for Local_Configuration_Pragmas use "hi-e.adc";
when "GNAT_Runtime" =>
-- For GNAT runtimes, it is assumed an external configuration file
-- is provided
null;
end case;
end Compiler;
......@@ -133,8 +140,6 @@ project PolyORB_HI is
-------------
package Builder is
for Global_Configuration_Pragmas use "gnat.adc";
case Build is
when "Debug" =>
for Default_Switches ("Ada") use ("-s", "-m", "-g");
......@@ -171,7 +176,17 @@ project PolyORB_HI is
package Linker is
case Build is
when "Debug" =>
for Default_Switches ("ada") use ("-g");
case Target is
when "GNAT_Runtime" =>
-- For GNAT runtimes, we clean up unused symbols.
-- Unfortunately, this does not work for macOS
-- because of clang linker.
for Default_Switches ("ada") use ("-g", "-Wl,--gc-sections");
when others =>
for Default_Switches ("ada") use ("-g");
end case;
when "Release" =>
null;
end case;
......
......@@ -16,7 +16,7 @@ AC_ARG_ENABLE(ocarina-version-check,
else
ocarina_version_check=false
fi],
[ocarina_version_check=true])
[ocarina_version_check=false])
AC_ARG_WITH(ocarina-prefix,
AC_HELP_STRING([--with-ocarina-prefix=PREFIX],
......@@ -42,7 +42,7 @@ AC_PATH_PROG(OCARINA_CONFIG, ocarina-config, no)
AS_IF([test x"$ocarina_config_prefix" != "x" -a "${ocarina_version_check}" = "false"],
[OCARINA_PREFIX="$ocarina_config_prefix"
OCARINA_ADAFLAGS="false"
OCARINA_LIBS="flase"
OCARINA_LIBS="false"
OCARINA_RUNTIME="$ocarina_config_prefix/include/ocarina/runtime"
OCARINA_RESOURCES="$ocarina_config_prefix/share/ocarina"],
[test "$OCARINA_CONFIG" != "no"],
......@@ -51,16 +51,7 @@ AS_IF([test x"$ocarina_config_prefix" != "x" -a "${ocarina_version_check}" = "fa
OCARINA_ADAFLAGS=`$OCARINA_CONFIG --cflags`
OCARINA_LIBS=`$OCARINA_CONFIG --libs`
OCARINA_RUNTIME=`$OCARINA_CONFIG --runtime`
OCARINA_RESOURCES=`$OCARINA_CONFIG --resources`
ocarina_major_version=`$OCARINA_CONFIG --version | \
sed 's/Ocarina \([[0-9]]*\).\([[0-9]]*\).*/\1/'`
ocarina_minor_version=`$OCARINA_CONFIG --version | \
sed 's/Ocarina \([[0-9]]*\).\([[0-9]]*\).*/\2/'`
AS_IF([test $ocarina_major_version -gt $min_ocarina_major_version -o \( $ocarina_major_version -eq $min_ocarina_major_version -a $ocarina_minor_version -ge $min_ocarina_minor_version \)],
[AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])],
[AC_MSG_RESULT(no)
ifelse([$3], , :, [$3])])],
OCARINA_RESOURCES=`$OCARINA_CONFIG --resources`],
[$3])
AC_SUBST(OCARINA_PREFIX)
AC_SUBST(OCARINA_ADAFLAGS)
......
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