]> git.sur5r.net Git - freertos/commitdiff
Ensure the definition of prvTaskExitError()does not result in a compiler warning...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 7 Nov 2013 16:43:54 +0000 (16:43 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 7 Nov 2013 16:43:54 +0000 (16:43 +0000)
Remove duplicate save/restore of r14 in Cortex-M4F ports.

git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2089 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Source/portable/GCC/ARM_CM0/port.c
FreeRTOS/Source/portable/GCC/ARM_CM3/port.c
FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c
FreeRTOS/Source/portable/IAR/ARM_CM4F/portasm.s
FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c
FreeRTOS/Source/portable/Tasking/ARM_CM4F/port_asm.asm

index 0f99dd5f9d2f5d1426be30b2bf1202fb67c92f2d..e638d289855a9c3adb1b466fec877b50dbda2d09 100644 (file)
@@ -208,6 +208,12 @@ portBASE_TYPE xPortStartScheduler( void )
 \r
        /* Start the first task. */\r
        vPortStartFirstTask();\r
+       \r
+       /* Should never get here as the tasks will now be executing!  Call the task\r
+       exit error function to prevent compiler warnings about a static function\r
+       not being called in the case that the application writer overrides this\r
+       functionality by defining configTASK_RETURN_ADDRESS. */\r
+       prvTaskExitError();\r
 \r
        /* Should not get here! */\r
        return 0;\r
index ed15b927c156d599a9ec18beb637ce728d9811a5..3967a6a88c21f38d1443e8a0d4c36d1e58c96c73 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -218,13 +218,13 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE
 static void prvTaskExitError( void )\r
 {\r
        /* A function that implements a task must not exit or attempt to return to\r
-       its caller as there is nothing to return to.  If a task wants to exit it \r
+       its caller as there is nothing to return to.  If a task wants to exit it\r
        should instead call vTaskDelete( NULL ).\r
-       \r
-       Artificially force an assert() to be triggered if configASSERT() is \r
+\r
+       Artificially force an assert() to be triggered if configASSERT() is\r
        defined, then stop here so application writers can catch the error. */\r
        configASSERT( uxCriticalNesting == ~0UL );\r
-       portDISABLE_INTERRUPTS();       \r
+       portDISABLE_INTERRUPTS();\r
        for( ;; );\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -329,6 +329,12 @@ portBASE_TYPE xPortStartScheduler( void )
        /* Start the first task. */\r
        prvPortStartFirstTask();\r
 \r
+       /* Should never get here as the tasks will now be executing!  Call the task\r
+       exit error function to prevent compiler warnings about a static function\r
+       not being called in the case that the application writer overrides this\r
+       functionality by defining configTASK_RETURN_ADDRESS. */\r
+       prvTaskExitError();\r
+\r
        /* Should not get here! */\r
        return 0;\r
 }\r
@@ -497,10 +503,10 @@ void xPortSysTickHandler( void )
                        /* Restart from whatever is left in the count register to complete\r
                        this tick period. */\r
                        portNVIC_SYSTICK_LOAD_REG = portNVIC_SYSTICK_CURRENT_VALUE_REG;\r
-                       \r
+\r
                        /* Restart SysTick. */\r
                        portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
-                       \r
+\r
                        /* Reset the reload register to the value required for normal tick\r
                        periods. */\r
                        portNVIC_SYSTICK_LOAD_REG = ulTimerCountsForOneTick - 1UL;\r
@@ -549,23 +555,23 @@ void xPortSysTickHandler( void )
                        if( ( portNVIC_SYSTICK_CTRL_REG & portNVIC_SYSTICK_COUNT_FLAG_BIT ) != 0 )\r
                        {\r
                                unsigned long ulCalculatedLoadValue;\r
-                               \r
+\r
                                /* The tick interrupt has already executed, and the SysTick\r
                                count reloaded with ulReloadValue.  Reset the\r
                                portNVIC_SYSTICK_LOAD_REG with whatever remains of this tick\r
                                period. */\r
                                ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL ) - ( ulReloadValue - portNVIC_SYSTICK_CURRENT_VALUE_REG );\r
 \r
-                               /* Don't allow a tiny value, or values that have somehow \r
-                               underflowed because the post sleep hook did something \r
+                               /* Don't allow a tiny value, or values that have somehow\r
+                               underflowed because the post sleep hook did something\r
                                that took too long. */\r
                                if( ( ulCalculatedLoadValue < ulStoppedTimerCompensation ) || ( ulCalculatedLoadValue > ulTimerCountsForOneTick ) )\r
                                {\r
                                        ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL );\r
                                }\r
