#include "common.h"
/* memory segments */
-memmap *xstack = NULL; /* xternal stack data */
-memmap *istack = NULL; /* internal stack */
-memmap *code = NULL; /* code segment */
-memmap *data = NULL; /* internal data upto 128 */
-memmap *xdata = NULL; /* external data */
-memmap *idata = NULL; /* internal data upto 256 */
-memmap *bit = NULL; /* bit addressable space */
-memmap *statsg = NULL; /* the constant data segment */
+memmap *xstack = NULL; /* xternal stack data */
+memmap *istack = NULL; /* internal stack */
+memmap *code = NULL; /* code segment */
+memmap *data = NULL; /* internal data upto 128 */
+memmap *xdata = NULL; /* external data */
+memmap *xidata = NULL; /* the initialized xdata */
+memmap *xinit = NULL; /* the initializers for xidata */
+memmap *idata = NULL; /* internal data upto 256 */
+memmap *bit = NULL; /* bit addressable space */
+memmap *statsg = NULL; /* the constant data segment */
memmap *sfr = NULL; /* register space */
memmap *reg = NULL; /* register space */
memmap *sfrbit = NULL; /* sfr bit space */
POINTER-TYPE - FPOINTER
*/
xdata = allocMap (0, 1, 0, 0, 0, 0, options.xdata_loc, XDATA_NAME, 'F', FPOINTER);
+ xidata = allocMap (0, 1, 0, 0, 0, 0, 0, XIDATA_NAME, 'F', FPOINTER);
+ xinit = allocMap (0, 1, 0, 0, 0, 1, 0, XINIT_NAME, 'C', CPOINTER);
/* Inderectly addressed internal data segment
SFRSPACE - NO
}
/*-----------------------------------------------------------------*/
-/* allocGlobal - aassigns the output segment to a global var */
+/* allocGlobal - assigns the output segment to a global var */
/*-----------------------------------------------------------------*/
void
allocGlobal (symbol * sym)
if (SPEC_SCLS (sym->etype) == S_XDATA)
{
SPEC_OCLS (sym->etype) = xdata;
+ // should we move this to the initialized data segment?
+ if (port->genXINIT &&
+ sym->ival && (sym->level==0) && !SPEC_ABSA(sym->etype)) {
+ SPEC_OCLS(sym->etype)=xidata;
+ addSet(&xidata->syms, sym);
+ }
allocIntoSeg (sym);
return;
}
iCode *ic;
for (ic = ebbs[i]->sch; ic; ic = ic->next)
- if (ic && (ic->op == CALL || ic->op == PCALL))
- return FALSE;
+ if (ic) {
+ if (ic->op == CALL) {
+ sym_link *ftype = operandType(IC_LEFT(ic));
+ /* builtins only can use overlays */
+ if (!IFFUNC_ISBUILTIN(ftype)) return FALSE;
+ } else if (ic->op == PCALL) return FALSE;
+ }
}
/* no function calls found return TRUE */