]> git.sur5r.net Git - freertos/commitdiff
Convert the remaining ports to use xTaskIncrementTick() in place of vTaskIncremenTick().
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 7 Jun 2013 12:16:58 +0000 (12:16 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 7 Jun 2013 12:16:58 +0000 (12:16 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1922 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

21 files changed:
FreeRTOS/Source/portable/IAR/STR91x/port.c
FreeRTOS/Source/portable/MPLAB/PIC18F/port.c
FreeRTOS/Source/portable/MPLAB/PIC24_dsPIC/port.c
FreeRTOS/Source/portable/Paradigm/Tern_EE/large_untested/port.c
FreeRTOS/Source/portable/Paradigm/Tern_EE/small/port.c
FreeRTOS/Source/portable/RVDS/ARM7_LPC21xx/port.c
FreeRTOS/Source/portable/RVDS/ARM7_LPC21xx/portASM.s
FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c
FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c
FreeRTOS/Source/portable/Renesas/RX100/port.c
FreeRTOS/Source/portable/Renesas/RX200/port.c
FreeRTOS/Source/portable/Renesas/RX600/port.c
FreeRTOS/Source/portable/Renesas/SH2A_FPU/portasm.src
FreeRTOS/Source/portable/Rowley/MSP430F449/portext.asm
FreeRTOS/Source/portable/SDCC/Cygnal/port.c
FreeRTOS/Source/portable/Softune/MB91460/port.c
FreeRTOS/Source/portable/Softune/MB96340/port.c
FreeRTOS/Source/portable/Tasking/ARM_CM4F/port.c
FreeRTOS/Source/portable/WizC/PIC18/Drivers/Tick/isrTick.c
FreeRTOS/Source/portable/oWatcom/16BitDOS/Flsh186/port.c
FreeRTOS/Source/portable/oWatcom/16BitDOS/PC/port.c

index 24f3f4ef46a7c7fef71b1a2da2f7d92d6d902910..6be44ea15de1b992200603e32eac205bbf77789c 100644 (file)
@@ -415,16 +415,11 @@ keyword. */
                TIM2->OC1R += s_nPulseLength;\r
                \r
                /* Increment the tick counter. */\r
-               vTaskIncrementTick();\r
-               \r
-               #if configUSE_PREEMPTION == 1\r
+               if( xTaskIncrementTick() != pdFALSE )\r
                {\r
-                       /* The new tick value might unblock a task.  Ensure the highest task that\r
-                       is ready to execute is the task that will execute when the tick ISR\r
-                       exits. */\r
+                       /* Select a new task to run. */\r
                        vTaskSwitchContext();\r
                }\r
-               #endif\r
                \r
                /* Clear the interrupt in the watchdog. */\r
                TIM2->SR &= ~TIM_FLAG_OC1;\r
index 6c8f28d36f65c59fc4ce8b6e8f095eba5e977da9..44d540e0873e4238051df09b5d21f392024e22a7 100644 (file)
@@ -611,14 +611,11 @@ static void prvTickISR( void )
        PIR1bits.CCP1IF = 0;\r
 \r
        /* Maintain the tick count. */\r
-       vTaskIncrementTick();\r
-\r
-       #if configUSE_PREEMPTION == 1\r
+       if( xTaskIncrementTick() != pdFALSE )\r
        {\r
                /* Switch to the highest priority task that is ready to run. */\r
                vTaskSwitchContext();\r
        }\r
-       #endif\r
 \r
        portRESTORE_CONTEXT();\r
 }\r
index d67b4252056bb504d7a6b1b3743a8513722ea8c0..afaf561896c42ff9f5465956bc455189f9c45a1b 100644 (file)
@@ -358,9 +358,9 @@ void __attribute__((__interrupt__, auto_psv)) _T1Interrupt( void )
        /* Clear the timer interrupt. */\r
        IFS0bits.T1IF = 0;\r
 \r
-       vTaskIncrementTick();\r
-\r
-       #if configUSE_PREEMPTION == 1\r
+       if( xTaskIncrementTick() != pdFALSE )\r
+       {\r
                portYIELD();\r
-       #endif\r
+       }\r
 }\r