-                               \r
+\r
                                portNVIC_SYSTICK_LOAD_REG = ulCalculatedLoadValue;\r
-                               \r
+\r
                                /* The tick interrupt handler will already have pended the tick\r
                                processing in the kernel.  As the pending tick will be\r
                                processed as soon as this function exits, the tick value\r
index 852a6bc7a7cb65f213dfcb63e41ac804401ab82b..6069cdcb8924e1007617fc559751566e4895ac39 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -353,6 +353,12 @@ portBASE_TYPE xPortStartScheduler( void )
        /* Start the first task. */\r
        prvPortStartFirstTask();\r
 \r
+       /* Should never get here as the tasks will now be executing!  Call the task\r
+       exit error function to prevent compiler warnings about a static function\r
+       not being called in the case that the application writer overrides this\r
+       functionality by defining configTASK_RETURN_ADDRESS. */\r
+       prvTaskExitError();\r
+\r
        /* Should not get here! */\r
        return 0;\r
 }\r
@@ -446,13 +452,13 @@ void xPortPendSVHandler( void )
        "                                                                               \n"\r
        "       str r0, [r2]                                            \n" /* Save the new top of stack into the first member of the TCB. */\r
        "                                                                               \n"\r
-       "       stmdb sp!, {r3, r14}                            \n"\r
+       "       stmdb sp!, {r3}                                         \n"\r
        "       mov r0, %0                                                      \n"\r
        "       msr basepri, r0                                         \n"\r
        "       bl vTaskSwitchContext                           \n"\r
        "       mov r0, #0                                                      \n"\r
        "       msr basepri, r0                                         \n"\r
-       "       ldmia sp!, {r3, r14}                            \n"\r
+       "       ldmia sp!, {r3}                                         \n"\r
        "                                                                               \n"\r
        "       ldr r1, [r3]                                            \n" /* The first item in pxCurrentTCB is the task top of stack. */\r
        "       ldr r0, [r1]                                            \n"\r
@@ -592,23 +598,23 @@ void xPortSysTickHandler( void )
                        if( ( portNVIC_SYSTICK_CTRL_REG & portNVIC_SYSTICK_COUNT_FLAG_BIT ) != 0 )\r
                        {\r
                                unsigned long ulCalculatedLoadValue;\r
-                               \r
+\r
                                /* The tick interrupt has already executed, and the SysTick\r
                                count reloaded with ulReloadValue.  Reset the\r
                                portNVIC_SYSTICK_LOAD_REG with whatever remains of this tick\r
                                period. */\r
                                ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL ) - ( ulReloadValue - portNVIC_SYSTICK_CURRENT_VALUE_REG );\r
 \r
-                               /* Don't allow a tiny value, or values that have somehow \r
-                               underflowed because the post sleep hook did something \r
+                               /* Don't allow a tiny value, or values that have somehow\r
+                               underflowed because the post sleep hook did something\r
                                that took too long. */\r
                                if( ( ulCalculatedLoadValue < ulStoppedTimerCompensation ) || ( ulCalculatedLoadValue > ulTimerCountsForOneTick ) )\r
                                {\r
                                        ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL );\r
                                }\r
-                               \r
+\r
                                portNVIC_SYSTICK_LOAD_REG = ulCalculatedLoadValue;\r
