Re-jig some of the new functions to correctly assign them public or private linkage, and remove some functions that were added in but never used.

This commit is contained in:
Richard Barry 2012-10-22 16:40:45 +00:00
parent f06a945444
commit f5c52bdb1d
16 changed files with 68 additions and 73 deletions

View File

@ -534,12 +534,12 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )
#endif #endif
#ifndef portPRE_SLEEP_PROCESSING #ifndef configPRE_SLEEP_PROCESSING
#define portPRE_SLEEP_PROCESSING() #define configPRE_SLEEP_PROCESSING()
#endif #endif
#ifndef portPOST_SLEEP_PROCESSING #ifndef configPOST_SLEEP_PROCESSING
#define portPOST_SLEEP_PROCESSING() #define configPOST_SLEEP_PROCESSING()
#endif #endif
#endif /* INC_FREERTOS_H */ #endif /* INC_FREERTOS_H */

View File

@ -1320,12 +1320,6 @@ unsigned portBASE_TYPE uxTaskGetTaskNumber( xTaskHandle xTask );
*/ */
void vTaskSetTaskNumber( xTaskHandle xTask, unsigned portBASE_TYPE uxHandle ); void vTaskSetTaskNumber( xTaskHandle xTask, unsigned portBASE_TYPE uxHandle );
/*
* Return the amount of time, in ticks, that will pass before the kernel will
* next move a task from the Blocked state to the Running state.
*/
portTickType xTaskGetExpectedIdleTime( void );
/* /*
* If tickless mode is being used, or a low power mode is implemented, then * If tickless mode is being used, or a low power mode is implemented, then
* the tick interrupt will not execute during idle periods. When this is the * the tick interrupt will not execute during idle periods. When this is the
@ -1335,13 +1329,6 @@ portTickType xTaskGetExpectedIdleTime( void );
*/ */
void vTaskStepTick( portTickType xTicksToJump ); void vTaskStepTick( portTickType xTicksToJump );
/*
* Returns the number of tick interrupts that have occurred while the scheduler
* has been suspended. The count pending ticks is reset if xResetOnExit is set
* to pdTRUE.
*/
unsigned portBASE_TYPE uxTaskPendingTicksGet( portBASE_TYPE xResetOnExit );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -146,7 +146,7 @@ portRESTORE_CONTEXT .macro
; Get the SPSR from the stack. ; Get the SPSR from the stack.
LDMFD LR!, {R0} LDMFD LR!, {R0}
MSR SPSR_CF, R0 MSR SPSR_CSXF, R0
; Restore all system mode registers for the task. ; Restore all system mode registers for the task.
LDMFD LR, {R0-R14}^ LDMFD LR, {R0-R14}^

View File

@ -403,9 +403,9 @@ void xPortSysTickHandler( void )
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT; portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;
/* Sleep until something happens. */ /* Sleep until something happens. */
portPRE_SLEEP_PROCESSING(); configPRE_SLEEP_PROCESSING();
__asm volatile( "wfi" ); __asm volatile( "wfi" );
portPOST_SLEEP_PROCESSING(); configPOST_SLEEP_PROCESSING();
/* Stop SysTick. Again, the time the SysTick is stopped for is /* Stop SysTick. Again, the time the SysTick is stopped for is
accounted for as best it can be, but using the tickless mode will accounted for as best it can be, but using the tickless mode will

View File

@ -136,8 +136,10 @@ not necessary for to use this port. They are defined so the common demo files
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Tickless idle/low power functionality. */ /* Tickless idle/low power functionality. */
extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime ); #ifndef portSUPPRESS_TICKS_AND_SLEEP
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime ) extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
#endif
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Architecture specific optimisations. */ /* Architecture specific optimisations. */

View File

@ -438,9 +438,9 @@ void xPortSysTickHandler( void )
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT; portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;
/* Sleep until something happens. */ /* Sleep until something happens. */
portPRE_SLEEP_PROCESSING(); configPRE_SLEEP_PROCESSING();
__asm volatile( "wfi" ); __asm volatile( "wfi" );
portPOST_SLEEP_PROCESSING(); configPOST_SLEEP_PROCESSING();
/* Stop SysTick. Again, the time the SysTick is stopped for is /* Stop SysTick. Again, the time the SysTick is stopped for is
accounted for as best it can be, but using the tickless mode will accounted for as best it can be, but using the tickless mode will

View File

@ -143,8 +143,10 @@ not necessary for to use this port. They are defined so the common demo files
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Tickless idle/low power functionality. */ /* Tickless idle/low power functionality. */
extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime ); #ifndef portSUPPRESS_TICKS_AND_SLEEP
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime ) extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
#endif
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Architecture specific optimisations. */ /* Architecture specific optimisations. */