+\r
index caf5ab44ea2c51c60b0459ddb90fde1429ed0958..49577a52b5ed383c1f05f14201a363ed74c64f47 100644 (file)
@@ -220,10 +220,11 @@ is being used. */
        static void __interrupt __far prvPreemptiveTick( void )\r
        {\r
                /* Get the scheduler to update the task states following the tick. */\r
-               vTaskIncrementTick();\r
-\r
-               /* Switch in the context of the next task to be run. */\r
-               portSWITCH_CONTEXT();\r
+               if( xTaskIncrementTick() != pdFALSE )\r
+               {\r
+                       /* Switch in the context of the next task to be run. */\r
+                       portSWITCH_CONTEXT();\r
+               }\r
 \r
                /* Reset interrupt. */\r
                outport( portEIO_REGISTER, portCLEAR_INTERRUPT );\r
@@ -233,7 +234,8 @@ is being used. */
        {\r
                /* Same as preemptive tick, but the cooperative scheduler is being used\r
                so we don't have to switch in the context of the next task. */\r
-               vTaskIncrementTick();\r
+               xTaskIncrementTick();\r
+               \r
                /* Reset interrupt. */\r
                outport( portEIO_REGISTER, portCLEAR_INTERRUPT );\r
        }\r
index 7b3e85c2d967c25ccb07cfc9f998b083a114db7a..c093e465f595b31497ef9dc577fbee2477b19f83 100644 (file)
@@ -204,10 +204,11 @@ is being used. */
        static void __interrupt __far prvPreemptiveTick( void )\r
        {\r
                /* Get the scheduler to update the task states following the tick. */\r
-               vTaskIncrementTick();\r
-\r
-               /* Switch in the context of the next task to be run. */\r
-               portEND_SWITCHING_ISR();\r
+               if( xTaskIncrementTick() != pdFALSE )\r
+               {\r
+                       /* Switch in the context of the next task to be run. */\r
+                       portEND_SWITCHING_ISR();\r
+               }\r
 \r
                /* Reset interrupt. */\r
                outport( portEIO_REGISTER, portCLEAR_INTERRUPT );\r
@@ -217,7 +218,8 @@ is being used. */
        {\r
                /* Same as preemptive tick, but the cooperative scheduler is being used\r
                so we don't have to switch in the context of the next task. */\r
-               vTaskIncrementTick();\r
+               xTaskIncrementTick();\r
+               \r
                /* Reset interrupt. */\r
                outport( portEIO_REGISTER, portCLEAR_INTERRUPT );\r
        }\r
index 088303ccf9300f7356034b57a7627d1a975df06b..a8c8f5d38d950d01764d607a63e2133ca2abe3fe 100644 (file)
@@ -236,7 +236,7 @@ void vPortEndScheduler( void )
        {\r
                /* Increment the tick count - this may make a delaying task ready\r
                to run - but a context switch is not performed. */              \r
-               vTaskIncrementTick();\r
+               xTaskIncrementTick();\r
 \r
                T0IR = portTIMER_MATCH_ISR_BIT;                         /* Clear the timer event */\r
                VICVectAddr = portCLEAR_VIC_INTERRUPT;          /* Acknowledge the Interrupt */\r
index f146bbe94445c2d2f765ee8b547ec5b557636e14..95995e36026b75ef4625a180c7e75d3459815ea9 100644 (file)
@@ -54,7 +54,7 @@
        INCLUDE portmacro.inc\r
 \r
        IMPORT  vTaskSwitchContext\r
-       IMPORT  vTaskIncrementTick\r
+       IMPORT  xTaskIncrementTick\r
 \r
        EXPORT  vPortYieldProcessor\r
        EXPORT  vPortStartFirstTask\r
@@ -127,7 +127,7 @@ vPreemptiveTick
 \r
        portSAVE_CONTEXT                                        ; Save the context of the current task. \r
 \r
-       LDR R0, =vTaskIncrementTick                     ; Increment the tick count.  \r
+       LDR R0, =xTaskIncrementTick                     ; Increment the tick count.  \r
        MOV LR, PC                                                      ; This may make a delayed task ready\r
        BX R0                                                           ; to run.\r
        \r
index c721f1fe35b27f0d55818987719b8e9b09580565..78161f51b02452bfbc773b9fcb1440859510d8b0 100644 (file)
@@ -325,13 +325,6 @@ __asm void xPortPendSVHandler( void )
 \r
 void xPortSysTickHandler( void )\r
 {\r
-       #if configUSE_PREEMPTION == 1\r
-       {\r
-               /* If using preemption, also force a context switch. */\r
-               portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;\r
-       }\r
-       #endif\r
-\r
        /* Only reset the systick load register if configUSE_TICKLESS_IDLE is set to\r
        1.  If it is set to 0 tickless idle is not being used.  If it is set to a\r
        value other than 0 or 1 then a timer other than the SysTick is being used\r
@@ -342,7 +335,11 @@ void xPortSysTickHandler( void )
 \r
        ( void ) portSET_INTERRUPT_MASK_FROM_ISR();\r
        {\r
-               vTaskIncrementTick();\r
+               if( xTaskIncrementTick() != pdFALSE )\r
+               {\r
+                       /* Pend a context switch. */\r
+                       portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;\r
+               }\r
        }\r
        portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 );\r
 }\r
