projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Applied patch #2762516
[fw/sdcc]
/
src
/
avr
/
main.c
diff --git
a/src/avr/main.c
b/src/avr/main.c
index 73eb0ba6b652aca3a3d71016bb6b62affcff3b48..efde4d2beaef53048b1dd4eb7b1471ae7c74d8be 100644
(file)
--- a/
src/avr/main.c
+++ b/
src/avr/main.c
@@
-42,13
+42,13
@@
_avr_init (void)
}
static void
}
static void
-_avr_reset_regparm ()
+_avr_reset_regparm (
void
)
{
regParmFlg = 0;
}
static int
{
regParmFlg = 0;
}
static int
-_avr_regparm (sym_link * l)
+_avr_regparm (sym_link * l
, bool reentrant
)
{
/* the first eight bytes will be passed in
registers r16-r23. but we won't split variables
{
/* the first eight bytes will be passed in
registers r16-r23. but we won't split variables
@@
-69,7
+69,7
@@
_avr_regparm (sym_link * l)
return 0;
}
return 0;
}
-void avr_assignRegisters (e
BBlock ** ebbs, int count
);
+void avr_assignRegisters (e
bbIndex *
);
static bool
_avr_parseOptions (int *pargc, char **argv, int *i)
static bool
_avr_parseOptions (int *pargc, char **argv, int *i)
@@
-126,9
+126,32
@@
_avr_genAssemblerPreamble (FILE * of)
/* Generate interrupt vector table. */
static int
/* Generate interrupt vector table. */
static int
-_avr_genIVT (
FILE * o
f, symbol ** interrupts, int maxInterrupts)
+_avr_genIVT (
struct dbuf_s * oBu
f, symbol ** interrupts, int maxInterrupts)
{
{
- return TRUE;
+ return TRUE;
+}
+
+/* Indicate which extended bit operations this port supports */
+static bool
+hasExtBitOp (int op, int size)
+{
+ if (op == RRC
+ || op == RLC
+ || op == GETHBIT
+ )
+ return TRUE;
+ else
+ return FALSE;
+}
+
+/* Indicate the expense of an access to an output storage class */
+static int
+oclsExpense (struct memmap *oclass)
+{
+ if (IN_FARSPACE(oclass))
+ return 1;
+
+ return 0;
}
/** $1 is always the basename.
}
/** $1 is always the basename.
@@
-153,9
+176,11
@@
PORT avr_port = {
"ATMEL AVR", /* Target name */
NULL, /* processor */
{
"ATMEL AVR", /* Target name */
NULL, /* processor */
{
+ glue,
TRUE, /* Emit glue around main */
MODEL_LARGE | MODEL_SMALL,
TRUE, /* Emit glue around main */
MODEL_LARGE | MODEL_SMALL,
- MODEL_SMALL},
+ MODEL_SMALL
+ },
{
_asmCmd,
NULL,
{
_asmCmd,
NULL,
@@
-169,18
+194,24
@@
PORT avr_port = {
_linkCmd,
NULL,
NULL,
_linkCmd,
NULL,
NULL,
- ".rel"},
+ ".rel",
+ 1},
{
_defaultRules},
{
/* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
1, 2, 2, 4, 2, 2, 3, 1, 4, 4},
{
_defaultRules},
{
/* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
1, 2, 2, 4, 2, 2, 3, 1, 4, 4},
+
+ /* tags for generic pointers */
+ { 0x00, 0x40, 0x60, 0x80 }, /* far, near, xstack, code */
+
{
"XSEG",
"STACK",
"CSEG",
"DSEG",
"ISEG",
{
"XSEG",
"STACK",
"CSEG",
"DSEG",
"ISEG",
+ NULL, //PSEG
"XSEG",
"BSEG",
"RSEG",
"XSEG",
"BSEG",
"RSEG",
@@
-190,6
+221,10
@@
PORT avr_port = {
"HOME",
NULL, // initialized xdata
NULL, // a code copy of xiseg
"HOME",
NULL, // initialized xdata
NULL, // a code copy of xiseg
+ "CONST (CODE)", // const_name - const data (code or not)
+ "CABS (ABS,CODE)", // cabs_name - const absolute data (code or not)
+ "XABS (ABS,XDATA)", // xabs_name - absolute xdata/pdata
+ "IABS (ABS,DATA)", // iabs_name - absolute idata/data
NULL,
NULL,
0,
NULL,
NULL,
0,
@@
-201,10
+236,24
@@
PORT avr_port = {
{
1, -1
},
{
1, -1
},
+ {
+ avr_emitDebuggerSymbol
+ },
+ {
+ 255/3, /* maxCount */
+ 3, /* sizeofElement */
+ /* The rest of these costs are bogus. They approximate */
+ /* the behavior of src/SDCCicode.c 1.207 and earlier. */
+ {4,4,4}, /* sizeofMatchJump[] */
+ {0,0,0}, /* sizeofRangeCompare[] */
+ 0, /* sizeofSubtract */
+ 3, /* sizeofDispatch */
+ },
"_",
_avr_init,
_avr_parseOptions,
NULL,
"_",
_avr_init,
_avr_parseOptions,
NULL,
+ NULL,
_avr_finaliseOptions,
_avr_setDefaultOptions,
avr_assignRegisters,
_avr_finaliseOptions,
_avr_setDefaultOptions,
avr_assignRegisters,
@@
-214,12
+263,16
@@
PORT avr_port = {
NULL, /* no genAssemblerEnd */
_avr_genIVT,
NULL, // _avr_genXINIT
NULL, /* no genAssemblerEnd */
_avr_genIVT,
NULL, // _avr_genXINIT
+ NULL, /* genInitStartup */
_avr_reset_regparm,
_avr_regparm,
NULL,
NULL,
NULL,
_avr_reset_regparm,
_avr_regparm,
NULL,
NULL,
NULL,
+ hasExtBitOp, /* hasExtBitOp */
+ oclsExpense, /* oclsExpense */
FALSE,
FALSE,
+ TRUE, /* little endian */
0, /* leave lt */
1, /* transform gt ==> not le */
0, /* leave le */
0, /* leave lt */
1, /* transform gt ==> not le */
0, /* leave le */