/* We must remove ourselves from the ready list before adding\r
ourselves to the blocked list as the same list item is used for\r
both lists. */\r
- vListRemove( ( xListItem * ) &( pxCurrentCoRoutine->xGenericListItem ) );\r
+ uxListRemove( ( xListItem * ) &( pxCurrentCoRoutine->xGenericListItem ) );\r
\r
/* The list item will be inserted in wake time order. */\r
listSET_LIST_ITEM_VALUE( &( pxCurrentCoRoutine->xGenericListItem ), xTimeToWake );\r
portDISABLE_INTERRUPTS();\r
{ \r
pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( (&xPendingReadyCoRoutineList) ); \r
- vListRemove( &( pxUnblockedCRCB->xEventListItem ) );\r
+ uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );\r
}\r
portENABLE_INTERRUPTS();\r
\r
- vListRemove( &( pxUnblockedCRCB->xGenericListItem ) );\r
+ uxListRemove( &( pxUnblockedCRCB->xGenericListItem ) );\r
prvAddCoRoutineToReadyQueue( pxUnblockedCRCB ); \r
}\r
}\r
have been moved to the pending ready list and the following\r
line is still valid. Also the pvContainer parameter will have\r
been set to NULL so the following lines are also valid. */\r
- vListRemove( &( pxCRCB->xGenericListItem ) ); \r
+ uxListRemove( &( pxCRCB->xGenericListItem ) ); \r
\r
/* Is the co-routine waiting on an event also? */ \r
if( pxCRCB->xEventListItem.pvContainer ) \r
{ \r
- vListRemove( &( pxCRCB->xEventListItem ) ); \r
+ uxListRemove( &( pxCRCB->xEventListItem ) ); \r
}\r
}\r
portENABLE_INTERRUPTS();\r
event lists and the pending ready list. This function assumes that a\r
check has already been made to ensure pxEventList is not empty. */\r
pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList );\r
- vListRemove( &( pxUnblockedCRCB->xEventListItem ) );\r
+ uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );\r
vListInsertEnd( ( xList * ) &( xPendingReadyCoRoutineList ), &( pxUnblockedCRCB->xEventListItem ) );\r
\r
if( pxUnblockedCRCB->uxPriority >= pxCurrentCoRoutine->uxPriority )\r
\r
/*-----------------------------------------------------------*/\r
\r
- /* Define away taskCHECK_READY_LIST() as it is not required in this\r
+ /* Define away portRESET_READY_PRIORITY() as it is not required in this\r
configuration. */\r
- #define taskCHECK_READY_LIST( uxPriority )\r
+ #define portRESET_READY_PRIORITY( uxPriority, uxTopReadyPriority )\r
\r
#else /* configUSE_PORT_OPTIMISED_TASK_SELECTION */\r
\r
listGET_OWNER_OF_NEXT_ENTRY( pxCurrentTCB, &( pxReadyTasksLists[ uxTopPriority ] ) ); \\r
} /* taskSELECT_HIGHEST_PRIORITY_TASK() */\r
\r
- /*-----------------------------------------------------------*/\r
-\r
- /* Let the port layer know if the ready list is empty so \r
- taskSELECT_HIGHEST_PRIORITY_TASK() can function correctly. */\r
- #define taskCHECK_READY_LIST( uxPriority ) \\r
- { \\r
- if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ ( uxPriority ) ] ) ) == 0 ) \\r
- { \\r
- portRESET_READY_PRIORITY( ( uxPriority ), uxTopReadyPriority ); \\r
- } \\r
- } /* taskCHECK_READY_LIST() */\r
-\r
-\r
#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */\r
\r
/*\r
} \\r
\\r
/* It is time to remove the item from the Blocked state. */ \\r
- vListRemove( &( pxTCB->xGenericListItem ) ); \\r
+ uxListRemove( &( pxTCB->xGenericListItem ) ); \\r
\\r
/* Is the task waiting on an event also? */ \\r
if( pxTCB->xEventListItem.pvContainer != NULL ) \\r
{ \\r
- vListRemove( &( pxTCB->xEventListItem ) ); \\r
+ uxListRemove( &( pxTCB->xEventListItem ) ); \\r
} \\r
prvAddTaskToReadyQueue( pxTCB ); \\r
} \\r
This will stop the task from be scheduled. The idle task will check\r
the termination list and free up any memory allocated by the\r
scheduler for the TCB and stack. */\r
- vListRemove( &( pxTCB->xGenericListItem ) );\r
- taskCHECK_READY_LIST( pxTCB->uxPriority );\r
+ if( uxListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) ) == 0 )\r
+ {\r
+ portRESET_READY_PRIORITY( pxTCB->uxPriority, uxTopReadyPriority );\r
+ }\r
\r
/* Is the task waiting on an event also? */\r
if( pxTCB->xEventListItem.pvContainer != NULL )\r
{\r
- vListRemove( &( pxTCB->xEventListItem ) );\r
+ uxListRemove( &( pxTCB->xEventListItem ) );\r
}\r
\r
vListInsertEnd( ( xList * ) &xTasksWaitingTermination, &( pxTCB->xGenericListItem ) );\r
/* We must remove ourselves from the ready list before adding\r
ourselves to the blocked list as the same list item is used for\r
both lists. */\r
- vListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
- taskCHECK_READY_LIST( pxCurrentTCB->uxPriority );\r
+ if( uxListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) ) == 0 )\r
+ {\r
+ portRESET_READY_PRIORITY( pxCurrentTCB->uxPriority, uxTopReadyPriority );\r
+ }\r
+\r
prvAddCurrentTaskToDelayedList( xTimeToWake );\r
}\r
}\r
/* We must remove ourselves from the ready list before adding\r
ourselves to the blocked list as the same list item is used for\r
both lists. */\r
- vListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
- taskCHECK_READY_LIST( pxCurrentTCB->uxPriority );\r
+ if( uxListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) ) == 0 )\r
+ {\r
+ portRESET_READY_PRIORITY( pxCurrentTCB->uxPriority, uxTopReadyPriority );\r
+ }\r
prvAddCurrentTaskToDelayedList( xTimeToWake );\r
}\r
xAlreadyYielded = xTaskResumeAll();\r
/* The task is currently in its ready list - remove before adding\r
it to it's new ready list. As we are in a critical section we\r
can do this even if the scheduler is suspended. */\r
- vListRemove( &( pxTCB->xGenericListItem ) );\r
- taskCHECK_READY_LIST( uxCurrentPriority );\r
+ if( uxListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) ) == 0 )\r
+ {\r
+ portRESET_READY_PRIORITY( uxCurrentPriority, uxTopReadyPriority );\r
+ }\r
prvAddTaskToReadyQueue( pxTCB );\r
}\r
\r
traceTASK_SUSPEND( pxTCB );\r
\r
/* Remove task from the ready/delayed list and place in the suspended list. */\r
- vListRemove( &( pxTCB->xGenericListItem ) );\r
- taskCHECK_READY_LIST( pxTCB->uxPriority );\r
+ if( uxListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) ) == 0 )\r
+ {\r
+ portRESET_READY_PRIORITY( pxTCB->uxPriority, uxTopReadyPriority );\r
+ }\r
\r
/* Is the task waiting on an event also? */\r
if( pxTCB->xEventListItem.pvContainer != NULL )\r
{\r
- vListRemove( &( pxTCB->xEventListItem ) );\r
+ uxListRemove( &( pxTCB->xEventListItem ) );\r
}\r
\r
vListInsertEnd( ( xList * ) &xSuspendedTaskList, &( pxTCB->xGenericListItem ) );\r
\r
/* As we are in a critical section we can access the ready\r
lists even if the scheduler is suspended. */\r
- vListRemove( &( pxTCB->xGenericListItem ) );\r
+ uxListRemove( &( pxTCB->xGenericListItem ) );\r
prvAddTaskToReadyQueue( pxTCB );\r
\r
/* We may have just resumed a higher priority task. */\r
if( uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE )\r
{\r
xYieldRequired = ( pxTCB->uxPriority >= pxCurrentTCB->uxPriority );\r
- vListRemove( &( pxTCB->xGenericListItem ) );\r
+ uxListRemove( &( pxTCB->xGenericListItem ) );\r
prvAddTaskToReadyQueue( pxTCB );\r
}\r
else\r
while( listLIST_IS_EMPTY( ( xList * ) &xPendingReadyList ) == pdFALSE )\r
{\r
pxTCB = ( tskTCB * ) listGET_OWNER_OF_HEAD_ENTRY( ( ( xList * ) &xPendingReadyList ) );\r
- vListRemove( &( pxTCB->xEventListItem ) );\r
- vListRemove( &( pxTCB->xGenericListItem ) );\r
+ uxListRemove( &( pxTCB->xEventListItem ) );\r
+ uxListRemove( &( pxTCB->xGenericListItem ) );\r
prvAddTaskToReadyQueue( pxTCB );\r
\r
/* If we have moved a task that has a priority higher than\r
/* We must remove ourselves from the ready list before adding ourselves\r
to the blocked list as the same list item is used for both lists. We have\r
exclusive access to the ready lists as the scheduler is locked. */\r
- vListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
- taskCHECK_READY_LIST( pxCurrentTCB->uxPriority );\r
+ if( uxListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) ) == 0 )\r
+ {\r
+ portRESET_READY_PRIORITY( pxCurrentTCB->uxPriority, uxTopReadyPriority );\r
+ }\r
\r
#if ( INCLUDE_vTaskSuspend == 1 )\r
{\r
/* We must remove this task from the ready list before adding it to the\r
blocked list as the same list item is used for both lists. This\r
function is called form a critical section. */\r
- vListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
- taskCHECK_READY_LIST( pxCurrentTCB->uxPriority );\r
+ if( uxListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) ) == 0 )\r
+ {\r
+ portRESET_READY_PRIORITY( pxCurrentTCB->uxPriority, uxTopReadyPriority );\r
+ }\r
\r
/* Calculate the time at which the task should be woken if the event does\r
not occur. This may overflow but this doesn't matter. */\r
pxEventList is not empty. */\r
pxUnblockedTCB = ( tskTCB * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList );\r
configASSERT( pxUnblockedTCB );\r
- vListRemove( &( pxUnblockedTCB->xEventListItem ) );\r
+ uxListRemove( &( pxUnblockedTCB->xEventListItem ) );\r
\r
if( uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE )\r
{\r
- vListRemove( &( pxUnblockedTCB->xGenericListItem ) );\r
+ uxListRemove( &( pxUnblockedTCB->xGenericListItem ) );\r
prvAddTaskToReadyQueue( pxUnblockedTCB );\r
}\r
else\r
taskENTER_CRITICAL();\r
{\r
pxTCB = ( tskTCB * ) listGET_OWNER_OF_HEAD_ENTRY( ( ( xList * ) &xTasksWaitingTermination ) );\r
- vListRemove( &( pxTCB->xGenericListItem ) );\r
+ uxListRemove( &( pxTCB->xGenericListItem ) );\r
--uxCurrentNumberOfTasks;\r
--uxTasksDeleted;\r
}\r
be moved in to a new list. */\r
if( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ pxTCB->uxPriority ] ), &( pxTCB->xGenericListItem ) ) != pdFALSE )\r
{\r
- vListRemove( &( pxTCB->xGenericListItem ) );\r
- taskCHECK_READY_LIST( pxTCB->uxPriority );\r
+ if( uxListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) ) == 0 )\r
+ {\r
+ portRESET_READY_PRIORITY( pxTCB->uxPriority, uxTopReadyPriority );\r
+ }\r
\r
/* Inherit the priority before being moved into the new list. */\r
pxTCB->uxPriority = pxCurrentTCB->uxPriority;\r
{\r
/* We must be the running task to be able to give the mutex back.\r
Remove ourselves from the ready list we currently appear in. */\r
- vListRemove( &( pxTCB->xGenericListItem ) );\r
- taskCHECK_READY_LIST( pxTCB->uxPriority );\r
+ if( uxListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) ) == 0 )\r
+ {\r
+ portRESET_READY_PRIORITY( pxTCB->uxPriority, uxTopReadyPriority );\r
+ }\r
\r
/* Disinherit the priority before adding the task into the new\r
ready list. */\r