index 345f386bfc2335c188d1dbd34fd3f56ed9d91423..69a1111b3b9de8de8dc800fc52ff71848ad6caaa 100644 (file)
@@ -388,13 +388,6 @@ __asm void xPortPendSVHandler( void )
 \r
 void xPortSysTickHandler( void )\r
 {\r
-       #if configUSE_PREEMPTION == 1\r
-       {\r
-               /* If using preemption, also force a context switch. */\r
-               portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;\r
-       }\r
-       #endif\r
-\r
        /* Only reset the systick load register if configUSE_TICKLESS_IDLE is set to\r
        1.  If it is set to 0 tickless idle is not being used.  If it is set to a\r
        value other than 0 or 1 then a timer other than the SysTick is being used\r
@@ -405,7 +398,11 @@ void xPortSysTickHandler( void )
 \r
        ( void ) portSET_INTERRUPT_MASK_FROM_ISR();\r
        {\r
-               vTaskIncrementTick();\r
+               if( xTaskIncrementTick() != pdFALSE )\r
+               {\r
+                       /* Pend a context switch. */\r
+                       portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;\r
+               }\r
        }\r
        portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 );\r
 }\r
index 7026dff16d36a53268c20026917bacf77397bc99..06edb0e799f1664174261a1b3b51ba4d4e21f2e0 100644 (file)
@@ -350,17 +350,13 @@ void prvTickISR( void )
        necessitates. */\r
        set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );\r
        {\r
-               vTaskIncrementTick();\r
+               if( xTaskIncrementTick() != pdFALSE )\r
+               {\r
+                       taskYIELD();\r
+               }\r
        }\r
        set_ipl( configKERNEL_INTERRUPT_PRIORITY );\r
 \r
-       /* Only select a new task if the preemptive scheduler is being used. */\r
-       #if( configUSE_PREEMPTION == 1 )\r
-       {\r
-               taskYIELD();\r
-       }\r
-       #endif\r
-\r
        #if configUSE_TICKLESS_IDLE == 1\r
        {\r
                /* The CPU woke because of a tick. */\r
index e276426e48cb4be0672872faefbd1228f398d234..896f1ae73b28874ec9d2cc6d48d4c16357df9a10 100644 (file)
@@ -267,16 +267,12 @@ void vTickISR( void )
        necessitates. */\r
        set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );\r
        {\r
-               vTaskIncrementTick();\r
+               if( xTaskIncrementTick() != pdFALSE )\r
+               {\r
+                       taskYIELD();\r
+               }\r
        }\r
        set_ipl( configKERNEL_INTERRUPT_PRIORITY );\r
-       \r
-       /* Only select a new task if the preemptive scheduler is being used. */\r
-       #if( configUSE_PREEMPTION == 1 )\r
-       {\r
-               taskYIELD();\r
-       }\r
-       #endif\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
index 2a0c2bff5f3232d41d87ecd2444319a0400c907b..cb8792633ee7b64d499f4fafa6111f497df318b4 100644 (file)
@@ -268,14 +268,12 @@ void vTickISR( void )
        necessitates. */\r
        set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );\r
        {\r
-               vTaskIncrementTick();\r
+               if( xTaskIncrementTick() != pdFALSE )\r
+               {\r
+                       taskYIELD();\r
+               }\r
        }\r
        set_ipl( configKERNEL_INTERRUPT_PRIORITY );\r
