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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,69431b06fe9a3239 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: How do I disable elaboration code on this Date: Sat, 09 Apr 2011 19:44:40 +0200 Organization: A noiseless patient Spider Message-ID: <87ipunqpyv.fsf@ludovic-brenta.org> References: <58bc4fb4-5f6a-48d6-9c98-0dde7ac619df@p16g2000vbo.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="RdEkHrOTG4z9dP2owN6TLg"; logging-data="4647"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pje2SAhpCXKY9Asi0EM6S" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:ChDPBY7LiXVbOgPk+yz1pxlnpG8= sha1:2ZY6rIOffnBQ0oLSrWF5YGe0Xr8= Xref: g2news2.google.com comp.lang.ada:19702 Date: 2011-04-09T19:44:40+02:00 List-Id: Simon Wright writes on comp.lang.ada: > Jeffrey Carter writes: > >> On 04/09/2011 06:58 AM, Lucretia wrote: >>> The following code will not compile no matter what I do. Basically, I >>> want to write the startup code for Cortex-M3 in Ada with no assembly. >>> So, the ISR code needs to be elaboration free as it's the first bit of >>> code that would run on reset. >> >>> Vector : constant Vectors := >>> (Dummy'Access, >>> Dummy'Access, >>> Dummy'Access, >>> Dummy'Access); >>> pragma Convention (C, Vector); >>> for Vector'Address use Addr; >> >> I think what you need here is >> >> Vector : constant Vectors; >> pragma Import (Ada, Vector); >> for Vector'Address use Addr; >> >> since you don't want Vector to be initialized. >> >> Vector will not be initialized because you have pragma Import for it. >> >> Note that you don't need procedure Dummy. > > But the real code will have actual ISR procedures. OP is merely sparing > us the unnecessary detail of the real ISRs. But the vector being in Flash ROM, the Ada code needs not and indeed may not initialize it, so I think Jeffrey's reply is correct. The pragma Import and the address clause will make the actual vectors (in ROM) visible to the Ada program. -- Ludovic Brenta.