comp.lang.ada
 help / color / mirror / Atom feed
* Importing ld memory defintions into ada code
@ 2003-08-08 10:00 Rich
  2003-08-08 14:17 ` 
  2003-08-09 16:02 ` John R. Strohm
  0 siblings, 2 replies; 3+ messages in thread
From: Rich @ 2003-08-08 10:00 UTC (permalink / raw)


Is it possible to use the linker directive definitions for memory
sections in ada?
I want to create a constant in ada that is initialised to the ld
memory definition.
i.e.

ld file;

MEMORY {
    Buffer       : ORIGIN = 0x00000000, LENGTH = 256
    dram_memory  : ORIGIN = ., 	LENGTH = 1M - 256
}

Ada file;

MY_BUFFER : constant ADDRESS_TYPE := Import ld definition of buffer.

I would prefer to do this the other way around but i seriously doubt
that is possible.

If none of this is possible then i will just have to make duplicate
definitions of the same value.

Regards,
Rich



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Importing ld memory defintions into ada code
  2003-08-08 10:00 Importing ld memory defintions into ada code Rich
@ 2003-08-08 14:17 ` 
  2003-08-09 16:02 ` John R. Strohm
  1 sibling, 0 replies; 3+ messages in thread
From:  @ 2003-08-08 14:17 UTC (permalink / raw)


Rich wrote:
> Is it possible to use the linker directive definitions for memory
> sections in ada?
> I want to create a constant in ada that is initialised to the ld
> memory definition.
> i.e.
> 
> ld file;
> 
> MEMORY {
>     Buffer       : ORIGIN = 0x00000000, LENGTH = 256
>     dram_memory  : ORIGIN = ., 	LENGTH = 1M - 256
> }
> 
> Ada file;
> 
> MY_BUFFER : constant ADDRESS_TYPE := Import ld definition of buffer.
> 
> I would prefer to do this the other way around but i seriously doubt
> that is possible.
> 
> If none of this is possible then i will just have to make duplicate
> definitions of the same value.
> 
> Regards,
> Rich

Try with a representation attribute (see RM 13.3) to do it the other way 
round:

for My_Buffer'Address use System.Storage_Elements.To_Address (address);

Rodrigo




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Importing ld memory defintions into ada code
  2003-08-08 10:00 Importing ld memory defintions into ada code Rich
  2003-08-08 14:17 ` 
@ 2003-08-09 16:02 ` John R. Strohm
  1 sibling, 0 replies; 3+ messages in thread
From: John R. Strohm @ 2003-08-09 16:02 UTC (permalink / raw)


"Rich" <rich_ard_james@yahoo.co.uk> wrote in message
news:8cd0c91f.0308080200.3755802a@posting.google.com...
> Is it possible to use the linker directive definitions for memory
> sections in ada?
> I want to create a constant in ada that is initialised to the ld
> memory definition.
> i.e.
>
> ld file;
>
> MEMORY {
>     Buffer       : ORIGIN = 0x00000000, LENGTH = 256
>     dram_memory  : ORIGIN = ., LENGTH = 1M - 256
> }
>
> Ada file;
>
> MY_BUFFER : constant ADDRESS_TYPE := Import ld definition of buffer.

As I read this, you are saying that you want to control the buffer location
FROM THE LINKER CONTROL FILE.  (Caps for emphasis.)  Presumably, this is
because you have to tie multiple processors together, using shared memory,
and some of the processors are programmed in something other than Ada.  (If
they were all in Ada, you'd use Ada rep specs in a shared package.)

Can you do an assembly language routine, that just returns the value of an
external symbol, which will be bound by the linker, and use "pragma
interface(assembly)" to tie it together?





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-08-09 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-08 10:00 Importing ld memory defintions into ada code Rich
2003-08-08 14:17 ` 
2003-08-09 16:02 ` John R. Strohm

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