modifications from testing

This commit is contained in:
David Chalco 2020-03-25 18:21:57 -07:00
parent b9dab369b1
commit fd85f367c3
6 changed files with 39 additions and 9 deletions

View file

@ -167,7 +167,8 @@ typedef struct xLIST
volatile UBaseType_t uxNumberOfItems;
ListItem_t * configLIST_VOLATILE pxIndex; /*< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
MiniListItem_t xListEnd; /*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
listSECOND_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
void* pvOwner; /* Pointer to the object that owns the list (normally an RTOS object) */
listSECOND_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
} List_t;
/*
@ -216,6 +217,24 @@ typedef struct xLIST
*/
#define listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext->xItemValue )
/*
* Access macro to set the owner of a list. The owner of a list
* is the object(usually an RTOS object) that contains the list, such as semaphores.
*
* \page listSET_LIST_OWNER listSET_LIST_OWNER
* \ingroup LinkedList
*/
#define listSET_LIST_OWNER( pxList , pxOwner ) ( ( pxList )->pvOwner = (void * ) ( pxOwner ) )
/*
* Access macro to get the owner of a list. The owner of a list
* is the object(usually an RTOS object) that contains the list, such as semaphores.
*
* \page listGET_LIST_OWNER listGET_LIST_OWNER
* \ingroup LinkedList
*/
#define listGET_LIST_OWNER( pxList ) ( ( pxList )->pvOwner )
/*
* Return the list item at the head of the list.
*

View file

@ -38,6 +38,7 @@ extern "C" {
#endif
#include "task.h"
#include "list.h"
/**
* Type by which queues are referenced. For example, a call to xQueueCreate()

View file

@ -162,7 +162,7 @@ typedef struct XTASK_BLOCKED_STATUS
eBlockedStatus eStatus;
union
{
List_t *pxEventList;
List_t const *pxEventList;
TickType_t xUntilTick;
};
} TaskBlockedStatus_t;
@ -1813,6 +1813,9 @@ uint32_t ulTaskGetIdleRunTimeCounter( void ) PRIVILEGED_FUNCTION;
* eStatus will be eBlockedForTime and xUntilTick will be assigned the tick value at which the task can exit the blocked state.
* list. If the task is not blocked, eStatus will be eNotBlocked.
*
* Some RTOS objects establish ownership of their event lists, such as semaphores. To retrieve the owner of the event list,
* you can call listGET_LIST_OWNER() to get a void * pointer to the
*
* @param xTask The handle of the task to query. If xTask == NULL, the current running task is evaluated.
*
* @param pxBlockerStatus The struct for storing eStatus and union of xUntilTick or pxEventList.

3
list.c
View file

@ -36,6 +36,9 @@
void vListInitialise( List_t * const pxList )
{
/* Ownership of a list is claimed/queried via listLIST_SET_OWNER and listLIST_GET_OWNER*/
pxList->pvOwner = NULL;
/* The list structure contains a list item which is used to mark the
end of the list. To initialise the list the list end is inserted
as the only list entry. */

View file

@ -445,6 +445,10 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength, const UBaseT
pxNewQueue->uxItemSize = uxItemSize;
( void ) xQueueGenericReset( pxNewQueue, pdTRUE );
/* Establish two-way link with event lists */
listSET_LIST_OWNER(&pxNewQueue->xTasksWaitingToReceive, pxNewQueue);
listSET_LIST_OWNER(&pxNewQueue->xTasksWaitingToSend, pxNewQueue);
#if ( configUSE_TRACE_FACILITY == 1 )
{
pxNewQueue->ucQueueType = ucQueueType;

14
tasks.c
View file

@ -5177,10 +5177,10 @@ TickType_t uxReturn;
#endif
/*-----------------------------------------------------------*/
#if ( INCLUDE_eTaskGetBlocker == 1 )
#if ( INCLUDE_vTaskGetCurrentBlocker == 1 )
void vTaskGetCurrentBlocker(TaskHandle_t xTask, TaskBlockedStatus_t* pxBlockedStatus)
{
List_t const *pxStateList, * pxEventList, * pxDelayedList, * pxOverflowDelayedList
List_t const* pxStateList, * pxEventList, * pxDelayedList, * pxOverflowDelayedList;
const TCB_t * const pxTCB = xTask;
TickType_t xStateListItemValue = 0u;
#if (configUSE_TASK_NOTIFICATIONS == 1)
@ -5188,7 +5188,7 @@ TickType_t uxReturn;
#endif
memset(pxBlockedStatus, 0u, sizeof(TaskBlockedStatus_t));
pxBlockedStatus = eNotBlocked;
pxBlockedStatus->eStatus = eNotBlocked;
/* Per convention NULL operates for current task.
Current task can't be blocked if its running this function */
@ -5201,7 +5201,7 @@ TickType_t uxReturn;
pxEventList = listLIST_ITEM_CONTAINER(&(pxTCB->xEventListItem));
pxDelayedList = pxDelayedTaskList;
pxOverflowDelayedList = pxOverflowDelayedTaskList;
xStateListItemValue = pxTCB->xStateListItem->xItemValue;
xStateListItemValue = pxTCB->xStateListItem.xItemValue;
#if (configUSE_TASK_NOTIFICATIONS == 1)
{
ucNotifyState = pxTCB->ucNotifyState;
@ -5240,15 +5240,15 @@ TickType_t uxReturn;
block indefinitely and is instead placed on the xSuspendTaskList. */
if (pxEventList != NULL)
{
eBlockedStatus->eStatus = eBlockedForEvent;
eBlockedStatus->eEventList = pxEventList;
pxBlockedStatus->eStatus = eBlockedForEvent;
pxBlockedStatus->pxEventList = pxEventList;
}
else
{
#if (configUSE_TASK_NOTIFICATIONS)
if (ucNotifyState == taskWAITING_NOTIFICATION)
{
eBlockedStatus = eBlockedForNotification;
pxBlockedStatus->eStatus = eBlockedForNotification;
}
else
{