X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Favr%2Fmain.c;h=aa9a9d3e9440dc47f12905de3b50772a9d480e11;hb=4db4740164fed3cb25145cfdaadb986fc0690507;hp=5d5a323716eadfc806049c7a1cfb554e0dcfbc6b;hpb=321cd682df5659143610e50005c4eb1a6a5decf7;p=fw%2Fsdcc diff --git a/src/avr/main.c b/src/avr/main.c index 5d5a3237..aa9a9d3e 100644 --- a/src/avr/main.c +++ b/src/avr/main.c @@ -42,7 +42,7 @@ _avr_init (void) } static void -_avr_reset_regparm () +_avr_reset_regparm (void) { regParmFlg = 0; } @@ -69,7 +69,7 @@ _avr_regparm (sym_link * l) return 0; } -void avr_assignRegisters (eBBlock ** ebbs, int count); +void avr_assignRegisters (ebbIndex *); static bool _avr_parseOptions (int *pargc, char **argv, int *i) @@ -131,6 +131,29 @@ _avr_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts) 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. $2 is always the output file. $3 varies @@ -156,7 +179,8 @@ PORT avr_port = { glue, TRUE, /* Emit glue around main */ MODEL_LARGE | MODEL_SMALL, - MODEL_SMALL}, + MODEL_SMALL + }, { _asmCmd, NULL, @@ -170,7 +194,8 @@ PORT avr_port = { _linkCmd, NULL, NULL, - ".rel"}, + ".rel", + 1}, { _defaultRules}, { @@ -182,6 +207,7 @@ PORT avr_port = { "CSEG", "DSEG", "ISEG", + NULL, //PSEG "XSEG", "BSEG", "RSEG", @@ -191,6 +217,7 @@ PORT avr_port = { "HOME", NULL, // initialized xdata NULL, // a code copy of xiseg + "CONST (CODE)", // const_name - const data (code or not) NULL, NULL, 0, @@ -202,10 +229,24 @@ PORT avr_port = { { 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, + NULL, _avr_finaliseOptions, _avr_setDefaultOptions, avr_assignRegisters, @@ -215,12 +256,16 @@ PORT avr_port = { NULL, /* no genAssemblerEnd */ _avr_genIVT, NULL, // _avr_genXINIT + NULL, /* genInitStartup */ _avr_reset_regparm, _avr_regparm, NULL, NULL, NULL, + hasExtBitOp, /* hasExtBitOp */ + oclsExpense, /* oclsExpense */ FALSE, + TRUE, /* little endian */ 0, /* leave lt */ 1, /* transform gt ==> not le */ 0, /* leave le */