From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Interrupts & Ravenscar Date: Thu, 12 Oct 2017 16:16:01 +0100 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="beb157ce27c63db07f25ae034f4baf42"; logging-data="31406"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181EzdGNtngWyxvAMTbO6ZTVjHlxjIirzE=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:IdICGu/tepG8DLVwoq9irQIjpRk= sha1:tcBlUtAzJRvB0b1tqNCehiGdUFg= Xref: news.eternal-september.org comp.lang.ada:48440 Date: 2017-10-12T16:16:01+01:00 List-Id: 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?