-\r
-       /* Only select a new task if the preemptive scheduler is being used. */\r
-       #if( configUSE_PREEMPTION == 1 )\r
-               taskYIELD();\r
-       #endif\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
index 1114101622d517f21c4d820da602eed18c8b63b5..33933e6612419d339723f11d56a7069efb201d8e 100644 (file)
@@ -53,7 +53,7 @@
 \r
        .import _pxCurrentTCB\r
        .import _vTaskSwitchContext\r
-       .import _vTaskIncrementTick\r
+       .import _xTaskIncrementTick\r
 \r
        .export _vPortStartFirstTask\r
        .export _ulPortGetGBR\r
@@ -89,7 +89,7 @@ _vPortPreemptiveTick
 \r
        portSAVE_CONTEXT\r
        \r
-       mov.l   #_vTaskIncrementTick, r0\r
+       mov.l   #_xTaskIncrementTick, r0\r
        jsr             @r0\r
        nop\r
 \r
@@ -105,7 +105,7 @@ _vPortCooperativeTick
 \r
        portSAVE_CONTEXT\r
        \r
-       mov.l   #_vTaskIncrementTick, r0\r
+       mov.l   #_xTaskIncrementTick, r0\r
        jsr             @r0\r
        nop\r
 \r
index 1d27d00c1b6ff86be88e990a2e4e740f9355cdd7..85c9421ac5ebfce6e734990865e3cd9778163dbc 100644 (file)
@@ -89,7 +89,7 @@
 _vTickISR:\r
                portSAVE_CONTEXT\r
                                \r
-               call    #_vTaskIncrementTick\r
+               call    #_xTaskIncrementTick\r
 \r
                #if configUSE_PREEMPTION == 1\r
                        call    #_vTaskSwitchContext\r
index eecf4969ed86f5829448dd71ff7dd0b954e93904..d087f4a7833c4b88585d2bc0facd1fabd6691ade 100644 (file)
@@ -405,8 +405,10 @@ void vPortYield( void ) _naked
                portSAVE_CONTEXT();\r
                portCOPY_STACK_TO_XRAM();\r
 \r
-               vTaskIncrementTick();\r
-               vTaskSwitchContext();\r
+               if( xTaskIncrementTick() != pdFALSE )\r
+               {\r
+                       vTaskSwitchContext();\r
+               }\r
                \r
                portCLEAR_INTERRUPT_FLAG();\r
                portCOPY_XRAM_TO_STACK();\r
@@ -418,7 +420,7 @@ void vPortYield( void ) _naked
                /* When using the cooperative scheduler the timer 2 ISR is only \r
                required to increment the RTOS tick count. */\r
 \r
-               vTaskIncrementTick();\r
+               xTaskIncrementTick();\r
                portCLEAR_INTERRUPT_FLAG();\r
        }\r
 #endif\r
