From a686c0c8399601053618f26fe3fade201b3aa37a Mon Sep 17 00:00:00 2001 From: RichardBarry Date: Fri, 7 Mar 2008 18:23:27 +0000 Subject: [PATCH] Check in before attempting to remove absolute paths in PPC405 project. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@249 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../PPC405_Xilinx_Virtex4_GCC/RTOSDemo/main.c | 14 ++-- .../__xps/rtosdemo_compiler.opt | 2 +- Demo/PPC405_Xilinx_Virtex4_GCC/system.xmp | 2 +- .../system_incl.make | 2 +- Source/portable/GCC/PPC405_Xilinx/port.c | 67 +++---------------- 5 files changed, 22 insertions(+), 65 deletions(-) diff --git a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/main.c b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/main.c index c331c9df0..45b3b701c 100644 --- a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/main.c +++ b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/main.c @@ -139,7 +139,7 @@ discover an unexpected value. */ static unsigned portBASE_TYPE xRegTestStatus = pdPASS; /* Counters used to ensure the regtest tasks are still running. */ -static unsigned portLONG ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL; +static volatile unsigned portLONG ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL; /*-----------------------------------------------------------*/ @@ -332,20 +332,26 @@ static void prvSetupHardware( void ) } /*-----------------------------------------------------------*/ -static void prvRegTest1Pass( void ) +void prvRegTest1Pass( void ) { + /* Called from the inline assembler - this cannot be static + otherwise it can get optimised away. */ ulRegTest1Counter++; } /*-----------------------------------------------------------*/ -static void prvRegTest2Pass( void ) +void prvRegTest2Pass( void ) { + /* Called from the inline assembler - this cannot be static + otherwise it can get optimised away. */ ulRegTest2Counter++; } /*-----------------------------------------------------------*/ -static void prvRegTestFail( void ) +void prvRegTestFail( void ) { + /* Called from the inline assembler - this cannot be static + otherwise it can get optimised away. */ xRegTestStatus = pdFAIL; } /*-----------------------------------------------------------*/ diff --git a/Demo/PPC405_Xilinx_Virtex4_GCC/__xps/rtosdemo_compiler.opt b/Demo/PPC405_Xilinx_Virtex4_GCC/__xps/rtosdemo_compiler.opt index 42e94113d..ae471e99f 100644 --- a/Demo/PPC405_Xilinx_Virtex4_GCC/__xps/rtosdemo_compiler.opt +++ b/Demo/PPC405_Xilinx_Virtex4_GCC/__xps/rtosdemo_compiler.opt @@ -3,7 +3,7 @@ RTOSDEMO_SOURCES = RTOSDemo/main.c RTOSDemo/serial/serial.c RTOSDemo/partest/par RTOSDEMO_HEADERS = RTOSDemo/FreeRTOSConfig.h RTOSDEMO_CC = powerpc-eabi-gcc RTOSDEMO_CC_SIZE = powerpc-eabi-size -RTOSDEMO_CC_OPT = -O0 +RTOSDEMO_CC_OPT = -Os RTOSDEMO_CFLAGS = -D GCC_PPC405 -mregnames -Xlinker -Map=rtosdemo.map -Wall RTOSDEMO_CC_SEARCH = # -B RTOSDEMO_LIBPATH = -L./ppc405_0/lib/ # -L diff --git a/Demo/PPC405_Xilinx_Virtex4_GCC/system.xmp b/Demo/PPC405_Xilinx_Virtex4_GCC/system.xmp index da9099178..6bb8f19d4 100644 --- a/Demo/PPC405_Xilinx_Virtex4_GCC/system.xmp +++ b/Demo/PPC405_Xilinx_Virtex4_GCC/system.xmp @@ -61,7 +61,7 @@ Header: RTOSDemo/FreeRTOSConfig.h DefaultInit: EXECUTABLE InitBram: 0 Active: 1 -CompilerOptLevel: 0 +CompilerOptLevel: 4 GlobPtrOpt: 0 DebugSym: 1 ProfileFlag: 0 diff --git a/Demo/PPC405_Xilinx_Virtex4_GCC/system_incl.make b/Demo/PPC405_Xilinx_Virtex4_GCC/system_incl.make index dd7adf630..60ae46e13 100644 --- a/Demo/PPC405_Xilinx_Virtex4_GCC/system_incl.make +++ b/Demo/PPC405_Xilinx_Virtex4_GCC/system_incl.make @@ -115,7 +115,7 @@ RTOSDEMO_HEADERS = RTOSDemo/FreeRTOSConfig.h RTOSDEMO_CC = powerpc-eabi-gcc RTOSDEMO_CC_SIZE = powerpc-eabi-size -RTOSDEMO_CC_OPT = -O0 +RTOSDEMO_CC_OPT = -Os RTOSDEMO_CFLAGS = -D GCC_PPC405 -mregnames -Xlinker -Map=rtosdemo.map -Wall RTOSDEMO_CC_SEARCH = # -B RTOSDEMO_LIBPATH = -L./ppc405_0/lib/ # -L diff --git a/Source/portable/GCC/PPC405_Xilinx/port.c b/Source/portable/GCC/PPC405_Xilinx/port.c index 23acc2647..ebe2b0263 100644 --- a/Source/portable/GCC/PPC405_Xilinx/port.c +++ b/Source/portable/GCC/PPC405_Xilinx/port.c @@ -105,66 +105,16 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE *pxTopOfStack--; /* EABI stack frame. */ - *pxTopOfStack = 0x31313131UL; /* R31. */ - pxTopOfStack--; - *pxTopOfStack = 0x30303030UL; /* R30. */ - pxTopOfStack--; - *pxTopOfStack = 0x29292929UL; /* R29. */ - pxTopOfStack--; - *pxTopOfStack = 0x28282828UL; /* R28. */ - pxTopOfStack--; - *pxTopOfStack = 0x27272727UL; /* R27. */ - pxTopOfStack--; - *pxTopOfStack = 0x26262626UL; /* R26. */ - pxTopOfStack--; - *pxTopOfStack = 0x25252525UL; /* R25. */ - pxTopOfStack--; - *pxTopOfStack = 0x24242424UL; /* R24. */ - pxTopOfStack--; - *pxTopOfStack = 0x23232323UL; /* R23. */ - pxTopOfStack--; - *pxTopOfStack = 0x22222222UL; /* R22. */ - pxTopOfStack--; - *pxTopOfStack = 0x21212121UL; /* R21. */ - pxTopOfStack--; - *pxTopOfStack = 0x20202020UL; /* R20. */ - pxTopOfStack--; - *pxTopOfStack = 0x19191919UL; /* R19. */ - pxTopOfStack--; - *pxTopOfStack = 0x18181818UL; /* R18. */ - pxTopOfStack--; - *pxTopOfStack = 0x17171717UL; /* R17. */ - pxTopOfStack--; - *pxTopOfStack = 0x16161616UL; /* R16. */ - pxTopOfStack--; - *pxTopOfStack = 0x15151515UL; /* R15. */ - pxTopOfStack--; - *pxTopOfStack = 0x14141414UL; /* R14. */ - pxTopOfStack--; - *pxTopOfStack = 0x13131313UL; /* R13. */ - pxTopOfStack--; - *pxTopOfStack = 0x12121212UL; /* R12. */ - pxTopOfStack--; - *pxTopOfStack = 0x11111111UL; /* R11. */ - pxTopOfStack--; - *pxTopOfStack = 0x10101010UL; /* R10. */ - pxTopOfStack--; - *pxTopOfStack = 0x09090909UL; /* R9. */ - pxTopOfStack--; - *pxTopOfStack = 0x08080808UL; /* R8. */ - pxTopOfStack--; - *pxTopOfStack = 0x07070707UL; /* R7. */ - pxTopOfStack--; - *pxTopOfStack = 0x06060606UL; /* R6. */ - pxTopOfStack--; - *pxTopOfStack = 0x05050505UL; /* R5. */ - pxTopOfStack--; - *pxTopOfStack = 0x04040404UL; /* R4. */ - pxTopOfStack--; + pxTopOfStack -= 28; /* R31 to R4 inclusive. */ + + /* Parameters in R3. */ *pxTopOfStack = ( portSTACK_TYPE ) pvParameters; pxTopOfStack--; *pxTopOfStack = 0x02020202UL; /* R2. */ pxTopOfStack--; + + /* R1 is the stack pointer so is omitted. */ + *pxTopOfStack = 0x10000001UL;; /* R0. */ pxTopOfStack--; *pxTopOfStack = 0x00000000UL; /* USPRG0. */ @@ -175,13 +125,13 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxTopOfStack--; *pxTopOfStack = 0x00000000UL; /* CTR. */ pxTopOfStack--; - *pxTopOfStack = ( portSTACK_TYPE ) vPortStartFirstTask; /* LR. */ + *pxTopOfStack = ( portSTACK_TYPE ) vPortEndScheduler; /* LR. */ pxTopOfStack--; *pxTopOfStack = ( portSTACK_TYPE ) pxCode; /* SRR0. */ pxTopOfStack--; *pxTopOfStack = portINITIAL_MSR;/* SRR1. */ pxTopOfStack--; - *pxTopOfStack = ( portSTACK_TYPE ) vPortStartFirstTask;/* Next LR. */ + *pxTopOfStack = ( portSTACK_TYPE ) vPortEndScheduler;/* Next LR. */ pxTopOfStack--; *pxTopOfStack = 0x00000000UL;;/* Backchain. */ @@ -203,6 +153,7 @@ portBASE_TYPE xPortStartScheduler( void ) void vPortEndScheduler( void ) { /* Not implemented. */ + for( ;; ); } /*-----------------------------------------------------------*/ -- 2.39.5