#include "task.h"\r
#include "croutine.h"\r
\r
+/*\r
+ * Some kernel aware debuggers require data to be viewed to be global, rather\r
+ * than file scope.\r
+ */\r
+#ifdef portREMOVE_STATIC_QUALIFIER\r
+ #define static\r
+#endif\r
+\r
+\r
/* Lists for ready and blocked co-routines. --------------------*/\r
static xList pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */\r
static xList xDelayedCoRoutineList1; /*< Delayed co-routines. */\r
static xList xDelayedCoRoutineList2; /*< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */\r
static xList * pxDelayedCoRoutineList; /*< Points to the delayed co-routine list currently being used. */\r
static xList * pxOverflowDelayedCoRoutineList; /*< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */\r
-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. */\r
+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. */\r
\r
/* Other file private variables. --------------------------------*/\r
corCRCB * pxCurrentCoRoutine = NULL;\r
static unsigned portBASE_TYPE uxTopCoRoutineReadyPriority = 0;\r
-static portTickType xCoRoutineTickCount = 0;\r
+static portTickType xCoRoutineTickCount = 0, xLastTickCount = 0, xPassedTicks = 0;\r
\r
/* The initial state of the co-routine when it is created. */\r
#define corINITIAL_STATE ( 0 )\r
/* Are there any co-routines waiting to get moved to the ready list? These\r
are co-routines that have been readied by an ISR. The ISR cannot access\r
the ready lists itself. */\r
- while( !listLIST_IS_EMPTY( &xPendingReadyList ) )\r
+ while( !listLIST_IS_EMPTY( &xPendingReadyCoRoutineList ) )\r
{\r
corCRCB *pxUnblockedCRCB;\r
\r
/* The pending ready list can be accessed by an ISR. */\r
portDISABLE_INTERRUPTS();\r
{ \r
- pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( (&xPendingReadyList) ); \r
+ pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( (&xPendingReadyCoRoutineList) ); \r
vListRemove( &( pxUnblockedCRCB->xEventListItem ) );\r
}\r
portENABLE_INTERRUPTS();\r
\r
static void prvCheckDelayedList( void )\r
{\r
-static portTickType xLastTickCount, xPassedTicks;\r
corCRCB *pxCRCB;\r
\r
xPassedTicks = xTaskGetTickCount() - xLastTickCount;\r
\r
vListInitialise( ( xList * ) &xDelayedCoRoutineList1 );\r
vListInitialise( ( xList * ) &xDelayedCoRoutineList2 );\r
- vListInitialise( ( xList * ) &xPendingReadyList );\r
+ vListInitialise( ( xList * ) &xPendingReadyCoRoutineList );\r
\r
/* Start with pxDelayedCoRoutineList using list1 and the\r
pxOverflowDelayedCoRoutineList using list2. */\r
event lists and the pending ready list. */\r
pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList );\r
vListRemove( &( pxUnblockedCRCB->xEventListItem ) );\r
- vListInsertEnd( ( xList * ) &( xPendingReadyList ), &( pxUnblockedCRCB->xEventListItem ) );\r
+ vListInsertEnd( ( xList * ) &( xPendingReadyCoRoutineList ), &( pxUnblockedCRCB->xEventListItem ) );\r
\r
if( pxUnblockedCRCB->uxPriority >= pxCurrentCoRoutine->uxPriority )\r
{\r