index c4163cc791b284e886cbcab338651301d8a03bae..12cef3d7bfc9e078d86f0821b61ab4d9cf73bbea 100644 (file)
@@ -292,7 +292,7 @@ const unsigned short usReloadValue = ( unsigned short ) ( ( ( configPER_CLOCK_HZ
        LDI #_tmcsr0, R0\r
        AND R1,@R0                                                              ;Clear RLT0 interrupt flag\r
 \r
-       CALL32   _vTaskIncrementTick,R12                ;Increment Tick\r
+       CALL32   _xTaskIncrementTick,R12                ;Increment Tick\r
        CALL32   _vTaskSwitchContext,R12                ;Switch context if required\r
 \r
        ANDCCR #0xEF                                                    ;Disable Interrupts\r
@@ -314,7 +314,7 @@ const unsigned short usReloadValue = ( unsigned short ) ( ( ( configPER_CLOCK_HZ
        {\r
                /* Clear RLT0 interrupt flag */\r
                TMCSR0_UF = 0; \r
-               vTaskIncrementTick();\r
+               xTaskIncrementTick();\r
        }\r
 \r
 #endif\r
index 852d2c1ddd9d851382971f7bcdb0e03856309cea..f902514fff9f51bf2fa7b885a50ced31ad24879d 100644 (file)
@@ -474,8 +474,10 @@ void vPortEndScheduler( void )
                \r
                /* Increment the tick count then switch to the highest priority task\r
                that is ready to run. */\r
-               vTaskIncrementTick();\r
-               vTaskSwitchContext();\r
+               if( xTaskIncrementTick() != pdFALSE )\r
+               {\r
+                       vTaskSwitchContext();\r
+               }\r
 \r
                /* Disable interrupts so that portRESTORE_CONTEXT() is not interrupted */\r
                __DI();\r
@@ -499,7 +501,7 @@ void vPortEndScheduler( void )
                /* Clear RLT0 interrupt flag */\r
                TMCSR0_UF = 0;  \r
                \r
-               vTaskIncrementTick();\r
+               xTaskIncrementTick();\r
        }\r
 \r
 #endif\r
index fe4b582b19446820477e5cbc056097c4ff180de2..cdadbe12035bac167e4dd445f0b6ffc89ac0e043 100644 (file)
@@ -237,14 +237,13 @@ void SysTick_Handler( void )
 {\r
 unsigned long ulDummy;\r
 \r
-       /* If using preemption, also force a context switch. */\r
-       #if configUSE_PREEMPTION == 1\r
-               *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;\r
-       #endif\r
-\r
        ulDummy = portSET_INTERRUPT_MASK_FROM_ISR();\r
        {\r
-               vTaskIncrementTick();\r
+               if( xTaskIncrementTick() != pdFALSE )\r
+               {\r
+                       /* Pend a context switch. */\r
+                       *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;\r
+               }\r
        }\r
        portCLEAR_INTERRUPT_MASK_FROM_ISR( ulDummy );\r
 }\r
index 85fc11ee477160dd514b81fa0c3c31be9846f0d5..9dabd621ac99a7fcc2d1f03047c7a8f47eae3b2e 100644 (file)
@@ -109,9 +109,7 @@ Changes from V3.0.1
                /*\r
                 * Maintain the tick count.\r
                 */\r
-               vTaskIncrementTick();\r
-               \r
-               #if configUSE_PREEMPTION == 1\r
+               if( xTaskIncrementTick() != pdFALSE )\r
                {\r
                        /*\r
                         * Ask for a switch to the highest priority task\r
@@ -119,7 +117,6 @@ Changes from V3.0.1
                         */\r
                        uxSwitchRequested = pdTRUE;\r
                }\r
-               #endif\r
        }\r
 }\r
 \r
index 33b5844c818b69ca7cacc49bf64ce9d72b1ef3a1..051aaaf82dd4422814e4562eee02a6f03a01b94a 100644 (file)
@@ -197,10 +197,11 @@ kernel is being used. */
        static void __interrupt __far prvPreemptiveTick( void )\r
        {\r
                /* Get the scheduler to update the task states following the tick. */\r
-               vTaskIncrementTick();\r
-\r
-               /* Switch in the context of the next task to be run. */\r
-               portSWITCH_CONTEXT();\r
+               if( xTaskIncrementTick() != pdFALSE )\r
+               {\r
+                       /* Switch in the context of the next task to be run. */\r
+                       portSWITCH_CONTEXT();\r
+               }\r
 \r
                /* Reset the PIC ready for the next time. */\r
                portRESET_PIC();\r
@@ -210,7 +211,7 @@ kernel is being used. */
        {\r
                /* Same as preemptive tick, but the cooperative scheduler is being used\r
                so we don't have to switch in the context of the next task. */\r
-               vTaskIncrementTick();\r
+               xTaskIncrementTick();\r
                portRESET_PIC();\r
        }\r
 #endif\r
index 930981c6ad217eefd36f916690b0dd4508e086aa..d6557ef2c497229212194229b5f7ff9618efdecc 100644 (file)
@@ -228,10 +228,11 @@ is being used. */
        static void __interrupt __far prvPreemptiveTick( void )\r
        {\r
                /* Get the scheduler to update the task states following the tick. */\r
-               vTaskIncrementTick();\r
-\r
-               /* Switch in the context of the next task to be run. */\r
-               portSWITCH_CONTEXT();\r
+               if( xTaskIncrementTick() != pdFALSE )\r
+               {\r
+                       /* Switch in the context of the next task to be run. */\r
+                       portSWITCH_CONTEXT();\r
+               }\r
 \r
                /* Reset the PIC ready for the next time. */\r
                prvPortResetPIC();\r
@@ -241,7 +242,7 @@ is being used. */
        {\r
                /* Same as preemptive tick, but the cooperative scheduler is being used\r
                so we don't have to switch in the context of the next task. */\r
-               vTaskIncrementTick();\r
+               xTaskIncrementTick();\r
                prvPortResetPIC();\r
        }\r
 #endif\r