8.7 Using EDS
EDS (Extended Data Space) is an architectural concept that allows the mapping of extra RAM into the 16-bit data addressable area. This feature uses a paging scheme, mapping in 32K pages into the address range from 0x8000 to 0xFFFF (bit 15 is set). EDS is similar to PSV (Program Space Visibility) which all 16-bit devices support.
__eds__
is a compiler concept that allows this space to
be used by either additional RAM or by FLASH. This is an extension of the architectural PSV
(Program Space Visisbility) window and compiler's __psv__/__prog__
interpretation. PSV only facilitates the mapping of FLASH pages; EDS allows mapping RAM or
Flash pages. __eds__
can be used on all 16-bit devices, even older devices
that do not have any EDS memory. In this case, __eds__
can be used to
access Flash.
__eds__
, __psv__
, and
__prog__
are treated as address space qualifiers and define an access
method for the compiler. These words are also used inside an address attribute to define
permissible allocation.
__attribute__((space(psv)))
, or
__attribute__((space(__psv__)))
, describe to the language tool where an
object may be placed. Access and allocation are separated to allow access to be defined by
the individual customer, if needed. Typically, an object allocated in a named address space
would also be tagged with an address space qualifier. Here are some examples:
__psv__ Tau object1 __attribute__((space(psv)));
__eds__ Tau object2 __attribute__((space(psv)));
object1
is allocated somewhere in PSV (Flash), and
accessed through the compiler's __psv__
mechanism; the compiler will
manage the setting of the EDS page to access the object. object2
is also
allocated in PSV but accessed through the more general __eds__
mechanism,
also completely managed by the compiler.
Pointer declarations may also have address space qualifiers, but not be allocated in a named address space. In this case, it would represent a normal data space pointer, which is pointing to an object in one of the named address spaces:
__psv__ int *pointer_to_psv_int;
int * __psv__ psv_pointer_to_int
__attribute__((space(psv)));
The way to decode these is to read outwards from the object name. The
first defines an object, in data space, that points to an object in psv
space. The 2nd defines an object that lives in psv
space which points to
an object in data space; this object needs a space
attribute to get
located into an appropriate named address space.
See also Extended Data Space Access