12.3.2.2 Object Compatibility Model
Since functions in secure segments set PSVPAG to their respective
psv
constant sections, a convention must be established for
managing multiple values of the PSVPAG register. In previous versions of the compiler, a
single value of PSVPAG was set during program startup if the default
constants-in-code
memory model was selected. The compiler relied
upon that preset value for accessing const
variables and string
literals, as well as any variables specifically nominated with
space(auto_psv)
.
MPLAB XC16 provides support for multiple values of
PSVPAG
. Variables declared with space(auto_psv)
may be combined with secure segment constant variables and/or managed
psv
variables in the same source file. Precompiled objects that
assume a single, pre-set value of PSVPAG
are link-compatible with
objects that define secure segment psv
constants or managed
psv
variables.
Even though PSVPAG
is considered to be a
compiler-managed resource, there is no change to the function calling conventions.