View File

@ -300,9 +300,9 @@ void xPortSysTickHandler( void )
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT; portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;
/* Sleep until something happens. */ /* Sleep until something happens. */
portPRE_SLEEP_PROCESSING(); configPRE_SLEEP_PROCESSING();
__WFI(); __WFI();
portPOST_SLEEP_PROCESSING(); configPOST_SLEEP_PROCESSING();
/* Stop SysTick. Again, the time the SysTick is stopped for is /* Stop SysTick. Again, the time the SysTick is stopped for is
accounted for as best it can be, but using the tickless mode will accounted for as best it can be, but using the tickless mode will

View File

@ -148,9 +148,11 @@ extern void vPortClearInterruptMask( unsigned long ulNewMask );
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortClearInterruptMask( x ) #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortClearInterruptMask( x )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Tickless/low power functionality. */ /* Tickless idle/low power functionality. */
extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime ); #ifndef portSUPPRESS_TICKS_AND_SLEEP
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime ) extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
#endif
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Task function macros as described on the FreeRTOS.org WEB site. These are /* Task function macros as described on the FreeRTOS.org WEB site. These are

View File

@ -325,9 +325,9 @@ void xPortSysTickHandler( void )
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT; portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;
/* Sleep until something happens. */ /* Sleep until something happens. */
portPRE_SLEEP_PROCESSING(); configPRE_SLEEP_PROCESSING();
__WFI(); __WFI();
portPOST_SLEEP_PROCESSING(); configPOST_SLEEP_PROCESSING();
/* Stop SysTick. Again, the time the SysTick is stopped for is /* Stop SysTick. Again, the time the SysTick is stopped for is
accounted for as best it can be, but using the tickless mode will accounted for as best it can be, but using the tickless mode will

View File

@ -153,9 +153,11 @@ portALIGNMENT_ASSERT_pxCurrentTCB() will trigger false positive asserts. */
#define portALIGNMENT_ASSERT_pxCurrentTCB ( void ) #define portALIGNMENT_ASSERT_pxCurrentTCB ( void )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Tickless/low power functionality. */ /* Tickless idle/low power functionality. */
extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime ); #ifndef portSUPPRESS_TICKS_AND_SLEEP
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime ) extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
#endif
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/

View File

@ -368,9 +368,9 @@ void xPortSysTickHandler( void )
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT; portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;
/* Sleep until something happens. */ /* Sleep until something happens. */
portPRE_SLEEP_PROCESSING(); configPRE_SLEEP_PROCESSING();
__wfi(); __wfi();
portPOST_SLEEP_PROCESSING(); configPOST_SLEEP_PROCESSING();
/* Stop SysTick. Again, the time the SysTick is stopped for is /* Stop SysTick. Again, the time the SysTick is stopped for is
accounted for as best it can be, but using the tickless mode will accounted for as best it can be, but using the tickless mode will

View File

@ -129,9 +129,11 @@ extern void vPortExitCritical( void );
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortClearInterruptMask(x) #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortClearInterruptMask(x)
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Tickless/low power optimisations. */ /* Tickless idle/low power functionality. */
extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime ); #ifndef portSUPPRESS_TICKS_AND_SLEEP
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime ) extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
#endif
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Port specific optimisations. */ /* Port specific optimisations. */

View File

