]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c
Update version number in preparation for maintenance release.
[freertos] / FreeRTOS / Source / portable / Tasking / ARM_CM4F / port.c
index 6f252f81743f7d062b9a195963d4b9c72fe25bfc..da8b634cf70fdd11cdf17adf02c0644f8adaf791 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V8.2.2 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+    FreeRTOS V9.0.1 - Copyright (C) 2017 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -8,7 +8,7 @@
 \r
     FreeRTOS is free software; you can redistribute it and/or modify it under\r
     the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
+    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
 \r
     ***************************************************************************\r
     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
@@ -97,7 +97,7 @@
 #define portINITIAL_EXEC_RETURN                ( 0xfffffffd )\r
 \r
 /* Let the user override the pre-loading of the initial LR with the address of\r
-prvTaskExitError() in case is messes up unwinding of the stack in the\r
+prvTaskExitError() in case it messes up unwinding of the stack in the\r
 debugger. */\r
 #ifdef configTASK_RETURN_ADDRESS\r
        #define portTASK_RETURN_ADDRESS configTASK_RETURN_ADDRESS\r
@@ -105,6 +105,10 @@ debugger. */
        #define portTASK_RETURN_ADDRESS prvTaskExitError\r
 #endif\r
 \r
+/* For strict compliance with the Cortex-M spec the task start address should\r
+have bit-0 clear, as it is loaded into the PC on exit from an ISR. */\r
+#define portSTART_ADDRESS_MASK                         ( ( StackType_t ) 0xfffffffeUL )\r
+\r
 /* The priority used by the kernel is assigned to a variable to make access\r
 from inline assembler easier. */\r
 const uint32_t ulKernelPriority = configKERNEL_INTERRUPT_PRIORITY;\r
@@ -154,7 +158,7 @@ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t px
 \r
        *pxTopOfStack = portINITIAL_XPSR;       /* xPSR */\r
        pxTopOfStack--;\r
-       *pxTopOfStack = ( StackType_t ) pxCode; /* PC */\r
+       *pxTopOfStack = ( ( StackType_t ) pxCode ) & portSTART_ADDRESS_MASK;    /* PC */\r
        pxTopOfStack--;\r
        *pxTopOfStack = ( StackType_t ) portTASK_RETURN_ADDRESS;        /* LR */\r
 \r