Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

MPLAB
®
XC16 C Compiler Users Guide
DS50002071C-page 128 2012-2013 Microchip Technology Inc.
8.11.3 __eds__ Type Qualifier
The __eds__ qualifier indicates that the qualified object has been located in an EDS
accessible memory space and that the compiler should manage the appropriate regis-
ters used to access this memory.
When used with pointers, it implies that the compiler should make few assumptions as
to the memory space in which the pointer target is located and that the target may be
in one of several memory spaces, which include: space(data) (and its subsets), eds,
space(eedata), space(prog), space(psv), space(auto_psv), and on some
devices space(pmp). Not all devices support all memory spaces. For example
__eds__ unsigned int __attribute__((eds)) myEDSvar;
__eds__ char * myEDSpointer;
The compiler will automatically assert the page attribute to scalar variable declarations;
this allows the compiler to generate more efficient code when accessing larger data
types. Remember, scalar variables do not include structures or arrays. To force paging
of a structure or array, please manually use the page attribute and the compiler will
prevent the object from crossing a page boundary.
For read access to __eds__ qualified variables will automatically manipulate the
PSVPAG or DSRPAG register (as appropriate). For devices that support extended data
space memory, the compiler will also manipulate the DSWPAG register.
For more on this qualifier, see Section 10.7 Extended Data Space Access.
8.11.4 __pack_upper_byte Type Qualifier
This qualifier allows the use of the upper byte of Flash memory for data storage. For
16-bit devices, a 24-bit word is used in Flash memory. The architecture supports the
mapping of areas of Flash into the data space, but this mapping is only 16 bits wide to
fit in with data space dimensions, unless the __pack_upper_byte qualifier is used.
For more information on this qualifier, see Section 10.8 Packing Data Stored in
Flash.
8.11.5 __pmp__ Type Qualifier
This qualifier may be used with those devices that contain a Parallel Master Port (PMP)
peripheral, which allows the connection of various memory and non-memory devices
directly to the device. When variables or pointer targets qualified with __pmp__ are
accessed, the compiler will generate the appropriate sequence for accessing these
objects via the PMP peripheral on the device. For example:
__
pmp__ int auxDevice
__attribute__((space(pmp(external_PMP_memory))));
__pmp__ char * myPMPpointer;
In addition to the qualifier, the int variable uses a memory space which would need to
be predefined. The pointer in this example does not use the space attribute as the it is
located in data memory, but the qualifier indicates how the pointer targets are to be
accessed. For more information on the space attribute, see Section 8.12 Variable
Attributes. For basic information on the memory layout and how program memory is
accessed by the device, see Section 10.2 Address Spaces.
For more on the qualifier, see Section 10.5 Parallel Master Port Access.
Note: Some devices use DSRPAG to represent extended read access to FLASH
or the extended data space (EDS)

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh