From: richardbarry Date: Wed, 16 Jul 2008 09:10:01 +0000 (+0000) Subject: Allow the static qualifier to be removed and rename a list so it does not then clash... X-Git-Tag: V5.0.3~22 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0b11187549d635a10a62bc735e8e61e9333f3506;p=freertos Allow the static qualifier to be removed and rename a list so it does not then clash with the name used in tasks.c once the static has been removed. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@405 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Source/croutine.c b/Source/croutine.c index 3d342d401..ba6d86758 100644 --- a/Source/croutine.c +++ b/Source/croutine.c @@ -51,18 +51,27 @@ #include "task.h" #include "croutine.h" +/* + * Some kernel aware debuggers require data to be viewed to be global, rather + * than file scope. + */ +#ifdef portREMOVE_STATIC_QUALIFIER + #define static +#endif + + /* Lists for ready and blocked co-routines. --------------------*/ static xList pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */ static xList xDelayedCoRoutineList1; /*< Delayed co-routines. */ static xList xDelayedCoRoutineList2; /*< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */ static xList * pxDelayedCoRoutineList; /*< Points to the delayed co-routine list currently being used. */ static xList * pxOverflowDelayedCoRoutineList; /*< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */ -static xList xPendingReadyList; /*< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */ +static xList xPendingReadyCoRoutineList; /*< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */ /* Other file private variables. --------------------------------*/ corCRCB * pxCurrentCoRoutine = NULL; static unsigned portBASE_TYPE uxTopCoRoutineReadyPriority = 0; -static portTickType xCoRoutineTickCount = 0; +static portTickType xCoRoutineTickCount = 0, xLastTickCount = 0, xPassedTicks = 0; /* The initial state of the co-routine when it is created. */ #define corINITIAL_STATE ( 0 ) @@ -209,14 +218,14 @@ static void prvCheckPendingReadyList( void ) /* Are there any co-routines waiting to get moved to the ready list? These are co-routines that have been readied by an ISR. The ISR cannot access the ready lists itself. */ - while( !listLIST_IS_EMPTY( &xPendingReadyList ) ) + while( !listLIST_IS_EMPTY( &xPendingReadyCoRoutineList ) ) { corCRCB *pxUnblockedCRCB; /* The pending ready list can be accessed by an ISR. */ portDISABLE_INTERRUPTS(); { - pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( (&xPendingReadyList) ); + pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( (&xPendingReadyCoRoutineList) ); vListRemove( &( pxUnblockedCRCB->xEventListItem ) ); } portENABLE_INTERRUPTS(); @@ -229,7 +238,6 @@ static void prvCheckPendingReadyList( void ) static void prvCheckDelayedList( void ) { -static portTickType xLastTickCount, xPassedTicks; corCRCB *pxCRCB; xPassedTicks = xTaskGetTickCount() - xLastTickCount; @@ -325,7 +333,7 @@ unsigned portBASE_TYPE uxPriority; vListInitialise( ( xList * ) &xDelayedCoRoutineList1 ); vListInitialise( ( xList * ) &xDelayedCoRoutineList2 ); - vListInitialise( ( xList * ) &xPendingReadyList ); + vListInitialise( ( xList * ) &xPendingReadyCoRoutineList ); /* Start with pxDelayedCoRoutineList using list1 and the pxOverflowDelayedCoRoutineList using list2. */ @@ -343,7 +351,7 @@ signed portBASE_TYPE xReturn; event lists and the pending ready list. */ pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList ); vListRemove( &( pxUnblockedCRCB->xEventListItem ) ); - vListInsertEnd( ( xList * ) &( xPendingReadyList ), &( pxUnblockedCRCB->xEventListItem ) ); + vListInsertEnd( ( xList * ) &( xPendingReadyCoRoutineList ), &( pxUnblockedCRCB->xEventListItem ) ); if( pxUnblockedCRCB->uxPriority >= pxCurrentCoRoutine->uxPriority ) {