comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Interrupts & Ravenscar
Date: Fri, 20 Oct 2017 20:16:53 -0500
Date: 2017-10-20T20:16:53-05:00	[thread overview]
Message-ID: <ose766$q87$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: lyy3ogbdn2.fsf@pushface.org

"Simon Wright" <simon@pushface.org> wrote in message 
news:lyy3ogbdn2.fsf@pushface.org...
> I'm specifically concerned with the Ravenscar profile. My
> cortex-gnat-rts raises PE when the second PO is initialized; AdaCore's
> ravenscar-full-stm32f4 doesn't - last in wins.
>
> I found this because an AdaCore library had already declared a handler
> for a particular interrupt, and I needed to implement my own
> behaviour. In this case, I could ensure that my handler was used by the
> proper elaboration pragmas. In other circumstances, e.g. attaching the
> wrong interrupt, there might be long and tedious debugging sessions.
>
> The ARM doesn't address this issue (aside from it being illegal in
> Ravenscar to use any subprogram from Ada.Interrupts, which means that
> the only control you have is via the elaboration order).

C.3.1(14.1/3) says it is erroneous if aspect Attach_Handler is not used in a 
stack-like fashion. That implies that it ought to work if Attach_Handler is 
used twice. C.3.1(10) says that Program_Error is raised if the interrupt 
being attached is reserved (so that's probably what happened in your first 
case). Otherwise, the last one wins (which is what happened in your second 
case).

The intent appears to be that one would use subprograms to find out the 
previous handler and then call that (so it isn't lost), but of course you 
can't do that in Ravenscar.

In any case, I think the GNAT implementation is correct, in both cases 
(although it probably would be frendlier to reserve that interrupt if GNAT 
needs it in the Ravenscar version).

                                     Randy.



      reply	other threads:[~2017-10-21  1:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 15:16 Interrupts & Ravenscar Simon Wright
2017-10-21  1:16 ` Randy Brukardt [this message]
replies disabled

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