]> git.sur5r.net Git - freertos/commitdiff
Allow the static qualifier to be removed and rename a list so it does not then clash...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 16 Jul 2008 09:10:01 +0000 (09:10 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 16 Jul 2008 09:10:01 +0000 (09:10 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@405 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/croutine.c

index 3d342d4010ba07ed654cfc64304396843772f9ef..ba6d867580e729a546157950f8b0bc362a94e4b9 100644 (file)
 #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
@@ -209,14 +218,14 @@ static void prvCheckPendingReadyList( void )
        /* 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
@@ -229,7 +238,6 @@ static void prvCheckPendingReadyList( void )
 \r
 static void prvCheckDelayedList( void )\r
 {\r
-static portTickType xLastTickCount, xPassedTicks;\r
 corCRCB *pxCRCB;\r
 \r
        xPassedTicks = xTaskGetTickCount() - xLastTickCount;\r
@@ -325,7 +333,7 @@ unsigned portBASE_TYPE uxPriority;
 \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
@@ -343,7 +351,7 @@ signed portBASE_TYPE xReturn;
        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