comp.lang.ada
 help / color / mirror / Atom feed
* Named Address Spaces
@ 2005-09-20 15:46 Rolf
  2005-09-20 16:46 ` Samuel Tardieu
  0 siblings, 1 reply; 2+ messages in thread
From: Rolf @ 2005-09-20 15:46 UTC (permalink / raw)


Some embedded processors have separate address spaces, like IO, EEPROM,
FLASH, ROM, RAM, external memory.  Accessing variables in the different
address spaces requires special assembler instructions for these
processors.  The AVR processors for example have special instructions
for reading and writing IO ports and for reading flash memory they
transfer byte by byte to a special register.  Obviously the compiler
has to know about these special instructions.

I am more concerned about the programmer visible implications of
separate address spaces.  It is still the programmer's responsibility
to decide where to place a variable, e.g. EEPROM or flash.  To my
knowledge, the language has no construct to specifiy a segment where to
place a variable.  GNAT has a pragma Linker_Section that helps placing
a variable into a special section, but that is not standard to my
knowledge (and then GNAT does not know that special sections must be
accessed differently, but that is a different issue.)

  Flash_String : constant String := "I live in read only memory";
  pragma Linker_Section (".progmem");

How do other compilers approach that problem?

As Ada has many constructs that help for embedded systems, is there a
standard way for placing variables and constants into specific separate
address spaces?

    Rolf




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

* Re: Named Address Spaces
  2005-09-20 15:46 Named Address Spaces Rolf
@ 2005-09-20 16:46 ` Samuel Tardieu
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Tardieu @ 2005-09-20 16:46 UTC (permalink / raw)


>>>>> "Rolf" == Rolf  <rolf.ebert_nospam_@gmx.net> writes:

Rolf> As Ada has many constructs that help for embedded systems, is
Rolf> there a standard way for placing variables and constants into
Rolf> specific separate address spaces?

None that I know of, and as you said, this may also mean different
ways of accessing them. I had to solve this problem several times, and
I have always used pragma Linker_Section and specific Read (and Write
where applicable) access subprograms.

  Sam
-- 
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/sam



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

end of thread, other threads:[~2005-09-20 16:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-20 15:46 Named Address Spaces Rolf
2005-09-20 16:46 ` Samuel Tardieu

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