Convert more ports to use xTaskIncrementTick() in place of vTaskIncrementTick().

pull/4/head
Richard Barry 12 years ago
parent 15ec6c87f7
commit f904d26957

@ -362,7 +362,7 @@ unsigned char ucHighByte, ucLowByte;
*/ */
__interrupt void SIG_OUTPUT_COMPARE1A( void ) __interrupt void SIG_OUTPUT_COMPARE1A( void )
{ {
vTaskIncrementTick(); xTaskIncrementTick();
} }
#endif #endif
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/

@ -67,7 +67,7 @@ EXTERN SIG_UART_DATA
; --------------------------- ; ---------------------------
EXTERN vTaskSwitchContext EXTERN vTaskSwitchContext
EXTERN pxCurrentTCB EXTERN pxCurrentTCB
EXTERN vTaskIncrementTick EXTERN xTaskIncrementTick
EXTERN uxCriticalNesting EXTERN uxCriticalNesting
; Functions implemented in this file ; Functions implemented in this file
@ -243,7 +243,7 @@ vPortYield:
vPortYieldFromTick: vPortYieldFromTick:
portSAVE_CONTEXT ; Save the context of the current task. portSAVE_CONTEXT ; Save the context of the current task.
call vTaskIncrementTick ; Call the timer tick function. call xTaskIncrementTick ; Call the timer tick function.
call vTaskSwitchContext ; Call the scheduler. call vTaskSwitchContext ; Call the scheduler.
portRESTORE_CONTEXT ; Restore the context of whichever task the ... portRESTORE_CONTEXT ; Restore the context of whichever task the ...
ret ; ... scheduler decided should run. ret ; ... scheduler decided should run.

@ -220,7 +220,7 @@ static void vTick( void )
/* Because FreeRTOS is not supposed to run with nested interrupts, put all OS /* Because FreeRTOS is not supposed to run with nested interrupts, put all OS
calls in a critical section . */ calls in a critical section . */
portENTER_CRITICAL(); portENTER_CRITICAL();
vTaskIncrementTick(); xTaskIncrementTick();
portEXIT_CRITICAL(); portEXIT_CRITICAL();
/* Restore the context of the "elected task". */ /* Restore the context of the "elected task". */

@ -226,7 +226,7 @@ void vPortEndScheduler( void )
/* Increment the tick count - which may wake some tasks but as the /* Increment the tick count - which may wake some tasks but as the
preemptive scheduler is not being used any woken task is not given preemptive scheduler is not being used any woken task is not given
processor time no matter what its priority. */ processor time no matter what its priority. */
vTaskIncrementTick(); xTaskIncrementTick();
/* Clear the PIT interrupt. */ /* Clear the PIT interrupt. */
ulDummy = AT91C_BASE_PITC->PITC_PIVR; ulDummy = AT91C_BASE_PITC->PITC_PIVR;

@ -54,7 +54,7 @@
CODE32 CODE32
EXTERN vTaskSwitchContext EXTERN vTaskSwitchContext
EXTERN vTaskIncrementTick EXTERN xTaskIncrementTick
PUBLIC vPortYieldProcessor PUBLIC vPortYieldProcessor
PUBLIC vPortPreemptiveTick PUBLIC vPortPreemptiveTick
@ -91,7 +91,7 @@ vPortYieldProcessor:
vPortPreemptiveTick: vPortPreemptiveTick:
portSAVE_CONTEXT ; Save the context of the current task. portSAVE_CONTEXT ; Save the context of the current task.
LDR R0, =vTaskIncrementTick ; Increment the tick count - this may wake a task. LDR R0, =xTaskIncrementTick ; Increment the tick count - this may wake a task.
mov lr, pc mov lr, pc
BX R0 BX R0
LDR R0, =vTaskSwitchContext ; Select the next task to execute. LDR R0, =vTaskSwitchContext ; Select the next task to execute.