-                               \r
+\r
                                /* The tick interrupt handler will already have pended the tick\r
                                processing in the kernel.  As the pending tick will be\r
                                processed as soon as this function exits, the tick value\r
index 862ea15ac7e9562fe23e96309928c84ac82ddb4e..4e5ed520d052cc4f1421f14d10e43a07478a4d3b 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -99,13 +99,13 @@ xPortPendSVHandler:
        /* Save the new top of stack into the first member of the TCB. */\r
        str r0, [r2]\r
 \r
-       stmdb sp!, {r3, r14}\r
+       stmdb sp!, {r3}\r
        mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY\r
        msr basepri, r0\r
        bl vTaskSwitchContext\r
        mov r0, #0\r
        msr basepri, r0\r
-       ldmia sp!, {r3, r14}\r
+       ldmia sp!, {r3}\r
 \r
        /* The first item in pxCurrentTCB is the task top of stack. */\r
        ldr r1, [r3]\r
index 845bbcc53fa5279eb0e1ced984484e30e2a165d2..09f284b2371ff3d63ff575d297d5d87007d59540 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -196,7 +196,7 @@ static void prvTaskExitError( void );
 #endif /* configUSE_TICKLESS_IDLE */\r
 \r
 /*\r
- * Used by the portASSERT_IF_INTERRUPT_PRIORITY_INVALID() macro to ensure \r
+ * Used by the portASSERT_IF_INTERRUPT_PRIORITY_INVALID() macro to ensure\r
  * FreeRTOS API functions are not called from interrupts that have been assigned\r
  * a priority above configMAX_SYSCALL_INTERRUPT_PRIORITY.\r
  */\r
@@ -244,13 +244,13 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE
 static void prvTaskExitError( void )\r
 {\r
        /* A function that implements a task must not exit or attempt to return to\r
-       its caller as there is nothing to return to.  If a task wants to exit it \r
+       its caller as there is nothing to return to.  If a task wants to exit it\r
        should instead call vTaskDelete( NULL ).\r
-       \r
-       Artificially force an assert() to be triggered if configASSERT() is \r
+\r
+       Artificially force an assert() to be triggered if configASSERT() is\r
        defined, then stop here so application writers can catch the error. */\r
        configASSERT( uxCriticalNesting == ~0UL );\r
-       portDISABLE_INTERRUPTS();       \r
+       portDISABLE_INTERRUPTS();\r
        for( ;; );\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -443,13 +443,13 @@ __asm void xPortPendSVHandler( void )
        /* Save the new top of stack into the first member of the TCB. */\r
        str r0, [r2]\r
 \r
-       stmdb sp!, {r3, r14}\r
+       stmdb sp!, {r3}\r
        mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY\r
        msr basepri, r0\r
        bl vTaskSwitchContext\r
        mov r0, #0\r
        msr basepri, r0\r
-       ldmia sp!, {r3, r14}\r
+       ldmia sp!, {r3}\r
 \r
        /* The first item in pxCurrentTCB is the task top of stack. */\r
        ldr r1, [r3]\r
@@ -465,14 +465,14 @@ __asm void xPortPendSVHandler( void )
        vldmiaeq r0!, {s16-s31}\r
 \r
        msr psp, r0\r
-       \r
+\r
        #ifdef WORKAROUND_PMU_CM001 /* XMC4000 specific errata */\r
                #if WORKAROUND_PMU_CM001 == 1\r
                        push { r14 }\r
                        pop { pc }\r
                #endif\r
        #endif\r
-       \r
+\r
        bx r14\r
        nop\r
 }\r
@@ -537,10 +537,10 @@ void xPortSysTickHandler( void )
                        /* Restart from whatever is left in the count register to complete\r
                        this tick period. */\r
                        portNVIC_SYSTICK_LOAD_REG = portNVIC_SYSTICK_CURRENT_VALUE_REG;\r
-                       \r
+\r
                        /* Restart SysTick. */\r
                        portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
