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!news.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: Runtime startup code for the GNAT Runtime...and a bit of humble pie. Date: Wed, 27 Mar 2013 22:58:19 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <21ad4ef7-0e4a-40ba-ac3f-fe21018c7bd9@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 27 Mar 2013 22:58:19 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="da745e888d4a5182b5fda6212bbb0a63"; logging-data="27687"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+9RuzFRyOnp00wch0G8i5onQlXZMzpg04=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:fNgQ9tiwETiQ5jtXLre1c8jF2Jg= Xref: news.eternal-september.org comp.lang.ada:14759 Date: 2013-03-27T22:58:19+00:00 List-Id: On Wed, 27 Mar 2013 14:38:23 +0000, Simon Clubley wrote: > On 2013-03-27, Brian Drummond wrote: >> > Oh, sorry, I didn't mean to imply that I was seeing poor code in C as a > result of marking the type itself as volatile, as I am not. >> The only case of incorrect code generation seen so far has been where a >> local procedure has been installed as an interrupt handler, and a local >> variable (volatile) shared between it and the main. >> Now it is unclear to me whether a local variable is even permitted to >> be shared with an interrupt handler - or even if the handler is ever >> permitted to be a local procedure. ( > Even if it appeared to work, I would be _very_ uncomfortable with the > idea of a local procedure as a interrupt handler. Interrupt handlers are > supposed to be a global, not localised, concept able to be executed at > any time. Agree absolutely. I have also verified that the AVR-Ada compiler prohibits local procedures as handlers, and intend to update the MSP tools accordingly. >> However my reading of the Ravenscar profile only supports attaching >> handlers via pragmas, in library level units - calling Ada.Interrupts.* >> is a Program Error... > I would need to read the Ravenscar profile in detail, but I thought the > idea of a pragma based approach was that the vector table was defined > during linking instead of at runtime. Exactly. > If so, I wonder how that would be compatible with the Atmel SAM7S setup > I describe above. You may need to create a dummy interrupt table during > linking and have the startup code populate the SAM7S interrupt registers > from it. I see no objection to copying a constant array to the actual interrupt registers during startup, should that be necessary. - Brian