comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Ada to Ada Translator ?
Date: Thu, 23 May 2019 08:56:29 +0100
Date: 2019-05-23T08:56:29+01:00	[thread overview]
Message-ID: <lyv9y1y576.fsf@pushface.org> (raw)
In-Reply-To: bb12e299-8620-4c81-9c48-873302e5dfc0@googlegroups.com

foo wong <crap@spellingbeewinnars.org> writes:

> So I guess where I was going with the pragmas, is that I would like to
> be able to write Ada code that had tasking/exceptions etc but by the
> time it reached gnat, these pragmas could be used to avoid linking to
> any runtime from Adacore.

You might be interested in a note I wrote about creating an RTS that can
be used by the existing GNAT compiler; see [1], scroll down to 'RTS:
second stage'.

In my case, I was OK with a GPL/RLE runtime, so quite happy to modify
existing FSF GCC files where they were useful; but I don't think there'd
be any problem with reimplementing them. You might need to consider a
'clean room' approach (or not; IANAL).

The sort of assumptions made by the compiler are that - for example, to
create a Ravenscar task - there will exist a package
System.Tasking.Restricted.Stages, containing (at GCC 8/9, GNAT CE 2018)

   procedure Create_Restricted_Task
     (Priority             :        Integer;
      Stack_Address        :        System.Address;
      Size                 :        System.Parameters.Size_Type;
      Sec_Stack_Address    :        System.Secondary_Stack.SS_Stack_Ptr;
      Secondary_Stack_Size :        System.Parameters.Size_Type;
      Task_Info            :        System.Task_Info.Task_Info_Type;
      CPU                  :        Integer;
      State                :        Task_Procedure_Access;
      Discriminants        :        System.Address;
      Elaborated           :        Access_Boolean;
      Chain                : in out Activation_Chain;
      Task_Image           :        String;
      Created_Task         :        Task_Id);

I don't support exceptions, they're fearsomely complicated, and I don't
believe that embedded software should rely on exceptions to provide
continued execution past errors, and SPARK wouldn't allow them
anyway. See notes at [2] - especially Robert Dewar's remarks linked to
at the end.

[1]
https://forward-in-code.blogspot.com/2015/06/building-runtime-system-for-arm-eabi.html
[2] https://github.com/simonjwright/cortex-gnat-rts/wiki/ExceptionHandling

  reply	other threads:[~2019-05-23  7:56 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 14:21 Ada to Ada Translator ? foo wong
2019-05-17 21:00 ` Simon Wright
2019-05-18 12:05   ` foo wong
2019-05-18 12:11     ` foo wong
2019-05-18 14:47     ` Simon Wright
2019-05-18 15:26       ` foo wong
2019-05-18 16:48         ` Simon Wright
2019-05-19 16:04         ` G.B.
2019-05-19 17:08           ` Simon Wright
2019-05-19 18:27             ` Optikos
2019-05-19 21:27               ` Simon Wright
2019-05-19 21:42               ` Simon Wright
2019-05-21 20:54                 ` Optikos
2019-05-22  6:59                   ` Simon Wright
2019-05-22 12:06                     ` Optikos
2019-05-22 12:33                       ` Simon Wright
2019-05-22 12:57                         ` foo wong
2019-05-22 15:24                           ` Shark8
2019-05-22 16:34                             ` Optikos
2019-05-22 20:07                               ` Randy Brukardt
2019-05-23  7:21                           ` G. B.
2019-05-22 13:33                         ` Optikos
2019-05-20 14:11         ` Optikos
2019-05-20 16:37           ` foo wong
2019-05-18 15:44       ` foo wong
2019-05-18 16:49         ` Simon Wright
2019-05-19 15:04         ` G.B.
2019-05-19 12:41 ` Optikos
2019-05-19 17:38   ` foo wong
2019-05-19 22:52   ` foo wong
2019-05-20 23:19   ` Randy Brukardt
2019-05-21  0:13     ` Optikos
2019-05-21 22:15       ` Randy Brukardt
2019-05-22  0:16         ` Optikos
2019-05-22 20:16           ` Randy Brukardt
2019-05-22 23:27             ` foo wong
2019-05-23  7:56               ` Simon Wright [this message]
2019-05-23 12:29                 ` foo wong
2019-05-21 22:20       ` Randy Brukardt
2019-05-21  0:17     ` Optikos
2019-05-22 18:49 ` Optikos
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox