static unsigned portBASE_TYPE xRegTestStatus = pdPASS;\r
\r
/* Counters used to ensure the regtest tasks are still running. */\r
-static unsigned portLONG ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL;\r
+static volatile unsigned portLONG ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL;\r
\r
/*-----------------------------------------------------------*/\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvRegTest1Pass( void )\r
+void prvRegTest1Pass( void )\r
{\r
+ /* Called from the inline assembler - this cannot be static\r
+ otherwise it can get optimised away. */\r
ulRegTest1Counter++;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvRegTest2Pass( void )\r
+void prvRegTest2Pass( void )\r
{\r
+ /* Called from the inline assembler - this cannot be static\r
+ otherwise it can get optimised away. */\r
ulRegTest2Counter++;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvRegTestFail( void )\r
+void prvRegTestFail( void )\r
{\r
+ /* Called from the inline assembler - this cannot be static\r
+ otherwise it can get optimised away. */\r
xRegTestStatus = pdFAIL;\r
}\r
/*-----------------------------------------------------------*/\r
*pxTopOfStack--;\r
\r
/* EABI stack frame. */\r
- *pxTopOfStack = 0x31313131UL; /* R31. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x30303030UL; /* R30. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x29292929UL; /* R29. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x28282828UL; /* R28. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x27272727UL; /* R27. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x26262626UL; /* R26. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x25252525UL; /* R25. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x24242424UL; /* R24. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x23232323UL; /* R23. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x22222222UL; /* R22. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x21212121UL; /* R21. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x20202020UL; /* R20. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x19191919UL; /* R19. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x18181818UL; /* R18. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x17171717UL; /* R17. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x16161616UL; /* R16. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x15151515UL; /* R15. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x14141414UL; /* R14. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x13131313UL; /* R13. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x12121212UL; /* R12. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x11111111UL; /* R11. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x10101010UL; /* R10. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x09090909UL; /* R9. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x08080808UL; /* R8. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x07070707UL; /* R7. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x06060606UL; /* R6. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x05050505UL; /* R5. */\r
- pxTopOfStack--;\r
- *pxTopOfStack = 0x04040404UL; /* R4. */\r
- pxTopOfStack--;\r
+ pxTopOfStack -= 28; /* R31 to R4 inclusive. */\r
+\r
+ /* Parameters in R3. */\r
*pxTopOfStack = ( portSTACK_TYPE ) pvParameters;\r
pxTopOfStack--;\r
*pxTopOfStack = 0x02020202UL; /* R2. */\r
pxTopOfStack--;\r
+\r
+ /* R1 is the stack pointer so is omitted. */\r
+\r
*pxTopOfStack = 0x10000001UL;; /* R0. */\r
pxTopOfStack--;\r
*pxTopOfStack = 0x00000000UL; /* USPRG0. */\r
pxTopOfStack--;\r
*pxTopOfStack = 0x00000000UL; /* CTR. */\r
pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) vPortStartFirstTask; /* LR. */\r
+ *pxTopOfStack = ( portSTACK_TYPE ) vPortEndScheduler; /* LR. */\r
pxTopOfStack--;\r
*pxTopOfStack = ( portSTACK_TYPE ) pxCode; /* SRR0. */\r
pxTopOfStack--;\r
*pxTopOfStack = portINITIAL_MSR;/* SRR1. */\r
pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) vPortStartFirstTask;/* Next LR. */\r
+ *pxTopOfStack = ( portSTACK_TYPE ) vPortEndScheduler;/* Next LR. */\r
pxTopOfStack--;\r
*pxTopOfStack = 0x00000000UL;;/* Backchain. */\r
\r
void vPortEndScheduler( void )\r
{\r
/* Not implemented. */\r
+ for( ;; );\r
}\r
/*-----------------------------------------------------------*/\r
\r