summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2008-09-17 15:58:45 +0000
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2008-09-17 15:58:45 +0000
commita2d57fb0c27146fc5a9023ba81c674e97377a8c8 (patch)
tree674c524fdc907b97cc6493bc9b472419fc36d504 /Source
parenta904ed14242ab60196d8304f31e94792e1587fce (diff)
downloadfreertos-a2d57fb0c27146fc5a9023ba81c674e97377a8c8.tar.gz
freertos-a2d57fb0c27146fc5a9023ba81c674e97377a8c8.tar.bz2
freertos-a2d57fb0c27146fc5a9023ba81c674e97377a8c8.tar.xz
Tidy up.
git-svn-id: https://freertos.svn.sourceforge.net/svnroot/freertos/trunk@469 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
Diffstat (limited to 'Source')
-rw-r--r--Source/portable/GCC/ColdFire_V2/port.c54
1 files changed, 10 insertions, 44 deletions
diff --git a/Source/portable/GCC/ColdFire_V2/port.c b/Source/portable/GCC/ColdFire_V2/port.c
index 986e85c4..8a7883bf 100644
--- a/Source/portable/GCC/ColdFire_V2/port.c
+++ b/Source/portable/GCC/ColdFire_V2/port.c
@@ -48,7 +48,6 @@
*/
/* Kernel includes. */
-
#include "FreeRTOS.h"
#include "task.h"
@@ -57,8 +56,11 @@
/* Supervisor mode set. */
#define portINITIAL_STATUS_REGISTER ( ( portSTACK_TYPE ) 0x2000)
+/* Used to keep track of the number of nested calls to taskENTER_CRITICAL(). This
+will be set to 0 prior to the first task being started. */
static unsigned portLONG ulCriticalNesting = 0x9999UL;
+/*-----------------------------------------------------------*/
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE * pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
@@ -76,48 +78,7 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE * pxTopOfStack, pdTASK_COD
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) 0x0; /*FP*/
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xA5A5A5A5;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xA4A4A4A4;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xA3A3A3A3;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xA2A2A2A2;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xA1A1A1A1;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xA0A0A0A0;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD7D7D7D7;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD6D6D6D6;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD5D5D5D5;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD4D4D4D4;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD3D3D3D3;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD2D2D2D2;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD1D1D1D1;
- pxTopOfStack--;
-
- *pxTopOfStack = ( portSTACK_TYPE ) 0xD0D0D0D0;
+ pxTopOfStack -= 14; /* A5 to D0. */
return pxTopOfStack;
}
@@ -129,7 +90,10 @@ extern void vPortStartFirstTask( void );
ulCriticalNesting = 0UL;
+ /* Configure the interrupts used by this port. */
vApplicationSetupInterrupts();
+
+ /* Start the first task executing. */
vPortStartFirstTask();
return pdFALSE;
@@ -138,6 +102,7 @@ extern void vPortStartFirstTask( void );
void vPortEndScheduler( void )
{
+ /* Not implemented as there is nothing to return to. */
}
/*-----------------------------------------------------------*/
@@ -145,6 +110,8 @@ void vPortEnterCritical( void )
{
if( ulCriticalNesting == 0UL )
{
+ /* Guard against context switches being pended simultaneously with a
+ critical section being entered. */
do
{
portDISABLE_INTERRUPTS();
@@ -176,7 +143,6 @@ void vPortYieldHandler( void )
unsigned portLONG ulSavedInterruptMask;
ulSavedInterruptMask = portSET_INTERRUPT_MASK_FROM_ISR();
- /* -32 as we are using the high word of the 64bit mask. */
/* Note this will clear all forced interrupts - this is done for speed. */
MCF_INTC0_INTFRCH = 0;
vTaskSwitchContext();