-                       \r
+\r
                        /* Reset the reload register to the value required for normal tick\r
                        periods. */\r
                        portNVIC_SYSTICK_LOAD_REG = ulTimerCountsForOneTick - 1UL;\r
@@ -589,23 +589,23 @@ void xPortSysTickHandler( void )
                        if( ( portNVIC_SYSTICK_CTRL_REG & portNVIC_SYSTICK_COUNT_FLAG_BIT ) != 0 )\r
                        {\r
                                unsigned long ulCalculatedLoadValue;\r
-                               \r
+\r
                                /* The tick interrupt has already executed, and the SysTick\r
                                count reloaded with ulReloadValue.  Reset the\r
                                portNVIC_SYSTICK_LOAD_REG with whatever remains of this tick\r
                                period. */\r
                                ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL ) - ( ulReloadValue - portNVIC_SYSTICK_CURRENT_VALUE_REG );\r
 \r
-                               /* Don't allow a tiny value, or values that have somehow \r
-                               underflowed because the post sleep hook did something \r
+                               /* Don't allow a tiny value, or values that have somehow\r
+                               underflowed because the post sleep hook did something\r
                                that took too long. */\r
                                if( ( ulCalculatedLoadValue < ulStoppedTimerCompensation ) || ( ulCalculatedLoadValue > ulTimerCountsForOneTick ) )\r
                                {\r
                                        ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL );\r
                                }\r
-                               \r
+\r
                                portNVIC_SYSTICK_LOAD_REG = ulCalculatedLoadValue;\r
-                               \r
+\r
                                /* The tick interrupt handler will already have pended the tick\r
                                processing in the kernel.  As the pending tick will be\r
                                processed as soon as this function exits, the tick value\r
@@ -698,7 +698,7 @@ __asm void vPortClearInterruptMask( unsigned long ulNewMask )
 __asm unsigned long vPortGetIPSR( void )\r
 {\r
        PRESERVE8\r
-       \r
+\r
        mrs r0, ipsr\r
        bx r14\r
 }\r
index 9d9c42074348f255fc739800dced3fd52f892b8f..87cba440b7c178cff44773de8d7d19d161350a1a 100644 (file)
@@ -64,7 +64,7 @@
        .global vPortEnableVFP\r
        .global ulPortSetInterruptMask\r
        .global vPortClearInterruptMask\r
-       \r
+\r
 ;-----------------------------------------------------------\r
 \r
        .section .text\r
@@ -89,13 +89,13 @@ _vector_14: .type func
        ;Save the new top of stack into the first member of the TCB.\r
        str r0, [r2]\r
 \r
-       stmdb sp!, {r3, r14}\r
+       stmdb sp!, {r3}\r
        ldr.w r0, =ulMaxSyscallInterruptPriorityConst\r
        msr basepri, r0\r
        bl vTaskSwitchContext\r
        mov r0, #0\r
        msr basepri, r0\r
-       ldmia sp!, {r3, r14}\r
+       ldmia sp!, {r3}\r
 \r
        ;The first item in pxCurrentTCB is the task top of stack.\r
        ldr r1, [r3]\r
@@ -141,13 +141,13 @@ _lc_ref__vector_pp_14: .type func
        ;Save the new top of stack into the first member of the TCB.\r
        str r0, [r2]\r
 \r
-       stmdb sp!, {r3, r14}\r
+       stmdb sp!, {r3}\r
        ldr.w r0, =ulMaxSyscallInterruptPriorityConst\r
        msr basepri, r0\r
        bl vTaskSwitchContext\r
        mov r0, #0\r
        msr basepri, r0\r
-       ldmia sp!, {r3, r14}\r
+       ldmia sp!, {r3}\r
 \r
        ;The first item in pxCurrentTCB is the task top of stack.\r
        ldr r1, [r3]\r
@@ -249,4 +249,4 @@ vPortClearInterruptMask:
 ;-----------------------------------------------------------\r
 \r
        .end\r
-       \r
+\r