comp.lang.ada
 help / color / mirror / Atom feed
* Interrupts & Ravenscar
@ 2017-10-12 15:16 Simon Wright
  2017-10-21  1:16 ` Randy Brukardt
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Wright @ 2017-10-12 15:16 UTC (permalink / raw)


Interrupt handlers are specified as protected procedures, e.g.

   protected PO is
      ...
   private
      ...
      procedure Handler
      with Attach_Handler => Ada.Interrupts.Names.Foo_Interrupt;
   end PO;

declared at library level.

What should happen if I also write in the same partition

   protected Other_PO is
      ...
   private
      ...
      procedure Handler
      with Attach_Handler => Ada.Interrupts.Names.Foo_Interrupt;
   end Other_PO;

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).

I would like to see PE being raised; would this be a suitable candidate
for an implementation restriction?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-21  1:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12 15:16 Interrupts & Ravenscar Simon Wright
2017-10-21  1:16 ` Randy Brukardt

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