comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP>
Subject: Re: How do I disable elaboration code on this
Date: Tue, 12 Apr 2011 11:50:11 +0000 (UTC)
Date: 2011-04-12T11:50:11+00:00	[thread overview]
Message-ID: <io1e9j$cu8$1@dont-email.me> (raw)
In-Reply-To: ddc200c7-9cc8-4e9a-b991-25ed7cc082f9@k7g2000yqj.googlegroups.com

On 2011-04-11, Lucretia <Lucretia9000@yahoo.co.uk> wrote:
> On Apr 11, 12:59�pm, Simon Clubley <clubley@remove_me.eisner.decus.org-
> 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



  reply	other threads:[~2011-04-12 11:50 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-09 13:58 How do I disable elaboration code on this Lucretia
2011-04-09 16:57 ` Jeffrey Carter
2011-04-09 17:01   ` Simon Wright
2011-04-09 17:44     ` Ludovic Brenta
2011-04-09 19:19       ` Simon Wright
2011-04-09 19:32         ` Jeffrey Carter
2011-04-10  9:06           ` Lucretia
2011-04-10  9:31             ` Simon Wright
2011-04-09 19:35         ` Ludovic Brenta
2011-04-09 22:05           ` Simon Wright
2011-04-10  5:39             ` Simon Wright
2011-04-10 17:20   ` Lucretia
2011-04-10 20:12     ` Jeffrey Carter
2011-04-10 20:47     ` Georg Bauhaus
2011-04-10 21:19       ` Lucretia
2011-04-11  5:08         ` Lucretia
2011-04-11  6:28           ` Simon Wright
2011-04-11  8:54             ` Lucretia
2011-04-11 10:10               ` Simon Wright
2011-04-11 11:59                 ` Simon Clubley
2011-04-11 18:30                   ` Simon Wright
2011-04-11 19:12                     ` Simon Wright
2011-04-11 19:50                       ` Simon Wright
2011-04-11 21:40                       ` Lucretia
2011-04-11 23:12                         ` Lucretia
2011-04-11 23:16                           ` Lucretia
2011-04-11 23:31                           ` Lucretia
2011-04-12  5:22                             ` Simon Wright
2011-04-12 17:07                             ` Simon Clubley
2011-04-13 16:53                       ` Simon Wright
2011-04-15  8:38                       ` Simon Wright
2011-04-11 23:08                   ` Lucretia
2011-04-12 11:50                     ` Simon Clubley [this message]
2011-04-12 16:48                       ` Lucretia
2011-04-11 11:19               ` Georg Bauhaus
2011-04-11 13:50                 ` Simon Wright
2011-04-14 19:19               ` Florian Weimer
2011-04-10 16:34 ` Rolf
replies disabled

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