From: bernhardheld Date: Mon, 10 Feb 2003 20:58:48 +0000 (+0000) Subject: * doc/sdccman.lyx: new pragma NOIV by Johannes Stezenbach X-Git-Url: https://git.gag.com/?a=commitdiff_plain;ds=sidebyside;h=09378dae3d3c28be594d132f910029bc387cbc2a;p=fw%2Fsdcc * doc/sdccman.lyx: new pragma NOIV by Johannes Stezenbach * src/SDCC.lex: new pragma NOIV * src/SDCCglobl.h: new pragma NOIV * src/SDCCmem.c: new pragma NOIV git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2241 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 97f2066d..2dd05ace 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-02-10 Bernhard Held + + * doc/sdccman.lyx: new pragma NOIV by "Johannes Stezenbach" + * src/SDCC.lex: new pragma NOIV + * src/SDCCglobl.h: new pragma NOIV + * src/SDCCmem.c: new pragma NOIV + 2003-02-09 Bernhard Held * src/SDCCmain.c: signal handling is switched off by SDCC_LEAVE_SIGNALS diff --git a/doc/sdccman.lyx b/doc/sdccman.lyx index 4fc1f3d9..45a0ff2c 100644 --- a/doc/sdccman.lyx +++ b/doc/sdccman.lyx @@ -5570,6 +5570,13 @@ EXCLUDE\SpecialChar ~ none. \layout Itemize +NOIV - Do not generate interrupt vector table entries for all ISR functions + defined after the pragma. This is useful in cases where the interrupt + vector table must be defined manually, or when there is a secondary, manually + defined interrupt vector table (e.g. for the autovector feature of the Cypress + EZ-USB FX2). +\layout Itemize + CALLEE-SAVES function1[,function2[,function3...]] - The compiler by default uses a caller saves convention for register saving across function calls, however this can cause unneccessary register pushing & popping when calling diff --git a/src/SDCC.lex b/src/SDCC.lex index a7ba72a7..723352b4 100644 --- a/src/SDCC.lex +++ b/src/SDCC.lex @@ -76,6 +76,7 @@ struct options save_options ; P_NOGCSE , P_CALLEE_SAVES, P_EXCLUDE , + P_NOIV , P_LOOPREV , P_OVERLAY_ /* I had a strange conflict with P_OVERLAY while */ /* cross-compiling for MINGW32 with gcc 3.2 */ @@ -458,6 +459,9 @@ void doPragma (int op, char *cp) case P_EXCLUDE: parseWithComma(options.excludeRegs, Safe_strdup(cp)); break; + case P_NOIV: + options.noiv = 1; + break; case P_LOOPREV: optimize.noLoopReverse = 1; break; @@ -543,6 +547,11 @@ int process_pragma(char *s) return 0; } + if (strncmp(cp,PRAGMA_NOIV,strlen(PRAGMA_NOIV)) == 0) { + doPragma(P_NOIV,cp+strlen(PRAGMA_NOIV)); + return 0; + } + if (strncmp(cp,PRAGMA_NOLOOPREV,strlen(PRAGMA_NOLOOPREV)) == 0) { doPragma(P_LOOPREV,NULL); return 0; diff --git a/src/SDCCglobl.h b/src/SDCCglobl.h index 0a667f2b..c9ce2630 100644 --- a/src/SDCCglobl.h +++ b/src/SDCCglobl.h @@ -97,6 +97,7 @@ typedef int bool; #define PRAGMA_NOOVERLAY "NOOVERLAY" #define PRAGMA_CALLEESAVES "CALLEE-SAVES" #define PRAGMA_EXCLUDE "EXCLUDE" +#define PRAGMA_NOIV "NOIV" #define PRAGMA_OVERLAY "OVERLAY" #define SMALL_MODEL 0 #define LARGE_MODEL 1 @@ -236,6 +237,7 @@ struct options int useAccelerator; /* use ds390 Arithmetic Accelerator */ char *calleeSaves[128]; /* list of functions using callee save */ char *excludeRegs[32]; /* registers excluded from saving */ + int noiv; /* do not generate irq vector table entries */ int all_callee_saves; /* callee saves for all functions */ int stack_probe; /* insert call to function __stack_probe */ int tini_libid; /* library ID for TINI */ diff --git a/src/SDCCmem.c b/src/SDCCmem.c index b1e192e0..0c05b232 100644 --- a/src/SDCCmem.c +++ b/src/SDCCmem.c @@ -322,7 +322,7 @@ allocGlobal (symbol * sym) SPEC_OCLS (sym->etype) = code; /* if this is an interrupt service routine then put it in the interrupt service array */ - if (FUNC_ISISR (sym->type)) + if (FUNC_ISISR (sym->type) && !options.noiv) { if (interrupts[FUNC_INTNO (sym->type)])