*/\r
\r
/* Kernel includes. */\r
-\r
#include "FreeRTOS.h"\r
#include "task.h"\r
\r
/* Supervisor mode set. */\r
#define portINITIAL_STATUS_REGISTER ( ( portSTACK_TYPE ) 0x2000)\r
\r
+/* Used to keep track of the number of nested calls to taskENTER_CRITICAL(). This\r
+will be set to 0 prior to the first task being started. */\r
static unsigned portLONG ulCriticalNesting = 0x9999UL;\r
\r
+/*-----------------------------------------------------------*/\r
\r
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE * pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )\r
{\r
pxTopOfStack--;\r
\r
*pxTopOfStack = ( portSTACK_TYPE ) 0x0; /*FP*/\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xA5A5A5A5;\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xA4A4A4A4;\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xA3A3A3A3;\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xA2A2A2A2;\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xA1A1A1A1;\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xA0A0A0A0;\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD7D7D7D7;\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD6D6D6D6;\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD5D5D5D5;\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD4D4D4D4;\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD3D3D3D3;\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD2D2D2D2;\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD1D1D1D1;\r
- pxTopOfStack--;\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD0D0D0D0;\r
+ pxTopOfStack -= 14; /* A5 to D0. */\r
\r
return pxTopOfStack;\r
}\r
\r
ulCriticalNesting = 0UL;\r
\r
+ /* Configure the interrupts used by this port. */\r
vApplicationSetupInterrupts();\r
+\r
+ /* Start the first task executing. */\r
vPortStartFirstTask();\r
\r
return pdFALSE;\r
\r
void vPortEndScheduler( void )\r
{\r
+ /* Not implemented as there is nothing to return to. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
{\r
if( ulCriticalNesting == 0UL )\r
{\r
+ /* Guard against context switches being pended simultaneously with a\r
+ critical section being entered. */\r
do\r
{\r
portDISABLE_INTERRUPTS();\r
unsigned portLONG ulSavedInterruptMask;\r
\r
ulSavedInterruptMask = portSET_INTERRUPT_MASK_FROM_ISR();\r
- /* -32 as we are using the high word of the 64bit mask. */\r
/* Note this will clear all forced interrupts - this is done for speed. */\r
MCF_INTC0_INTFRCH = 0;\r
vTaskSwitchContext();\r