From: richardbarry Date: Sun, 22 Apr 2007 10:50:03 +0000 (+0000) Subject: Accomodates wizC V14.00B and up with full optimisations. X-Git-Tag: V4.3.0~7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=72e142ae1800c1eb6de547f45474f73c905b8089;p=freertos Accomodates wizC V14.00B and up with full optimisations. Thanks Marcel. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@80 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Source/portable/WizC/PIC18/port.c b/Source/portable/WizC/PIC18/port.c index ecd71343e..9c82529aa 100644 --- a/Source/portable/WizC/PIC18/port.c +++ b/Source/portable/WizC/PIC18/port.c @@ -34,6 +34,10 @@ */ /* +Changes from V4.2.1 + + CallReturn Depth increased from 10 to 12 levels to accomodate wizC/fedC V14. + +CodeOptions added to disable the wizC/fedC optimiser within asm + Changes from V3.2.1 + CallReturn Depth increased from 8 to 10 levels to accomodate wizC/fedC V12. @@ -92,7 +96,7 @@ extern volatile tskTCB * volatile pxCurrentTCB; #define portSTACK_CALLRETURN_ENTRY_SIZE ( 2 ) #endif -#define portSTACK_MINIMAL_CALLRETURN_DEPTH ( 10 ) +#define portSTACK_MINIMAL_CALLRETURN_DEPTH ( 12 ) #define portSTACK_OTHER_BYTES ( 20 ) unsigned portSHORT usCalcMinStackSize = 0; @@ -121,8 +125,10 @@ unsigned portCHAR ucScratch; * We do this here already to avoid W-register conflicts. */ _Pragma("asm") + dupmodoff movlw OVERHEADPAGE0-LOCOPTSIZE+MAXLOCOPTSIZE movwf PRODL,ACCESS ; PRODL is used as temp register + dupmodon _Pragma("asmend") ucScratch = PRODL; @@ -214,9 +220,11 @@ unsigned portSHORT usPortCALCULATE_MINIMAL_STACK_SIZE( void ) * Fetch the size of compiler's scratchspace. */ _Pragma("asm") + dupmodoff movlw OVERHEADPAGE0-LOCOPTSIZE+MAXLOCOPTSIZE movlb usCalcMinStackSize>>8 movwf usCalcMinStackSize,BANKED + dupmodon _Pragma("asmend") /* diff --git a/Source/portable/WizC/PIC18/portmacro.h b/Source/portable/WizC/PIC18/portmacro.h index 86ef2585d..04953224e 100644 --- a/Source/portable/WizC/PIC18/portmacro.h +++ b/Source/portable/WizC/PIC18/portmacro.h @@ -209,6 +209,7 @@ extern unsigned portSHORT usCalcMinStackSize; portDISABLE_INTERRUPTS(); \ \ _Pragma("asm") \ + dupmodoff \ ; \ ; Push the relevant SFR's onto the task's stack \ ; \ @@ -282,6 +283,7 @@ extern unsigned portSHORT usCalcMinStackSize; movff pxCurrentTCB+1,FSR0H \ movff FSR2L,POSTINC0 \ movff FSR2H,POSTINC0 \ + dupmodon \ _Pragma("asmend") \ } while(0) @@ -294,6 +296,7 @@ extern unsigned portSHORT usCalcMinStackSize; do \ { \ _Pragma("asm") \ + dupmodoff \ ; \ ; Set FSR0 to point to pxCurrentTCB->pxTopOfStack. \ ; \ @@ -393,6 +396,7 @@ extern unsigned portSHORT usCalcMinStackSize; movff PREINC2,WREG \ movff PREINC2,STATUS \ return 0 ; Return without affecting interrupts \ + dupmodon \ _Pragma("asmend") \ } while(0) @@ -406,7 +410,9 @@ extern void vPortYield( void ); #define portYIELD() vPortYield() #define portNOP() _Pragma("asm") \ + dupmodoff \ nop \ + dupmodon \ _Pragma("asmend") /*-----------------------------------------------------------*/