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 Path: g2news2.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!news2.glorb.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.lang.ada Subject: Re: How do I disable elaboration code on this Date: Tue, 12 Apr 2011 11:50:11 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <58bc4fb4-5f6a-48d6-9c98-0dde7ac619df@p16g2000vbo.googlegroups.com> <4da2176e$0$6977$9b4e6d93@newsspool4.arcor-online.net> <93b20b91-03ed-48d2-87b6-a109127a5a4f@l18g2000yql.googlegroups.com> <6bca8b26-152f-482c-95c0-1abf88b6b29b@a26g2000vbo.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 12 Apr 2011 11:50:11 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="4pjzwDT2MPp9AkNxUo/C4Q"; logging-data="13256"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19mGkpS7pbzTuw3F+/qAMkaHwX0vX35i7k=" User-Agent: slrn/0.9.8.1 (VMS/Multinet) Cancel-Lock: sha1:eSZ7GWAwFgZxp6zKOhahlTMFGdU= Xref: g2news2.google.com comp.lang.ada:19740 Date: 2011-04-12T11:50:11+00:00 List-Id: On 2011-04-11, Lucretia wrote: > On Apr 11, 12:59�pm, Simon Clubley Earth.UFP> wrote: > >> The issue here is that when the Cortex M3 comes out of reset it reads, >> and loads, the stack pointer from the first longword in that array >> and then jumps to the address specified by the second longword. >> >> To Luke: are you targetting only the Cortex M3 or traditional ARM7 >> devices as well ? > > Not yet. It's just that the M3 doesn't actually need ASM for C/C++ > projects, I wanted to see if I could do the same from Ada. > > At the moment, I have a Cortex-M3 board so that shall be my target, I > intend to write an equivalent of CMSIS for use as the BSP for these > chips. > > As for ARM7 or other ARM's, there's no real reason why you couldn't > provide something similar. No need for a wrapper, as depending on the > platform, you'd provide a different BSP and a different startup and > for bigger ARM's, that'd be ASM. This ASM could be conditionally > assembled if need be for different ARM's. > Misleading choice of words on my part. By wrapper, I meant calling the the Ada program from a assembly based startup routine; ie: wrapping the Ada code within a outer layer of startup assembly code. I've had another idea about how you may be able to implement this and that is by defining the vector table in the linker script itself. This is just a theory; I have no experience of the Cortex M3 and I don't do in linker scripts what I am to suggest (I take the traditional approach of defining a vector section in my ARM7 assembly startup code) so I don't know if something I have not considered will stop you from doing this. If you read the Output Section Data part of the GNU ld manual at: http://sourceware.org/binutils/docs/ld/Output-Section-Data.html#Output-Section-Data you will see that you can actually insert linker script defined values (as opposed to just symbols) into the output image itself. If you use a series of "LONG(addr)" statements in the vectors section of your linker script, where addr is the name of the Ada vector routine in question for that vector, (or the symbol containing the SP starting value for the first LONG(addr)), you may be able to construct the vector table in the linker script itself. BTW, if this appears to work, I suggest you use your cross-compiled objdump to verify that the generated table appears to be as you would expect it to be. Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world