@ -237,11 +237,10 @@ volatile unsigned long ulDummy;
/* Increment the tick count - which may wake some tasks but as the /* Increment the tick count - which may wake some tasks but as the
preemptive scheduler is not being used any woken task is not given preemptive scheduler is not being used any woken task is not given
processor time no matter what its priority. */ processor time no matter what its priority. */
vTaskIncrementTick(); if( xTaskIncrementTick() != pdFALSE )
{
#if configUSE_PREEMPTION == 1
vTaskSwitchContext(); vTaskSwitchContext();
#endif }
/* Clear the PIT interrupt. */ /* Clear the PIT interrupt. */
ulDummy = AT91C_BASE_PITC->PITC_PIVR; ulDummy = AT91C_BASE_PITC->PITC_PIVR;

@ -244,7 +244,7 @@ void vPortEndScheduler( void )
/* Increment the tick count - which may wake some tasks but as the /* Increment the tick count - which may wake some tasks but as the
preemptive scheduler is not being used any woken task is not given preemptive scheduler is not being used any woken task is not given
processor time no matter what its priority. */ processor time no matter what its priority. */
vTaskIncrementTick(); xTaskIncrementTick();
/* Ready for the next interrupt. */ /* Ready for the next interrupt. */
T0IR = portTIMER_MATCH_ISR_BIT; T0IR = portTIMER_MATCH_ISR_BIT;
@ -259,12 +259,13 @@ void vPortEndScheduler( void )
void vPortPreemptiveTick( void ) void vPortPreemptiveTick( void )
{ {
/* Increment the tick counter. */ /* Increment the tick counter. */
vTaskIncrementTick(); if( xTaskIncrementTick() != pdFALSE )
{
/* The new tick value might unblock a task. Ensure the highest task that /* The new tick value might unblock a task. Ensure the highest task that
is ready to execute is the task that will execute when the tick ISR is ready to execute is the task that will execute when the tick ISR
exits. */ exits. */
vTaskSwitchContext(); vTaskSwitchContext();
}
/* Ready for the next interrupt. */ /* Ready for the next interrupt. */
T0IR = portTIMER_MATCH_ISR_BIT; T0IR = portTIMER_MATCH_ISR_BIT;

@ -54,7 +54,6 @@
CODE32 CODE32
EXTERN vTaskSwitchContext EXTERN vTaskSwitchContext
EXTERN vTaskIncrementTick
EXTERN vPortPreemptiveTick EXTERN vPortPreemptiveTick
PUBLIC vPortPreemptiveTickEntry PUBLIC vPortPreemptiveTickEntry

@ -74,7 +74,7 @@
#include "FreeRTOSConfig.h" #include "FreeRTOSConfig.h"
#include "portasm.h" #include "portasm.h"
IMPORT vTaskIncrementTick IMPORT xTaskIncrementTick
IMPORT vTaskSwitchContext IMPORT vTaskSwitchContext
IMPORT vPortSetupTimerInterrupt IMPORT vPortSetupTimerInterrupt
@ -95,7 +95,7 @@
vTickISR: vTickISR:
portSAVE_CONTEXT portSAVE_CONTEXT
call #vTaskIncrementTick call #xTaskIncrementTick
#if configUSE_PREEMPTION == 1 #if configUSE_PREEMPTION == 1
call #vTaskSwitchContext call #vTaskSwitchContext

@ -75,7 +75,7 @@
#include "FreeRTOSConfig.h" #include "FreeRTOSConfig.h"
#include "data_model.h" #include "data_model.h"
IMPORT vTaskIncrementTick IMPORT xTaskIncrementTick
IMPORT vTaskSwitchContext IMPORT vTaskSwitchContext
IMPORT vPortSetupTimerInterrupt IMPORT vPortSetupTimerInterrupt
IMPORT pxCurrentTCB IMPORT pxCurrentTCB
@ -130,7 +130,7 @@ vPortTickISR:
push.w sr push.w sr
portSAVE_CONTEXT portSAVE_CONTEXT
calla #vTaskIncrementTick calla #xTaskIncrementTick
#if configUSE_PREEMPTION == 1 #if configUSE_PREEMPTION == 1
calla #vTaskSwitchContext calla #vTaskSwitchContext

@ -61,7 +61,7 @@
PUBLIC vPortTickISR PUBLIC vPortTickISR
EXTERN vTaskSwitchContext EXTERN vTaskSwitchContext
EXTERN vTaskIncrementTick EXTERN xTaskIncrementTick
; FreeRTOS yield handler. This is installed as the BRK software interrupt ; FreeRTOS yield handler. This is installed as the BRK software interrupt
; handler. ; handler.
@ -87,7 +87,7 @@ vPortStartFirstTask:
vPortTickISR: vPortTickISR:
portSAVE_CONTEXT ; Save the context of the current task. portSAVE_CONTEXT ; Save the context of the current task.
call vTaskIncrementTick ; Call the timer tick function. call xTaskIncrementTick ; Call the timer tick function.
#if configUSE_PREEMPTION == 1 #if configUSE_PREEMPTION == 1
call vTaskSwitchContext ; Call the scheduler to select the next task. call vTaskSwitchContext ; Call the scheduler to select the next task.
#endif #endif

@ -304,16 +304,12 @@ __interrupt static void prvTickISR( void )
necessitates. */ necessitates. */
__set_interrupt_level( configMAX_SYSCALL_INTERRUPT_PRIORITY ); __set_interrupt_level( configMAX_SYSCALL_INTERRUPT_PRIORITY );
{ {
vTaskIncrementTick(); if( xTaskIncrementTick() != pdFALSE )
}
__set_interrupt_level( configKERNEL_INTERRUPT_PRIORITY );
/* Only select a new task if the preemptive scheduler is being used. */
#if( configUSE_PREEMPTION == 1 )
{ {
taskYIELD(); taskYIELD();
} }
#endif }
__set_interrupt_level( configKERNEL_INTERRUPT_PRIORITY );
#if configUSE_TICKLESS_IDLE == 1 #if configUSE_TICKLESS_IDLE == 1
{ {

@ -225,7 +225,7 @@ __arm __irq void vPortNonPreemptiveTick( void )
/* Increment the tick count - which may wake some tasks but as the /* Increment the tick count - which may wake some tasks but as the
preemptive scheduler is not being used any woken task is not given preemptive scheduler is not being used any woken task is not given
processor time no matter what its priority. */ processor time no matter what its priority. */
vTaskIncrementTick(); xTaskIncrementTick();
/* Clear the interrupt in the watchdog and EIC. */ /* Clear the interrupt in the watchdog and EIC. */
WDG->SR = 0x0000; WDG->SR = 0x0000;
@ -238,12 +238,11 @@ keyword. */
void vPortPreemptiveTick( void ) void vPortPreemptiveTick( void )
{ {
/* Increment the tick counter. */ /* Increment the tick counter. */
vTaskIncrementTick(); if( xTaskIncrementTick() != pdFALSE )
{
/* The new tick value might unblock a task. Ensure the highest task that /* Select a new task to execute. */
is ready to execute is the task that will execute when the tick ISR
exits. */
vTaskSwitchContext(); vTaskSwitchContext();
}
/* Clear the interrupt in the watchdog and EIC. */ /* Clear the interrupt in the watchdog and EIC. */
WDG->SR = 0x0000; WDG->SR = 0x0000;

@ -209,14 +209,11 @@ void vPortEndScheduler( void )
__arm void vPortPreemptiveTick( void ) __arm void vPortPreemptiveTick( void )
{ {
/* Increment the tick counter. */ /* Increment the tick counter. */
vTaskIncrementTick(); if( xTaskIncrementTick() != pdFALSE )
{
/* The new tick value might unblock a task. Ensure the highest task that /* Select a new task to execute. */
is ready to execute is the task that will execute when the tick ISR
exits. */
#if configUSE_PREEMPTION == 1
vTaskSwitchContext(); vTaskSwitchContext();
#endif }
TB_ClearITPendingBit( TB_IT_Update ); TB_ClearITPendingBit( TB_IT_Update );
} }

@ -324,16 +324,11 @@ keyword. */
{ {
{ {
/* Increment the tick counter. */ /* Increment the tick counter. */
vTaskIncrementTick(); if( xTaskIncrementTick() != pdFALSE )
#if configUSE_PREEMPTION == 1
{ {
/* The new tick value might unblock a task. Ensure the highest task that /* Select a new task to execute. */
is ready to execute is the task that will execute when the tick ISR
exits. */
vTaskSwitchContext(); vTaskSwitchContext();
} }
#endif /* configUSE_PREEMPTION. */
/* Clear the interrupt in the watchdog. */ /* Clear the interrupt in the watchdog. */
WDG->SR &= ~0x0001; WDG->SR &= ~0x0001;

@ -57,7 +57,7 @@
; Functions used by scheduler ; Functions used by scheduler
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
EXTERN vTaskSwitchContext EXTERN vTaskSwitchContext
EXTERN vTaskIncrementTick EXTERN xTaskIncrementTick
; Variables used by scheduler ; Variables used by scheduler
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -278,7 +278,7 @@ MD_INTTM0EQ0:
stsr 1,lp stsr 1,lp
st.w lp,0[sp] ; store EIPSW to stack st.w lp,0[sp] ; store EIPSW to stack
portSAVE_CONTEXT ; Save the context of the current task. portSAVE_CONTEXT ; Save the context of the current task.
jarl vTaskIncrementTick,lp ; Call the timer tick function. jarl xTaskIncrementTick,lp ; Call the timer tick function.
jarl vTaskSwitchContext,lp ; Call the scheduler. jarl vTaskSwitchContext,lp ; Call the scheduler.
portRESTORE_CONTEXT ; Restore the context of whichever task the ... portRESTORE_CONTEXT ; Restore the context of whichever task the ...
; ... scheduler decided should run. ; ... scheduler decided should run.
@ -297,7 +297,7 @@ MD_INTTM0EQ0:
prepare {lp,ep},8,sp prepare {lp,ep},8,sp
sst.w r1,4[ep] sst.w r1,4[ep]
sst.w r5,0[ep] sst.w r5,0[ep]
jarl vTaskIncrementTick,lp ; Call the timer tick function. jarl xTaskIncrementTick,lp ; Call the timer tick function.
sld.w 0[ep],r5 sld.w 0[ep],r5
sld.w 4[ep],r1 sld.w 4[ep],r1
dispose 8,{lp,ep} dispose 8,{lp,ep}

@ -57,7 +57,7 @@
; Functions used by scheduler ; Functions used by scheduler
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
EXTERN vTaskSwitchContext EXTERN vTaskSwitchContext
EXTERN vTaskIncrementTick EXTERN xTaskIncrementTick
; Variables used by scheduler ; Variables used by scheduler
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -287,7 +287,7 @@ MD_INTTM0EQ0:
stsr 1,lp stsr 1,lp
st.w lp,0[sp] ; store EIPSW to stack st.w lp,0[sp] ; store EIPSW to stack
portSAVE_CONTEXT ; Save the context of the current task. portSAVE_CONTEXT ; Save the context of the current task.
jarl vTaskIncrementTick,lp ; Call the timer tick function. jarl xTaskIncrementTick,lp ; Call the timer tick function.
jarl vTaskSwitchContext,lp ; Call the scheduler. jarl vTaskSwitchContext,lp ; Call the scheduler.
portRESTORE_CONTEXT ; Restore the context of whichever task the ... portRESTORE_CONTEXT ; Restore the context of whichever task the ...
; ... scheduler decided should run. ; ... scheduler decided should run.
@ -306,7 +306,7 @@ MD_INTTM0EQ0:
prepare {lp,ep},8,sp prepare {lp,ep},8,sp
sst.w r1,4[ep] sst.w r1,4[ep]
sst.w r5,0[ep] sst.w r5,0[ep]
jarl vTaskIncrementTick,lp ; Call the timer tick function. jarl xTaskIncrementTick,lp ; Call the timer tick function.
sld.w 0[ep],r5 sld.w 0[ep],r5
sld.w 4[ep],r1 sld.w 4[ep],r1
dispose 8,{lp,ep} dispose 8,{lp,ep}

@ -57,7 +57,7 @@
; Functions used by scheduler ; Functions used by scheduler
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
EXTERN vTaskSwitchContext EXTERN vTaskSwitchContext
EXTERN vTaskIncrementTick EXTERN xTaskIncrementTick
; Variables used by scheduler ; Variables used by scheduler
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -278,7 +278,7 @@ MD_INTTM0EQ0:
stsr 1,lp stsr 1,lp
st.w lp,0[sp] ; store EIPSW to stack st.w lp,0[sp] ; store EIPSW to stack
portSAVE_CONTEXT ; Save the context of the current task. portSAVE_CONTEXT ; Save the context of the current task.
jarl vTaskIncrementTick,lp ; Call the timer tick function. jarl xTaskIncrementTick,lp ; Call the timer tick function.
jarl vTaskSwitchContext,lp ; Call the scheduler. jarl vTaskSwitchContext,lp ; Call the scheduler.
portRESTORE_CONTEXT ; Restore the context of whichever task the ... portRESTORE_CONTEXT ; Restore the context of whichever task the ...
; ... scheduler decided should run. ; ... scheduler decided should run.
@ -297,7 +297,7 @@ MD_INTTM0EQ0:
prepare {lp,ep},8,sp prepare {lp,ep},8,sp
sst.w r1,4[ep] sst.w r1,4[ep]
sst.w r5,0[ep] sst.w r5,0[ep]
jarl vTaskIncrementTick,lp ; Call the timer tick function. jarl xTaskIncrementTick,lp ; Call the timer tick function.
sld.w 0[ep],r5 sld.w 0[ep],r5
sld.w 4[ep],r1 sld.w 4[ep],r1
dispose 8,{lp,ep} dispose 8,{lp,ep}

Loading…
Cancel
Save