mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 05:21:59 -04:00
Convert mpre ports to use xTaskIncrementTick() in place of vTaskIncrementTick().
This commit is contained in:
parent
686d190798
commit
15ec6c87f7
|
@ -348,8 +348,10 @@ static void prvSetupTimerInterrupt( void )
|
|||
|
||||
/* Increment the tick count then switch to the highest priority task
|
||||
that is ready to run. */
|
||||
vTaskIncrementTick();
|
||||
vTaskSwitchContext();
|
||||
if( xTaskIncrementTick() != pdFALSE )
|
||||
{
|
||||
vTaskSwitchContext();
|
||||
}
|
||||
|
||||
/* Restore the context of the new task. */
|
||||
portRESTORE_CONTEXT();
|
||||
|
@ -365,7 +367,7 @@ static void prvSetupTimerInterrupt( void )
|
|||
interrupt (TIMERA0_VECTOR) prvTickISR( void );
|
||||
interrupt (TIMERA0_VECTOR) prvTickISR( void )
|
||||
{
|
||||
vTaskIncrementTick();
|
||||
xTaskIncrementTick();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -204,14 +204,12 @@ void prvSetupTimerInterrupt( void )
|
|||
|
||||
void vPortSysTickHandler( void * context, alt_u32 id )
|
||||
{
|
||||
/* Increment the Kernel Tick. */
|
||||
vTaskIncrementTick();
|
||||
|
||||
/* If using preemption, also force a context switch. */
|
||||
#if configUSE_PREEMPTION == 1
|
||||
/* Increment the kernel tick. */
|
||||
if( xTaskIncrementTick() != pdFALSE )
|
||||
{
|
||||
vTaskSwitchContext();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/* Clear the interrupt. */
|
||||
IOWR_ALTERA_AVALON_TIMER_STATUS( SYS_CLK_BASE, ~ALTERA_AVALON_TIMER_STATUS_TO_MSK );
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
|
||||
.extern pxCurrentTCB
|
||||
.extern vTaskSwitchContext
|
||||
.extern vTaskIncrementTick
|
||||
.extern xTaskIncrementTick
|
||||
.extern vPortISRHandler
|
||||
|
||||
.global vPortStartFirstTask
|
||||
|
@ -203,7 +203,7 @@ vPortYield:
|
|||
vPortTickISR:
|
||||
|
||||
portSAVE_STACK_POINTER_AND_LR
|
||||
bl vTaskIncrementTick
|
||||
bl xTaskIncrementTick
|
||||
|
||||
#if configUSE_PREEMPTION == 1
|
||||
bl vTaskSwitchContext
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
|
||||
.extern pxCurrentTCB
|
||||
.extern vTaskSwitchContext
|
||||
.extern vTaskIncrementTick
|
||||
.extern xTaskIncrementTick
|
||||
.extern vPortISRHandler
|
||||
|
||||
.global vPortStartFirstTask
|
||||
|
@ -203,7 +203,7 @@ vPortYield:
|
|||
vPortTickISR:
|
||||
|
||||
portSAVE_STACK_POINTER_AND_LR
|
||||
bl vTaskIncrementTick
|
||||
bl xTaskIncrementTick
|
||||
|
||||
#if configUSE_PREEMPTION == 1
|
||||
bl vTaskSwitchContext
|
||||
|
|
|
@ -111,7 +111,7 @@ CMT. */
|
|||
#endif
|
||||
|
||||
/* These macros allow a critical section to be added around the call to
|
||||
vTaskIncrementTick(), which is only ever called from interrupts at the kernel
|
||||
xTaskIncrementTick(), which is only ever called from interrupts at the kernel
|
||||
priority - ie a known priority. Therefore these local macros are a slight
|
||||
optimisation compared to calling the global SET/CLEAR_INTERRUPT_MASK macros,
|
||||
which would require the old IPL to be read first and stored in a local variable. */
|
||||
|
@ -439,15 +439,13 @@ void vPortTickISR( void )
|
|||
necessitates. Ensure IPL is at the max syscall value first. */
|
||||
portDISABLE_INTERRUPTS_FROM_KERNEL_ISR();
|
||||
{
|
||||
vTaskIncrementTick();
|
||||
if( xTaskIncrementTick() != pdFALSE )
|
||||
{
|
||||
taskYIELD();
|
||||
}
|
||||
}
|
||||
portENABLE_INTERRUPTS_FROM_KERNEL_ISR();
|
||||
|
||||
/* Only select a new task if the preemptive scheduler is being used. */
|
||||
#if( configUSE_PREEMPTION == 1 )
|
||||
taskYIELD();
|
||||
#endif
|
||||
|
||||
#if configUSE_TICKLESS_IDLE == 1
|
||||
{
|
||||
/* The CPU woke because of a tick. */
|
||||
|
|
|
@ -94,7 +94,7 @@ PSW is set with U and I set, and PM and IPL clear. */
|
|||
#define portINITIAL_FPSW ( ( portSTACK_TYPE ) 0x00000100 )
|
||||
|
||||
/* These macros allow a critical section to be added around the call to
|
||||
vTaskIncrementTick(), which is only ever called from interrupts at the kernel
|
||||
xTaskIncrementTick(), which is only ever called from interrupts at the kernel
|
||||
priority - ie a known priority. Therefore these local macros are a slight
|
||||
optimisation compared to calling the global SET/CLEAR_INTERRUPT_MASK macros,
|
||||
which would require the old IPL to be read first and stored in a local variable. */
|
||||
|
@ -364,14 +364,12 @@ void vTickISR( void )
|
|||
necessitates. Ensure IPL is at the max syscall value first. */
|
||||
portDISABLE_INTERRUPTS_FROM_KERNEL_ISR();
|
||||
{
|
||||
vTaskIncrementTick();
|
||||
if( TaskIncrementTick() != pdFALSE )
|
||||
{
|
||||
taskYIELD();
|
||||
}
|
||||
}
|
||||
portENABLE_INTERRUPTS_FROM_KERNEL_ISR();
|
||||
|
||||
/* Only select a new task if the preemptive scheduler is being used. */
|
||||
#if( configUSE_PREEMPTION == 1 )
|
||||
taskYIELD();
|
||||
#endif
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
|
@ -137,11 +137,10 @@ void vPortTickISR( void )
|
|||
{
|
||||
/* Increment the RTOS tick count, then look for the highest priority
|
||||
task that is ready to run. */
|
||||
vTaskIncrementTick();
|
||||
|
||||
#if configUSE_PREEMPTION == 1
|
||||
if( xTaskIncrementTick() != pdFALSE )
|
||||
{
|
||||
vTaskSwitchContext();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Ready for the next interrupt. */
|
||||
TB_ClearITPendingBit( TB_IT_Update );
|
||||
|
|
|
@ -335,6 +335,7 @@ unsigned long ulSavedInterruptMask;
|
|||
unsigned long *pxUpperCSA = NULL;
|
||||
unsigned long xUpperCSA = 0UL;
|
||||
extern volatile unsigned long *pxCurrentTCB;
|
||||
long lYieldRequired;
|
||||
|
||||
/* Just to avoid compiler warnings about unused parameters. */
|
||||
( void ) iArg;
|
||||
|
@ -365,11 +366,11 @@ extern volatile unsigned long *pxCurrentTCB;
|
|||
ulSavedInterruptMask = portSET_INTERRUPT_MASK_FROM_ISR();
|
||||
{
|
||||
/* Increment the Tick. */
|
||||
vTaskIncrementTick();
|
||||
lYieldRequired = xTaskIncrementTick();
|
||||
}
|
||||
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulSavedInterruptMask );
|
||||
|
||||
#if configUSE_PREEMPTION == 1
|
||||
if( lYieldRequired != pdFALSE )
|
||||
{
|
||||
/* Save the context of a task.
|
||||
The upper context is automatically saved when entering a trap or interrupt.
|
||||
|
@ -400,7 +401,6 @@ extern volatile unsigned long *pxCurrentTCB;
|
|||
CPU_SRC0.bits.SETR = 0;
|
||||
_isync();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
; Functions used by scheduler
|
||||
;------------------------------------------------------------------------------
|
||||
EXTERN vTaskSwitchContext
|
||||
EXTERN vTaskIncrementTick
|
||||
EXTERN xTaskIncrementTick
|
||||
|
||||
; Tick ISR Prototype
|
||||
;------------------------------------------------------------------------------
|
||||
|
@ -133,7 +133,7 @@ vPortStart:
|
|||
MD_INTTM05:
|
||||
|
||||
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
|
||||
call vTaskSwitchContext ; Call the scheduler to select the next task.
|
||||
#endif
|
||||
|
|
|
@ -210,14 +210,14 @@ void xPortSysTickHandler( void )
|
|||
{
|
||||
unsigned long ulDummy;
|
||||
|
||||
/* If using preemption, also force a context switch. */
|
||||
#if configUSE_PREEMPTION == 1
|
||||
*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
|
||||
#endif
|
||||
|
||||
ulDummy = portSET_INTERRUPT_MASK_FROM_ISR();
|
||||
{
|
||||
vTaskIncrementTick();
|
||||
/* Increment the RTOS tick. */
|
||||
if( xTaskIncrementTick() != pdFALSE )
|
||||
{
|
||||
/* Pend a context switch. */
|
||||
*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
|
||||
}
|
||||
}
|
||||
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulDummy );
|
||||
}
|
||||
|
|
|
@ -275,11 +275,6 @@ void vPortExitCritical( void )
|
|||
|
||||
void xPortSysTickHandler( void )
|
||||
{
|
||||
/* If using preemption, also force a context switch. */
|
||||
#if configUSE_PREEMPTION == 1
|
||||
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
|
||||
#endif
|
||||
|
||||
/* Only reset the systick load register if configUSE_TICKLESS_IDLE is set to
|
||||
1. If it is set to 0 tickless idle is not being used. If it is set to a
|
||||
value other than 0 or 1 then a timer other than the SysTick is being used
|
||||
|
@ -290,7 +285,12 @@ void xPortSysTickHandler( void )
|
|||
|
||||
( void ) portSET_INTERRUPT_MASK_FROM_ISR();
|
||||
{
|
||||
vTaskIncrementTick();
|
||||
/* Increment the RTOS tick. */
|
||||
if( xTaskIncrementTick() != pdFALSE )
|
||||
{
|
||||
/* Pend a context switch. */
|
||||
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
|
||||
}
|
||||
}
|
||||
portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue