comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Interrupts & Ravenscar
Date: Thu, 12 Oct 2017 16:16:01 +0100
Date: 2017-10-12T16:16:01+01:00	[thread overview]
Message-ID: <lyy3ogbdn2.fsf@pushface.org> (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?


             reply	other threads:[~2017-10-12 15:16 UTC|newest]

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

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