@ -431,9 +431,9 @@ void xPortSysTickHandler( void )
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT; portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;
/* Sleep until something happens. */ /* Sleep until something happens. */
portPRE_SLEEP_PROCESSING(); configPRE_SLEEP_PROCESSING();
__wfi(); __wfi();
portPOST_SLEEP_PROCESSING(); configPOST_SLEEP_PROCESSING();
/* Stop SysTick. Again, the time the SysTick is stopped for is /* Stop SysTick. Again, the time the SysTick is stopped for is
accounted for as best it can be, but using the tickless mode will accounted for as best it can be, but using the tickless mode will

View File

@ -135,9 +135,11 @@ portALIGNMENT_ASSERT_pxCurrentTCB() will trigger false positive asserts. */
#define portALIGNMENT_ASSERT_pxCurrentTCB ( void ) #define portALIGNMENT_ASSERT_pxCurrentTCB ( void )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Tickless/low power optimisations. */ /* Tickless idle/low power functionality. */
extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime ); #ifndef portSUPPRESS_TICKS_AND_SLEEP
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime ) extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
#endif
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Port specific optimisations. */ /* Port specific optimisations. */

View File

@ -460,6 +460,15 @@ static tskTCB *prvAllocateTCBAndStack( unsigned short usStackDepth, portSTACK_TY
#endif #endif
/*
* Return the amount of time, in ticks, that will pass before the kernel will
* next move a task from the Blocked state to the Running state.
*/
#if ( configUSE_TICKLESS_IDLE == 1 )
static portTickType prvGetExpectedIdleTime( void ) PRIVILEGED_FUNCTION;
#endif
/*lint +e956 */ /*lint +e956 */
@ -1305,7 +1314,7 @@ void vTaskSuspendAll( void )
} }
/*----------------------------------------------------------*/ /*----------------------------------------------------------*/
portTickType xTaskGetExpectedIdleTime( void ) portTickType prvGetExpectedIdleTime( void )
{ {
portTickType xReturn; portTickType xReturn;
@ -1618,11 +1627,15 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
#endif #endif
/*----------------------------------------------------------*/ /*----------------------------------------------------------*/
void vTaskStepTick( portTickType xTicksToJump ) #if ( configUSE_TICKLESS_IDLE == 1 )
{
configASSERT( xTicksToJump <= xNextTaskUnblockTime ); void vTaskStepTick( portTickType xTicksToJump )
xTickCount += xTicksToJump; {
} configASSERT( xTicksToJump <= xNextTaskUnblockTime );
xTickCount += xTicksToJump;
}
#endif
/*----------------------------------------------------------- /*-----------------------------------------------------------
* SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES * SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES
@ -1917,6 +1930,8 @@ portTickType xTimeToWake;
/* Calculate the time at which the task should be woken if the event does /* Calculate the time at which the task should be woken if the event does
not occur. This may overflow but this doesn't matter. */ not occur. This may overflow but this doesn't matter. */
xTimeToWake = xTickCount + xTicksToWait; xTimeToWake = xTickCount + xTicksToWait;
traceTASK_DELAY_UNTIL();
prvAddCurrentTaskToDelayedList( xTimeToWake ); prvAddCurrentTaskToDelayedList( xTimeToWake );
} }
@ -2150,7 +2165,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
test of the expected idle time is performed without the test of the expected idle time is performed without the
scheduler suspended. The result here is not necessarily scheduler suspended. The result here is not necessarily
valid. */ valid. */
xExpectedIdleTime = xTaskGetExpectedIdleTime(); xExpectedIdleTime = prvGetExpectedIdleTime();
if( xExpectedIdleTime >= xMinimumExpectedIdleTime ) if( xExpectedIdleTime >= xMinimumExpectedIdleTime )
{ {
@ -2160,7 +2175,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
time can be sampled again, and this time its value can time can be sampled again, and this time its value can
be used. */ be used. */
configASSERT( xNextTaskUnblockTime >= xTickCount ); configASSERT( xNextTaskUnblockTime >= xTickCount );
xExpectedIdleTime = xTaskGetExpectedIdleTime(); xExpectedIdleTime = prvGetExpectedIdleTime();
if( xExpectedIdleTime >= xMinimumExpectedIdleTime ) if( xExpectedIdleTime >= xMinimumExpectedIdleTime )
{ {
@ -2723,25 +2738,6 @@ tskTCB *pxNewTCB;
#endif #endif
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if ( configUSE_TICKLESS_IDLE == 1 )
unsigned portBASE_TYPE uxTaskPendingTicksGet( portBASE_TYPE xResetOnExit )
{
unsigned portBASE_TYPE uxReturn;
uxReturn = uxMissedTicks;
if( xResetOnExit == pdTRUE )
{
uxMissedTicks = 0;
}
return uxReturn;
}
#endif
/*-----------------------------------------------------------*/