#include "timers.h"\r
#include "event_groups.h"\r
\r
-/* Lint e961 and e750 are suppressed as a MISRA exception justified because the\r
-MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined for the\r
-header files above, but not in this file, in order to generate the correct\r
-privileged Vs unprivileged linkage and placement. */\r
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750. */\r
+/* Lint e961, e750 and e9021 are suppressed as a MISRA exception justified\r
+because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined\r
+for the header files above, but not in this file, in order to generate the\r
+correct privileged Vs unprivileged linkage and placement. */\r
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021 See comment above. */\r
\r
/* The following bit fields convey control information in a task's event list\r
item value. It is important they don't clash with the\r
#define eventEVENT_BITS_CONTROL_BYTES 0xff000000UL\r
#endif\r
\r
-typedef struct xEventGroupDefinition\r
+typedef struct xEventGroup\r
{\r
EventBits_t uxEventBits;\r
List_t xTasksWaitingForBits; /*< List of tasks waiting for a bit to be set. */\r
event group structure. */\r
volatile size_t xSize = sizeof( StaticEventGroup_t );\r
configASSERT( xSize == sizeof( EventGroup_t ) );\r
- }\r
+ } /*lint !e529 xSize is referenced if configASSERT() is defined. */\r
#endif /* configASSERT_DEFINED */\r
\r
/* The user has provided a statically allocated event group - use it. */\r
- pxEventBits = ( EventGroup_t * ) pxEventGroupBuffer; /*lint !e740 EventGroup_t and StaticEventGroup_t are guaranteed to have the same size and alignment requirement - checked by configASSERT(). */\r
+ pxEventBits = ( EventGroup_t * ) pxEventGroupBuffer; /*lint !e740 !e9087 EventGroup_t and StaticEventGroup_t are deliberately aliased for data hiding purposes and guaranteed to have the same size and alignment requirement - checked by configASSERT(). */\r
\r
if( pxEventBits != NULL )\r
{\r
}\r
else\r
{\r
+ /* xEventGroupCreateStatic should only ever be called with\r
+ pxEventGroupBuffer pointing to a pre-allocated (compile time\r
+ allocated) StaticEventGroup_t variable. */\r
traceEVENT_GROUP_CREATE_FAILED();\r
}\r
\r
- return ( EventGroupHandle_t ) pxEventBits;\r
+ return ( EventGroupHandle_t ) pxEventBits; /*lint !e9087 EventGroup_t and StaticEventGroup_t are deliberately aliased for data hiding purposes and guaranteed to have the same size and alignment requirement - checked by configASSERT(). */\r
}\r
\r
#endif /* configSUPPORT_STATIC_ALLOCATION */\r
{\r
EventGroup_t *pxEventBits;\r
\r
- /* Allocate the event group. */\r
- pxEventBits = ( EventGroup_t * ) pvPortMalloc( sizeof( EventGroup_t ) );\r
+ /* Allocate the event group. Justification for MISRA deviation as\r
+ follows: pvPortMalloc() always ensures returned memory blocks are\r
+ aligned per the requirements of the MCU stack. In this case\r
+ pvPortMalloc() must return a pointer that is guaranteed to meet the\r
+ alignment requirements of the EventGroup_t structure - which (if you\r
+ follow it through) is the alignment requirements of the TickType_t type\r
+ (EventBits_t being of TickType_t itself). Therefore, whenever the\r
+ stack alignment requirements are greater than or equal to the\r
+ TickType_t alignment requirements the cast is safe. In other cases,\r
+ where the natural word size of the architecture is less than\r
+ sizeof( TickType_t ), the TickType_t variables will be accessed in two\r
+ or more reads operations, and the alignment requirements is only that\r
+ of each individual read. */\r
+ pxEventBits = ( EventGroup_t * ) pvPortMalloc( sizeof( EventGroup_t ) ); /*lint !e9087 !e9079 see comment above. */\r
\r
if( pxEventBits != NULL )\r
{\r
}\r
else\r
{\r
- traceEVENT_GROUP_CREATE_FAILED();\r
+ traceEVENT_GROUP_CREATE_FAILED(); /*lint !e9063 Else branch only exists to allow tracing and does not generate code if trace macros are not defined. */\r
}\r
\r
- return ( EventGroupHandle_t ) pxEventBits;\r
+ return ( EventGroupHandle_t ) pxEventBits; /*lint !e9087 EventGroupHandle_t is a pointer to an EventGroup_t, but EventGroupHandle_t is kept opaque outside of this file for data hiding purposes. */\r
}\r
\r
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */\r
EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait )\r
{\r
EventBits_t uxOriginalBitValue, uxReturn;\r
-EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup;\r
+EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t. It is opaque outside of this file for data hiding purposes. */\r
BaseType_t xAlreadyYielded;\r
BaseType_t xTimeoutOccurred = pdFALSE;\r
\r
\r
EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait )\r
{\r
-EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup;\r
+EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t. It is opaque outside of this file for data hiding purposes. */\r
EventBits_t uxReturn, uxControlBits = 0;\r
BaseType_t xWaitConditionMet, xAlreadyYielded;\r
BaseType_t xTimeoutOccurred = pdFALSE;\r
\r
EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear )\r
{\r
-EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup;\r
+EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t, but EventGroupHandle_t is kept opaque outside of this file for data hiding purposes. */\r
EventBits_t uxReturn;\r
\r
/* Check the user is not attempting to clear the bits used by the kernel\r
BaseType_t xReturn;\r
\r
traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear );\r
- xReturn = xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL );\r
+ xReturn = xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL ); /*lint !e9087 Can't avoid cast to void* as a generic callback function not specific to this use case. Callback casts back to original type so safe. */\r
\r
return xReturn;\r
}\r
EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup )\r
{\r
UBaseType_t uxSavedInterruptStatus;\r
-EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup;\r
+EventGroup_t const * const pxEventBits = ( EventGroup_t * ) xEventGroup; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t, but EventGroupHandle_t is kept opaque outside of this file for data hiding purposes. */\r
EventBits_t uxReturn;\r
\r
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );\r
\r
return uxReturn;\r
-}\r
+} /*lint !e818 EventGroupHandle_t is a typedef used in other functions to so can't be pointer to const. */\r
/*-----------------------------------------------------------*/\r
\r
EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet )\r
{\r
ListItem_t *pxListItem, *pxNext;\r
ListItem_t const *pxListEnd;\r
-List_t *pxList;\r
+List_t const * pxList;\r
EventBits_t uxBitsToClear = 0, uxBitsWaitedFor, uxControlBits;\r
-EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup;\r
+EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t, but EventGroupHandle_t is kept opaque outside of this file for data hiding purposes. */\r
BaseType_t xMatchFound = pdFALSE;\r
\r
/* Check the user is not attempting to set the bits used by the kernel\r
configASSERT( ( uxBitsToSet & eventEVENT_BITS_CONTROL_BYTES ) == 0 );\r
\r
pxList = &( pxEventBits->xTasksWaitingForBits );\r
- pxListEnd = listGET_END_MARKER( pxList ); /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */\r
+ pxListEnd = listGET_END_MARKER( pxList ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */\r
vTaskSuspendAll();\r
{\r
traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet );\r
\r
void vEventGroupDelete( EventGroupHandle_t xEventGroup )\r
{\r
-EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup;\r
+EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t, but EventGroupHandle_t is kept opaque outside of this file for data hiding purposes. */\r
const List_t *pxTasksWaitingForBits = &( pxEventBits->xTasksWaitingForBits );\r
\r
vTaskSuspendAll();\r
an interrupt. */\r
void vEventGroupSetBitsCallback( void *pvEventGroup, const uint32_t ulBitsToSet )\r
{\r
- ( void ) xEventGroupSetBits( pvEventGroup, ( EventBits_t ) ulBitsToSet );\r
+ ( void ) xEventGroupSetBits( pvEventGroup, ( EventBits_t ) ulBitsToSet ); /*lint !e9079 Can't avoid cast to void* as a generic timer callback prototype. Callback casts back to original type so safe. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
an interrupt. */\r
void vEventGroupClearBitsCallback( void *pvEventGroup, const uint32_t ulBitsToClear )\r
{\r
- ( void ) xEventGroupClearBits( pvEventGroup, ( EventBits_t ) ulBitsToClear );\r
+ ( void ) xEventGroupClearBits( pvEventGroup, ( EventBits_t ) ulBitsToClear ); /*lint !e9079 Can't avoid cast to void* as a generic timer callback prototype. Callback casts back to original type so safe. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
BaseType_t xReturn;\r
\r
traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet );\r
- xReturn = xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken );\r
+ xReturn = xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken ); /*lint !e9087 Can't avoid cast to void* as a generic callback function not specific to this use case. Callback casts back to original type so safe. */\r
\r
return xReturn;\r
}\r
UBaseType_t uxEventGroupGetNumber( void* xEventGroup )\r
{\r
UBaseType_t xReturn;\r
- EventGroup_t *pxEventBits = ( EventGroup_t * ) xEventGroup;\r
+ EventGroup_t const *pxEventBits = ( EventGroup_t * ) xEventGroup; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t, but EventGroupHandle_t is kept opaque outside of this file for data hiding purposes. */\r
\r
if( xEventGroup == NULL )\r
{\r
\r
void vEventGroupSetNumber( void * xEventGroup, UBaseType_t uxEventGroupNumber )\r
{\r
- ( ( EventGroup_t * ) xEventGroup )->uxEventGroupNumber = uxEventGroupNumber;\r
+ ( ( EventGroup_t * ) xEventGroup )->uxEventGroupNumber = uxEventGroupNumber; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t, but EventGroupHandle_t is kept opaque outside of this file for data hiding purposes. */\r
}\r
\r
#endif /* configUSE_TRACE_FACILITY */\r
#include "timers.h"\r
#include "stack_macros.h"\r
\r
-/* Lint e961 and e750 are suppressed as a MISRA exception justified because the\r
-MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined for the\r
-header files above, but not in this file, in order to generate the correct\r
-privileged Vs unprivileged linkage and placement. */\r
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750. */\r
+/* Lint e9021, e961 and e750 are suppressed as a MISRA exception justified\r
+because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined\r
+for the header files above, but not in this file, in order to generate the\r
+correct privileged Vs unprivileged linkage and placement. */\r
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */\r
\r
/* Set configUSE_STATS_FORMATTING_FUNCTIONS to 2 to include the stats formatting\r
functions but without including stdio.h here. */\r
* task should be used in place of the parameter. This macro simply checks to\r
* see if the parameter is NULL and returns a pointer to the appropriate TCB.\r
*/\r
-#define prvGetTCBFromHandle( pxHandle ) ( ( ( pxHandle ) == NULL ) ? ( TCB_t * ) pxCurrentTCB : ( TCB_t * ) ( pxHandle ) )\r
+#define prvGetTCBFromHandle( pxHandle ) ( ( ( pxHandle ) == NULL ) ? pxCurrentTCB : ( pxHandle ) )\r
\r
/* The item value of the event list item is normally used to hold the priority\r
of the task to which it belongs (coded to allow it to be held in reverse\r
* and stores task state information, including a pointer to the task's context\r
* (the task's run time environment, including register values)\r
*/\r
-typedef struct tskTaskControlBlock\r
+typedef struct xTaskControlBlock\r
{\r
volatile StackType_t *pxTopOfStack; /*< Points to the location of the last item placed on the tasks stack. THIS MUST BE THE FIRST MEMBER OF THE TCB STRUCT. */\r
\r
\r
/* See the comments above the definition of\r
tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE. */\r
- #if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 Macro has been consolidated for readability reasons. */\r
+ #if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */\r
uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the task is a statically allocated to ensure no attempt is made to free the memory. */\r
#endif\r
\r
\r
/*lint -save -e956 A manual analysis and inspection has been used to determine\r
which static variables must be declared volatile. */\r
-\r
PRIVILEGED_DATA TCB_t * volatile pxCurrentTCB = NULL;\r
\r
/* Lists for ready and blocked tasks. --------------------*/\r
PRIVILEGED_DATA static List_t pxReadyTasksLists[ configMAX_PRIORITIES ];/*< Prioritised ready tasks. */\r
-PRIVILEGED_DATA static List_t xDelayedTaskList1; /*< Delayed tasks. */\r
-PRIVILEGED_DATA static List_t xDelayedTaskList2; /*< Delayed tasks (two lists are used - one for delays that have overflowed the current tick count. */\r
PRIVILEGED_DATA static List_t * volatile pxDelayedTaskList; /*< Points to the delayed task list currently being used. */\r
PRIVILEGED_DATA static List_t * volatile pxOverflowDelayedTaskList; /*< Points to the delayed task list currently being used to hold tasks that have overflowed the current tick count. */\r
PRIVILEGED_DATA static List_t xPendingReadyList; /*< Tasks that have been readied while the scheduler was suspended. They will be moved to the ready list when the scheduler is resumed. */\r
accessed from a critical section. */\r
PRIVILEGED_DATA static volatile UBaseType_t uxSchedulerSuspended = ( UBaseType_t ) pdFALSE;\r
\r
-#if ( configGENERATE_RUN_TIME_STATS == 1 )\r
-\r
- PRIVILEGED_DATA static uint32_t ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */\r
- PRIVILEGED_DATA static uint32_t ulTotalRunTime = 0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */\r
-\r
-#endif\r
-\r
/*lint -restore */\r
\r
/*-----------------------------------------------------------*/\r
\r
#if( configUSE_TICK_HOOK > 0 )\r
\r
- extern void vApplicationTickHook( void );\r
+ extern void vApplicationTickHook( void ); /*lint !e526 Symbol not defined as it is an application callback. */\r
\r
#endif\r
\r
#if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
\r
- extern void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize );\r
+ extern void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ); /*lint !e526 Symbol not defined as it is an application callback. */\r
\r
#endif\r
\r
structure. */\r
volatile size_t xSize = sizeof( StaticTask_t );\r
configASSERT( xSize == sizeof( TCB_t ) );\r
+ ( void ) xSize; /* Prevent lint warning when configASSERT() is not used. */\r
}\r
#endif /* configASSERT_DEFINED */\r
\r
{\r
/* The memory used for the task's TCB and stack are passed into this\r
function - use them. */\r
- pxNewTCB = ( TCB_t * ) pxTaskBuffer; /*lint !e740 Unusual cast is ok as the structures are designed to have the same alignment, and the size is checked by an assert. */\r
+ pxNewTCB = ( TCB_t * ) pxTaskBuffer; /*lint !e740 !e9087 Unusual cast is ok as the structures are designed to have the same alignment, and the size is checked by an assert. */\r
pxNewTCB->pxStack = ( StackType_t * ) puxStackBuffer;\r
\r
- #if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 Macro has been consolidated for readability reasons. */\r
+ #if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */\r
{\r
/* Tasks can be created statically or dynamically, so note this\r
task was created statically in case the task is later deleted. */\r
StackType_t *pxStack;\r
\r
/* Allocate space for the stack used by the task being created. */\r
- pxStack = ( StackType_t * ) pvPortMalloc( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */\r
+ pxStack = pvPortMalloc( ( ( ( size_t ) usStackDepth ) * sizeof( StackType_t ) ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation is the stack. */\r
\r
if( pxStack != NULL )\r
{\r
/* Allocate space for the TCB. */\r
- pxNewTCB = ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) ); /*lint !e961 MISRA exception as the casts are only redundant for some paths. */\r
+ pxNewTCB = ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) ); /*lint !e9087 !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack, and the first member of TCB_t is always a pointer to the task's stack. */\r
\r
if( pxNewTCB != NULL )\r
{\r
\r
if( pxNewTCB != NULL )\r
{\r
- #if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 Macro has been consolidated for readability reasons. */\r
+ #if( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e9029 !e731 Macro has been consolidated for readability reasons. */\r
{\r
/* Tasks can be created statically or dynamically, so note this\r
task was created dynamically in case it is later deleted. */\r
by the port. */\r
#if( portSTACK_GROWTH < 0 )\r
{\r
- pxTopOfStack = pxNewTCB->pxStack + ( ulStackDepth - ( uint32_t ) 1 );\r
- pxTopOfStack = ( StackType_t * ) ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) ); /*lint !e923 MISRA exception. Avoiding casts between pointers and integers is not practical. Size differences accounted for using portPOINTER_SIZE_TYPE type. */\r
+ pxTopOfStack = &( pxNewTCB->pxStack[ ulStackDepth - ( uint32_t ) 1 ] );\r
+ pxTopOfStack = ( StackType_t * ) ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) ); /*lint !e923 !e9033 !e9078 MISRA exception. Avoiding casts between pointers and integers is not practical. Size differences accounted for using portPOINTER_SIZE_TYPE type. Checked by assert(). */\r
\r
/* Check the alignment of the calculated top of stack is correct. */\r
configASSERT( ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack & ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) == 0UL ) );\r
/* Don't copy all configMAX_TASK_NAME_LEN if the string is shorter than\r
configMAX_TASK_NAME_LEN characters just in case the memory after the\r
string is not accessible (extremely unlikely). */\r
- if( pcName[ x ] == 0x00 )\r
+ if( pcName[ x ] == ( char ) 0x00 )\r
{\r
break;\r
}\r
}\r
#endif /* portUSING_MPU_WRAPPERS */\r
\r
- if( ( void * ) pxCreatedTask != NULL )\r
+ if( pxCreatedTask != NULL )\r
{\r
/* Pass the handle out in an anonymous way. The handle can be used to\r
change the created task's priority, delete the created task, etc.*/\r
eTaskState eTaskGetState( TaskHandle_t xTask )\r
{\r
eTaskState eReturn;\r
- List_t *pxStateList;\r
- const TCB_t * const pxTCB = ( TCB_t * ) xTask;\r
+ List_t const * pxStateList, *pxDelayedList, *pxOverflowedDelayedList;\r
+ const TCB_t * const pxTCB = xTask;\r
\r
configASSERT( pxTCB );\r
\r
{\r
taskENTER_CRITICAL();\r
{\r
- pxStateList = ( List_t * ) listLIST_ITEM_CONTAINER( &( pxTCB->xStateListItem ) );\r
+ pxStateList = listLIST_ITEM_CONTAINER( &( pxTCB->xStateListItem ) );\r
+ pxDelayedList = pxDelayedTaskList;\r
+ pxOverflowedDelayedList = pxOverflowDelayedTaskList;\r
}\r
taskEXIT_CRITICAL();\r
\r
- if( ( pxStateList == pxDelayedTaskList ) || ( pxStateList == pxOverflowDelayedTaskList ) )\r
+ if( ( pxStateList == pxDelayedList ) || ( pxStateList == pxOverflowedDelayedList ) )\r
{\r
/* The task being queried is referenced from one of the Blocked\r
lists. */\r
\r
#if ( INCLUDE_uxTaskPriorityGet == 1 )\r
\r
- UBaseType_t uxTaskPriorityGet( TaskHandle_t xTask )\r
+ UBaseType_t uxTaskPriorityGet( const TaskHandle_t xTask )\r
{\r
- TCB_t *pxTCB;\r
+ TCB_t const *pxTCB;\r
UBaseType_t uxReturn;\r
\r
taskENTER_CRITICAL();\r
{\r
- /* If null is passed in here then it is the priority of the that\r
- called uxTaskPriorityGet() that is being queried. */\r
+ /* If null is passed in here then it is the priority of the task\r
+ that called uxTaskPriorityGet() that is being queried. */\r
pxTCB = prvGetTCBFromHandle( xTask );\r
uxReturn = pxTCB->uxPriority;\r
}\r
\r
#if ( INCLUDE_uxTaskPriorityGet == 1 )\r
\r
- UBaseType_t uxTaskPriorityGetFromISR( TaskHandle_t xTask )\r
+ UBaseType_t uxTaskPriorityGetFromISR( const TaskHandle_t xTask )\r
{\r
- TCB_t *pxTCB;\r
+ TCB_t const *pxTCB;\r
UBaseType_t uxReturn, uxSavedInterruptState;\r
\r
/* RTOS ports that support interrupt nesting have the concept of a\r
separate interrupt safe API to ensure interrupt entry is as fast and as\r
simple as possible. More information (albeit Cortex-M specific) is\r
provided on the following link:\r
- http://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
+ https://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();\r
\r
uxSavedInterruptState = portSET_INTERRUPT_MASK_FROM_ISR();\r
/* The scheduler is not running, but the task that was pointed\r
to by pxCurrentTCB has just been suspended and pxCurrentTCB\r
must be adjusted to point to a different task. */\r
- if( listCURRENT_LIST_LENGTH( &xSuspendedTaskList ) == uxCurrentNumberOfTasks )\r
+ if( listCURRENT_LIST_LENGTH( &xSuspendedTaskList ) == uxCurrentNumberOfTasks ) /*lint !e931 Right has no side effect, just volatile. */\r
{\r
/* No other tasks are ready, so set pxCurrentTCB back to\r
NULL so when the next task is created pxCurrentTCB will\r
static BaseType_t prvTaskIsTaskSuspended( const TaskHandle_t xTask )\r
{\r
BaseType_t xReturn = pdFALSE;\r
- const TCB_t * const pxTCB = ( TCB_t * ) xTask;\r
+ const TCB_t * const pxTCB = xTask;\r
\r
/* Accesses xPendingReadyList so must be called from a critical\r
section. */\r
\r
void vTaskResume( TaskHandle_t xTaskToResume )\r
{\r
- TCB_t * const pxTCB = ( TCB_t * ) xTaskToResume;\r
+ TCB_t * const pxTCB = xTaskToResume;\r
\r
/* It does not make sense to resume the calling task. */\r
configASSERT( xTaskToResume );\r
\r
/* The parameter cannot be NULL as it is impossible to resume the\r
currently executing task. */\r
- if( ( pxTCB != NULL ) && ( pxTCB != pxCurrentTCB ) )\r
+ if( ( pxTCB != pxCurrentTCB ) && ( pxTCB != NULL ) )\r
{\r
taskENTER_CRITICAL();\r
{\r
BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume )\r
{\r
BaseType_t xYieldRequired = pdFALSE;\r
- TCB_t * const pxTCB = ( TCB_t * ) xTaskToResume;\r
+ TCB_t * const pxTCB = xTaskToResume;\r
UBaseType_t uxSavedInterruptStatus;\r
\r
configASSERT( xTaskToResume );\r
separate interrupt safe API to ensure interrupt entry is as fast and as\r
simple as possible. More information (albeit Cortex-M specific) is\r
provided on the following link:\r
- http://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
+ https://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();\r
\r
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
configIDLE_TASK_NAME,\r
ulIdleTaskStackSize,\r
( void * ) NULL, /*lint !e961. The cast is not redundant for all compilers. */\r
- ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ),\r
+ portPRIVILEGE_BIT, /* In effect ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), but tskIDLE_PRIORITY is zero. */\r
pxIdleTaskStackBuffer,\r
pxIdleTaskTCBBuffer ); /*lint !e961 MISRA exception, justified as it is not a redundant explicit cast to all supported compilers. */\r
\r
configIDLE_TASK_NAME,\r
configMINIMAL_STACK_SIZE,\r
( void * ) NULL,\r
- ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ),\r
+ portPRIVILEGE_BIT, /* In effect ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), but tskIDLE_PRIORITY is zero. */\r
&xIdleTaskHandle ); /*lint !e961 MISRA exception, justified as it is not a redundant explicit cast to all supported compilers. */\r
}\r
#endif /* configSUPPORT_STATIC_ALLOCATION */\r
appropriate ready list. */\r
while( listLIST_IS_EMPTY( &xPendingReadyList ) == pdFALSE )\r
{\r
- pxTCB = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyList ) );\r
+ pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyList ) ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */\r
( void ) uxListRemove( &( pxTCB->xEventListItem ) );\r
( void ) uxListRemove( &( pxTCB->xStateListItem ) );\r
prvAddTaskToReadyList( pxTCB );\r
system call interrupt priority. FreeRTOS maintains a separate interrupt\r
safe API to ensure interrupt entry is as fast and as simple as possible.\r
More information (albeit Cortex-M specific) is provided on the following\r
- link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
+ link: https://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();\r
\r
uxSavedInterruptStatus = portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR();\r
TCB_t *pxNextTCB, *pxFirstTCB, *pxReturn = NULL;\r
UBaseType_t x;\r
char cNextChar;\r
+ BaseType_t xBreakLoop;\r
\r
/* This function is called with the scheduler suspended. */\r
\r
if( listCURRENT_LIST_LENGTH( pxList ) > ( UBaseType_t ) 0 )\r
{\r
- listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList );\r
+ listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */\r
\r
do\r
{\r
- listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList );\r
+ listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */\r
\r
/* Check each character in the name looking for a match or\r
mismatch. */\r
+ xBreakLoop = pdFALSE;\r
for( x = ( UBaseType_t ) 0; x < ( UBaseType_t ) configMAX_TASK_NAME_LEN; x++ )\r
{\r
cNextChar = pxNextTCB->pcTaskName[ x ];\r
if( cNextChar != pcNameToQuery[ x ] )\r
{\r
/* Characters didn't match. */\r
- break;\r
+ xBreakLoop = pdTRUE;\r
}\r
- else if( cNextChar == 0x00 )\r
+ else if( cNextChar == ( char ) 0x00 )\r
{\r
/* Both strings terminated, a match must have been\r
found. */\r
pxReturn = pxNextTCB;\r
- break;\r
+ xBreakLoop = pdTRUE;\r
}\r
else\r
{\r
mtCOVERAGE_TEST_MARKER();\r
}\r
+\r
+ if( xBreakLoop != pdFALSE )\r
+ {\r
+ break;\r
+ }\r
}\r
\r
if( pxReturn != NULL )\r
}\r
( void ) xTaskResumeAll();\r
\r
- return ( TaskHandle_t ) pxTCB;\r
+ return pxTCB;\r
}\r
\r
#endif /* INCLUDE_xTaskGetHandle */\r
\r
BaseType_t xTaskAbortDelay( TaskHandle_t xTask )\r
{\r
- TCB_t *pxTCB = ( TCB_t * ) xTask;\r
+ TCB_t *pxTCB = xTask;\r
BaseType_t xReturn;\r
\r
configASSERT( pxTCB );\r
item at the head of the delayed list. This is the time\r
at which the task at the head of the delayed list must\r
be removed from the Blocked state. */\r
- pxTCB = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedTaskList );\r
+ pxTCB = listGET_OWNER_OF_HEAD_ENTRY( pxDelayedTaskList ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */\r
xItemValue = listGET_LIST_ITEM_VALUE( &( pxTCB->xStateListItem ) );\r
\r
if( xConstTickCount < xItemValue )\r
state - so record the item value in\r
xNextTaskUnblockTime. */\r
xNextTaskUnblockTime = xItemValue;\r
- break;\r
+ break; /*lint !e9011 Code structure here is deedmed easier to understand with multiple breaks. */\r
}\r
else\r
{\r
}\r
else\r
{\r
- xTCB = ( TCB_t * ) xTask;\r
+ xTCB = xTask;\r
}\r
\r
/* Save the hook function in the TCB. A critical section is required as\r
}\r
else\r
{\r
- xTCB = ( TCB_t * ) xTask;\r
+ xTCB = xTask;\r
}\r
\r
if( xTCB->pxTaskTag != NULL )\r
\r
#if ( configGENERATE_RUN_TIME_STATS == 1 )\r
{\r
+ PRIVILEGED_DATA static uint32_t ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */\r
+ PRIVILEGED_DATA static uint32_t ulTotalRunTime = 0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */\r
+\r
#ifdef portALT_GET_RUN_TIME_COUNTER_VALUE\r
portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime );\r
#else\r
\r
/* Select a new task to run using either the generic C or port\r
optimised asm code. */\r
- taskSELECT_HIGHEST_PRIORITY_TASK();\r
+ taskSELECT_HIGHEST_PRIORITY_TASK(); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */\r
traceTASK_SWITCHED_IN();\r
\r
#if ( configUSE_NEWLIB_REENTRANT == 1 )\r
\r
This function assumes that a check has already been made to ensure that\r
pxEventList is not empty. */\r
- pxUnblockedTCB = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList );\r
+ pxUnblockedTCB = listGET_OWNER_OF_HEAD_ENTRY( pxEventList ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */\r
configASSERT( pxUnblockedTCB );\r
( void ) uxListRemove( &( pxUnblockedTCB->xEventListItem ) );\r
\r
\r
/* Remove the event list form the event flag. Interrupts do not access\r
event flags. */\r
- pxUnblockedTCB = ( TCB_t * ) listGET_LIST_ITEM_OWNER( pxEventListItem );\r
+ pxUnblockedTCB = listGET_LIST_ITEM_OWNER( pxEventListItem ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */\r
configASSERT( pxUnblockedTCB );\r
( void ) uxListRemove( pxEventListItem );\r
\r
const TickType_t xElapsedTime = xConstTickCount - pxTimeOut->xTimeOnEntering;\r
\r
#if( INCLUDE_xTaskAbortDelay == 1 )\r
- if( pxCurrentTCB->ucDelayAborted != pdFALSE )\r
+ if( pxCurrentTCB->ucDelayAborted != ( uint8_t ) pdFALSE )\r
{\r
/* The delay was aborted, which is not the same as a time out,\r
but has the same result. */\r
UBaseType_t uxTaskGetTaskNumber( TaskHandle_t xTask )\r
{\r
UBaseType_t uxReturn;\r
- TCB_t *pxTCB;\r
+ TCB_t const *pxTCB;\r
\r
if( xTask != NULL )\r
{\r
\r
void vTaskSetTaskNumber( TaskHandle_t xTask, const UBaseType_t uxHandle )\r
{\r
- TCB_t *pxTCB;\r
+ TCB_t * pxTCB;\r
\r
if( xTask != NULL )\r
{\r
static void prvInitialiseTaskLists( void )\r
{\r
UBaseType_t uxPriority;\r
+PRIVILEGED_DATA static List_t xDelayedTaskList1; /*< Delayed tasks. */\r
+PRIVILEGED_DATA static List_t xDelayedTaskList2; /*< Delayed tasks (two lists are used - one for delays that have overflowed the current tick count. */\r
\r
for( uxPriority = ( UBaseType_t ) 0U; uxPriority < ( UBaseType_t ) configMAX_PRIORITIES; uxPriority++ )\r
{\r
{\r
taskENTER_CRITICAL();\r
{\r
- pxTCB = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) );\r
+ pxTCB = listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */\r
( void ) uxListRemove( &( pxTCB->xStateListItem ) );\r
--uxCurrentNumberOfTasks;\r
--uxDeletedTasksWaitingCleanUp;\r
\r
if( listCURRENT_LIST_LENGTH( pxList ) > ( UBaseType_t ) 0 )\r
{\r
- listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList );\r
+ listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */\r
\r
/* Populate an TaskStatus_t structure within the\r
pxTaskStatusArray array for each task that is referenced from\r
meaning of each TaskStatus_t structure member. */\r
do\r
{\r
- listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList );\r
+ listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */\r
vTaskGetInfo( ( TaskHandle_t ) pxNextTCB, &( pxTaskStatusArray[ uxTask ] ), pdTRUE, eState );\r
uxTask++;\r
} while( pxNextTCB != pxFirstTCB );\r
vPortFree( pxTCB->pxStack );\r
vPortFree( pxTCB );\r
}\r
- #elif( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 Macro has been consolidated for readability reasons. */\r
+ #elif( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */\r
{\r
/* The task could have been allocated statically or dynamically, so\r
check what was statically allocated before trying to free the\r
the item at the head of the delayed list. This is the time at\r
which the task at the head of the delayed list should be removed\r
from the Blocked state. */\r
- ( pxTCB ) = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedTaskList );\r
+ ( pxTCB ) = listGET_OWNER_OF_HEAD_ENTRY( pxDelayedTaskList ); /*lint !e9079 void * is used as this macro is used with timers and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */\r
xNextTaskUnblockTime = listGET_LIST_ITEM_VALUE( &( ( pxTCB )->xStateListItem ) );\r
}\r
}\r
\r
BaseType_t xTaskPriorityInherit( TaskHandle_t const pxMutexHolder )\r
{\r
- TCB_t * const pxMutexHolderTCB = ( TCB_t * ) pxMutexHolder;\r
+ TCB_t * const pxMutexHolderTCB = pxMutexHolder;\r
BaseType_t xReturn = pdFALSE;\r
\r
/* If the mutex was given back by an interrupt while the queue was\r
\r
BaseType_t xTaskPriorityDisinherit( TaskHandle_t const pxMutexHolder )\r
{\r
- TCB_t * const pxTCB = ( TCB_t * ) pxMutexHolder;\r
+ TCB_t * const pxTCB = pxMutexHolder;\r
BaseType_t xReturn = pdFALSE;\r
\r
if( pxMutexHolder != NULL )\r
\r
void vTaskPriorityDisinheritAfterTimeout( TaskHandle_t const pxMutexHolder, UBaseType_t uxHighestPriorityWaitingTask )\r
{\r
- TCB_t * const pxTCB = ( TCB_t * ) pxMutexHolder;\r
+ TCB_t * const pxTCB = pxMutexHolder;\r
UBaseType_t uxPriorityUsedOnEntry, uxPriorityToUse;\r
const UBaseType_t uxOnlyOneMutexHeld = ( UBaseType_t ) 1;\r
\r
}\r
\r
/* Terminate. */\r
- pcBuffer[ x ] = 0x00;\r
+ pcBuffer[ x ] = ( char ) 0x00;\r
\r
/* Return the new end of string. */\r
return &( pcBuffer[ x ] );\r
void vTaskList( char * pcWriteBuffer )\r
{\r
TaskStatus_t *pxTaskStatusArray;\r
- volatile UBaseType_t uxArraySize, x;\r
+ UBaseType_t uxArraySize, x;\r
char cStatus;\r
\r
/*\r
\r
\r
/* Make sure the write buffer does not contain a string. */\r
- *pcWriteBuffer = 0x00;\r
+ *pcWriteBuffer = ( char ) 0x00;\r
\r
/* Take a snapshot of the number of tasks in case it changes while this\r
function is executing. */\r
/* Allocate an array index for each task. NOTE! if\r
configSUPPORT_DYNAMIC_ALLOCATION is set to 0 then pvPortMalloc() will\r
equate to NULL. */\r
- pxTaskStatusArray = pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) );\r
+ pxTaskStatusArray = pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation allocates a struct that has the alignment requirements of a pointer. */\r
\r
if( pxTaskStatusArray != NULL )\r
{\r
case eDeleted: cStatus = tskDELETED_CHAR;\r
break;\r
\r
+ case eInvalid: /* Fall through. */\r
default: /* Should not get here, but it is included\r
to prevent static checking errors. */\r
- cStatus = 0x00;\r
+ cStatus = ( char ) 0x00;\r
break;\r
}\r
\r
pcWriteBuffer = prvWriteNameToBuffer( pcWriteBuffer, pxTaskStatusArray[ x ].pcTaskName );\r
\r
/* Write the rest of the string. */\r
- sprintf( pcWriteBuffer, "\t%c\t%u\t%u\t%u\r\n", cStatus, ( unsigned int ) pxTaskStatusArray[ x ].uxCurrentPriority, ( unsigned int ) pxTaskStatusArray[ x ].usStackHighWaterMark, ( unsigned int ) pxTaskStatusArray[ x ].xTaskNumber );\r
- pcWriteBuffer += strlen( pcWriteBuffer );\r
+ sprintf( pcWriteBuffer, "\t%c\t%u\t%u\t%u\r\n", cStatus, ( unsigned int ) pxTaskStatusArray[ x ].uxCurrentPriority, ( unsigned int ) pxTaskStatusArray[ x ].usStackHighWaterMark, ( unsigned int ) pxTaskStatusArray[ x ].xTaskNumber ); /*lint !e586 sprintf() allowed as this is compiled with many compilers and this is a utility function only - not part of the core kernel implementation. */\r
+ pcWriteBuffer += strlen( pcWriteBuffer ); /*lint !e9016 Pointer arithmetic ok on char pointers. */\r
}\r
\r
/* Free the array again. NOTE! If configSUPPORT_DYNAMIC_ALLOCATION\r
void vTaskGetRunTimeStats( char *pcWriteBuffer )\r
{\r
TaskStatus_t *pxTaskStatusArray;\r
- volatile UBaseType_t uxArraySize, x;\r
+ UBaseType_t uxArraySize, x;\r
uint32_t ulTotalTime, ulStatsAsPercentage;\r
\r
#if( configUSE_TRACE_FACILITY != 1 )\r
*/\r
\r
/* Make sure the write buffer does not contain a string. */\r
- *pcWriteBuffer = 0x00;\r
+ *pcWriteBuffer = ( char ) 0x00;\r
\r
/* Take a snapshot of the number of tasks in case it changes while this\r
function is executing. */\r
/* Allocate an array index for each task. NOTE! If\r
configSUPPORT_DYNAMIC_ALLOCATION is set to 0 then pvPortMalloc() will\r
equate to NULL. */\r
- pxTaskStatusArray = pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) );\r
+ pxTaskStatusArray = pvPortMalloc( uxCurrentNumberOfTasks * sizeof( TaskStatus_t ) ); /*lint !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack and this allocation allocates a struct that has the alignment requirements of a pointer. */\r
\r
if( pxTaskStatusArray != NULL )\r
{\r
ulTotalTime /= 100UL;\r
\r
/* Avoid divide by zero errors. */\r
- if( ulTotalTime > 0 )\r
+ if( ulTotalTime > 0UL )\r
{\r
/* Create a human readable table from the binary data. */\r
for( x = 0; x < uxArraySize; x++ )\r
{\r
/* sizeof( int ) == sizeof( long ) so a smaller\r
printf() library can be used. */\r
- sprintf( pcWriteBuffer, "\t%u\t\t%u%%\r\n", ( unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter, ( unsigned int ) ulStatsAsPercentage );\r
+ sprintf( pcWriteBuffer, "\t%u\t\t%u%%\r\n", ( unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter, ( unsigned int ) ulStatsAsPercentage ); /*lint !e586 sprintf() allowed as this is compiled with many compilers and this is a utility function only - not part of the core kernel implementation. */\r
}\r
#endif\r
}\r
{\r
/* sizeof( int ) == sizeof( long ) so a smaller\r
printf() library can be used. */\r
- sprintf( pcWriteBuffer, "\t%u\t\t<1%%\r\n", ( unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter );\r
+ sprintf( pcWriteBuffer, "\t%u\t\t<1%%\r\n", ( unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter ); /*lint !e586 sprintf() allowed as this is compiled with many compilers and this is a utility function only - not part of the core kernel implementation. */\r
}\r
#endif\r
}\r
\r
- pcWriteBuffer += strlen( pcWriteBuffer );\r
+ pcWriteBuffer += strlen( pcWriteBuffer ); /*lint !e9016 Pointer arithmetic ok on char pointers. */\r
}\r
}\r
else\r
/* The task is being notified without its notify value being\r
updated. */\r
break;\r
+\r
+ default:\r
+ /* Should not get here if all enums are handled.\r
+ Artificially force an assert. */\r
+ configASSERT( ( volatile uint32_t ) 0 );\r
+\r
+ break;\r
}\r
\r
traceTASK_NOTIFY();\r
/* The task is being notified without its notify value being\r
updated. */\r
break;\r
+\r
+ default:\r
+ /* Should not get here if all enums are handled.\r
+ Artificially force an assert. */\r
+ configASSERT( ( volatile uint32_t ) 0 );\r
+ break;\r
}\r
\r
traceTASK_NOTIFY_FROM_ISR();\r
{\r
/* The current task must be in a ready list, so there is no need to\r
check, and the port reset macro can be called directly. */\r
- portRESET_READY_PRIORITY( pxCurrentTCB->uxPriority, uxTopReadyPriority );\r
+ portRESET_READY_PRIORITY( pxCurrentTCB->uxPriority, uxTopReadyPriority ); /*lint !e931 pxCurrentTCB cannot change as it is the calling task. pxCurrentTCB->uxPriority and uxTopReadyPriority cannot change as called with scheduler suspended or in a critical section. */\r
}\r
else\r
{\r