* \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER\r
* \ingroup LinkedList\r
*/\r
-#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner ) ( pxListItem )->pvOwner = ( void * ) ( pxOwner )\r
+#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner ) ( ( pxListItem )->pvOwner = ( void * ) ( pxOwner ) )\r
\r
/*\r
* Access macro to get the owner of a list item. The owner of a list item\r
* \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE\r
* \ingroup LinkedList\r
*/\r
-#define listSET_LIST_ITEM_VALUE( pxListItem, xValue ) ( pxListItem )->xItemValue = ( xValue )\r
+#define listSET_LIST_ITEM_VALUE( pxListItem, xValue ) ( ( pxListItem )->xItemValue = ( xValue ) )\r
\r
/*\r
* Access macro to retrieve the value of the list item. The value can\r
* \page listLIST_IS_EMPTY listLIST_IS_EMPTY\r
* \ingroup LinkedList\r
*/\r
-#define listLIST_IS_EMPTY( pxList ) ( ( pxList )->uxNumberOfItems == ( unsigned portBASE_TYPE ) 0 )\r
+#define listLIST_IS_EMPTY( pxList ) ( ( portBASE_TYPE ) ( ( pxList )->uxNumberOfItems == ( unsigned portBASE_TYPE ) 0 ) )\r
\r
/*\r
* Access macro to return the number of items in the list.\r
* \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY\r
* \ingroup LinkedList\r
*/\r
-#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \\r
-{ \\r
-xList * const pxConstList = ( pxList ); \\r
- /* Increment the index to the next item and return the item, ensuring */ \\r
- /* we don't return the marker used at the end of the list. */ \\r
- ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \\r
- if( ( pxConstList )->pxIndex == ( xListItem * ) &( ( pxConstList )->xListEnd ) ) \\r
- { \\r
- ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \\r
- } \\r
- ( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \\r
+#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \\r
+{ \\r
+xList * const pxConstList = ( pxList ); \\r
+ /* Increment the index to the next item and return the item, ensuring */ \\r
+ /* we don't return the marker used at the end of the list. */ \\r
+ ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \\r
+ if( ( void * ) ( pxConstList )->pxIndex == ( void * ) &( ( pxConstList )->xListEnd ) ) \\r
+ { \\r
+ ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \\r
+ } \\r
+ ( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \\r
}\r
\r
\r
* @return pdTRUE is the list item is in the list, otherwise pdFALSE.\r
* pointer against\r
*/\r
-#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( pxListItem )->pvContainer == ( void * ) ( pxList ) )\r
+#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( portBASE_TYPE ) ( ( pxListItem )->pvContainer == ( void * ) ( pxList ) ) )\r
\r
/*\r
* Return the list a list item is contained within (referenced from).\r
***************************************************************************\r
\r
\r
- http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+ http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
license and Real Time Engineers Ltd. contact details.\r
\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
fully thread aware and reentrant UDP/IP stack.\r
\r
- http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
- Integrity Systems, who sell the code with commercial support, \r
+ http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
+ Integrity Systems, who sell the code with commercial support,\r
indemnification and middleware, under the OpenRTOS brand.\r
- \r
- http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
- engineered and independently SIL3 certified version for use in safety and \r
+\r
+ http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+ engineered and independently SIL3 certified version for use in safety and\r
mission critical applications that require provable dependability.\r
*/\r
\r
#endif\r
\r
#ifdef IAR_MSP430\r
- #include "..\..\Source\portable\IAR\MSP430\portmacro.h" \r
+ #include "..\..\Source\portable\IAR\MSP430\portmacro.h"\r
#endif\r
- \r
+\r
#ifdef GCC_MSP430\r
#include "../../Source/portable/GCC/MSP430F449/portmacro.h"\r
#endif\r
#ifdef STR75X_IAR\r
#include "..\..\Source\portable\IAR\STR75x\portmacro.h"\r
#endif\r
- \r
+\r
#ifdef STR75X_GCC\r
#include "..\..\Source\portable\GCC\STR75x\portmacro.h"\r
#endif\r
#ifdef STR91X_IAR\r
#include "..\..\Source\portable\IAR\STR91x\portmacro.h"\r
#endif\r
- \r
+\r
#ifdef GCC_H8S\r
#include "../../Source/portable/GCC/H8S2329/portmacro.h"\r
#endif\r
#ifdef IAR_ARMCM3_LM\r
#include "../../Source/portable/IAR/ARM_CM3/portmacro.h"\r
#endif\r
- \r
+\r
#ifdef HCS12_CODE_WARRIOR\r
#include "../../Source/portable/CodeWarrior/HCS12/portmacro.h"\r
-#endif \r
+#endif\r
\r
#ifdef MICROBLAZE_GCC\r
#include "../../Source/portable/GCC/MicroBlaze/portmacro.h"\r
#ifdef __IAR_78K0R_Kx3__\r
#include "../../Source/portable/IAR/78K0R/portmacro.h"\r
#endif\r
- \r
+\r
#ifdef __IAR_78K0R_Kx3L__\r
#include "../../Source/portable/IAR/78K0R/portmacro.h"\r
#endif\r
- \r
+\r
/* Catch all to ensure portmacro.h is included in the build. Newer demos\r
have the path as part of the project options, rather than as relative from\r
the project location. If portENTER_CRITICAL() has not been defined then\r
portENTER_CRITICAL() definition. Check the demo application for your demo\r
to find the path to the correct portmacro.h file. */\r
#ifndef portENTER_CRITICAL\r
- #include "portmacro.h" \r
+ #include "portmacro.h"\r
#endif\r
- \r
+\r
#if portBYTE_ALIGNMENT == 8\r
#define portBYTE_ALIGNMENT_MASK ( 0x0007 )\r
#endif\r
#if( portUSING_MPU_WRAPPERS == 1 )\r
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters, portBASE_TYPE xRunPrivileged ) PRIVILEGED_FUNCTION;\r
#else\r
- portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters );\r
+ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters ) PRIVILEGED_FUNCTION;\r
#endif\r
\r
/*\r
* Fills the xMPUSettings structure with the memory region information\r
* contained in xRegions.\r
*/\r
-#if( portUSING_MPU_WRAPPERS == 1 ) \r
+#if( portUSING_MPU_WRAPPERS == 1 )\r
struct xMEMORY_REGION;\r
void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, portSTACK_TYPE *pxBottomOfStack, unsigned short usStackDepth ) PRIVILEGED_FUNCTION;\r
#endif\r
/* Defines the prototype to which task functions must conform. */\r
typedef void (*pdTASK_CODE)( void * );\r
\r
-#define pdTRUE ( 1 )\r
-#define pdFALSE ( 0 )\r
+#define pdFALSE ( ( portBASE_TYPE ) 0 )\r
+#define pdTRUE ( ( portBASE_TYPE ) 1 )\r
\r
-#define pdPASS ( 1 )\r
-#define pdFAIL ( 0 )\r
-#define errQUEUE_EMPTY ( 0 )\r
-#define errQUEUE_FULL ( 0 )\r
+#define pdPASS ( pdTRUE )\r
+#define pdFAIL ( pdFALSE )\r
+#define errQUEUE_EMPTY ( ( portBASE_TYPE ) 0 )\r
+#define errQUEUE_FULL ( ( portBASE_TYPE ) 0 )\r
\r
/* Error definitions. */\r
#define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 )\r
#endif\r
\r
\r
-#include "mpu_wrappers.h"\r
-\r
/**\r
* Type by which queues are referenced. For example, a call to xQueueCreate()\r
* returns an xQueueHandle variable that can then be used as a parameter to\r
typedef void * xQueueSetMemberHandle;\r
\r
/* For internal use only. */\r
-#define queueSEND_TO_BACK ( 0 )\r
-#define queueSEND_TO_FRONT ( 1 )\r
-#define queueOVERWRITE ( 2 )\r
+#define queueSEND_TO_BACK ( ( portBASE_TYPE ) 0 )\r
+#define queueSEND_TO_FRONT ( ( portBASE_TYPE ) 1 )\r
+#define queueOVERWRITE ( ( portBASE_TYPE ) 2 )\r
\r
/* For internal use only. These definitions *must* match those in queue.c. */\r
-#define queueQUEUE_TYPE_BASE ( 0U )\r
-#define queueQUEUE_TYPE_SET ( 0U )\r
-#define queueQUEUE_TYPE_MUTEX ( 1U )\r
-#define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( 2U )\r
-#define queueQUEUE_TYPE_BINARY_SEMAPHORE ( 3U )\r
-#define queueQUEUE_TYPE_RECURSIVE_MUTEX ( 4U )\r
+#define queueQUEUE_TYPE_BASE ( ( unsigned char ) 0U )\r
+#define queueQUEUE_TYPE_SET ( ( unsigned char ) 0U )\r
+#define queueQUEUE_TYPE_MUTEX ( ( unsigned char ) 1U )\r
+#define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( ( unsigned char ) 2U )\r
+#define queueQUEUE_TYPE_BINARY_SEMAPHORE ( ( unsigned char ) 3U )\r
+#define queueQUEUE_TYPE_RECURSIVE_MUTEX ( ( unsigned char ) 4U )\r
\r
/**\r
* queue. h\r
* \defgroup xQueuePeekFromISR xQueuePeekFromISR\r
* \ingroup QueueManagement\r
*/\r
-signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, void * const pvBuffer ) PRIVILEGED_FUNCTION;\r
+signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, const void * const pvBuffer ) PRIVILEGED_FUNCTION;\r
\r
/**\r
* queue. h\r
* \defgroup xQueueReceive xQueueReceive\r
* \ingroup QueueManagement\r
*/\r
-signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeek ) PRIVILEGED_FUNCTION;\r
+signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, const void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeek ) PRIVILEGED_FUNCTION;\r
\r
/**\r
* queue. h\r
* \defgroup xQueueReceiveFromISR xQueueReceiveFromISR\r
* \ingroup QueueManagement\r
*/\r
-signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;\r
+signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, const void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;\r
\r
/*\r
* Utilities to query queues that are safe to use from an ISR. These utilities\r
* @param pcName The name to be associated with the handle. This is the\r
* name that the kernel aware debugger will display.\r
*/\r
-#if configQUEUE_REGISTRY_SIZE > 0U\r
+#if configQUEUE_REGISTRY_SIZE > 0\r
void vQueueAddToRegistry( xQueueHandle xQueue, signed char *pcName ) PRIVILEGED_FUNCTION;\r
#endif\r
\r
*\r
* @param xQueue The handle of the queue being removed from the registry.\r
*/\r
-#if configQUEUE_REGISTRY_SIZE > 0U\r
+#if configQUEUE_REGISTRY_SIZE > 0\r
void vQueueUnregisterQueue( xQueueHandle xQueue ) PRIVILEGED_FUNCTION;\r
#endif\r
\r
*/\r
\r
\r
-#ifndef TASK_H\r
-#define TASK_H\r
+#ifndef INC_TASK_H\r
+#define INC_TASK_H\r
\r
#ifndef INC_FREERTOS_H\r
#error "include FreeRTOS.h must appear in source files before include task.h"\r
#define taskENABLE_INTERRUPTS() portENABLE_INTERRUPTS()\r
\r
/* Definitions returned by xTaskGetSchedulerState(). */\r
-#define taskSCHEDULER_NOT_STARTED 0\r
-#define taskSCHEDULER_RUNNING 1\r
-#define taskSCHEDULER_SUSPENDED 2\r
+#define taskSCHEDULER_NOT_STARTED ( ( portBASE_TYPE ) 0 )\r
+#define taskSCHEDULER_RUNNING ( ( portBASE_TYPE ) 1 )\r
+#define taskSCHEDULER_SUSPENDED ( ( portBASE_TYPE ) 2 )\r
\r
/*-----------------------------------------------------------\r
* TASK CREATION API\r
\r
/**\r
* task. h\r
- * <pre>signed portBASE_TYPE xTaskIsTaskSuspended( xTaskHandle xTask );</pre>\r
+ * <pre>signed portBASE_TYPE xTaskIsTaskSuspended( const xTaskHandle xTask );</pre>\r
*\r
* Utility task that simply returns pdTRUE if the task referenced by xTask is\r
* currently in the Suspended state, or pdFALSE if the task referenced by xTask\r
* portTICK_RATE_MS can be used to convert kernel ticks into a real time\r
* period.\r
*/\r
-void vTaskPlaceOnEventList( const xList * const pxEventList, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;\r
+void vTaskPlaceOnEventList( xList * const pxEventList, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;\r
\r
/*\r
* THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN\r
* @return pdTRUE if the task being removed has a higher priority than the task\r
* making the call, otherwise pdFALSE.\r
*/\r
-void vTaskPlaceOnEventListRestricted( const xList * const pxEventList, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;\r
+void vTaskPlaceOnEventListRestricted( xList * const pxEventList, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;\r
\r
/*\r
* THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS AN\r
* Raises the priority of the mutex holder to that of the calling task should\r
* the mutex holder have a priority less than the calling task.\r
*/\r
-void vTaskPriorityInherit( xTaskHandle * const pxMutexHolder ) PRIVILEGED_FUNCTION;\r
+void vTaskPriorityInherit( xTaskHandle const pxMutexHolder ) PRIVILEGED_FUNCTION;\r
\r
/*\r
* Set the priority of a task back to its proper priority in the case that it\r
* inherited a higher priority while it was holding a semaphore.\r
*/\r
-void vTaskPriorityDisinherit( xTaskHandle * const pxMutexHolder ) PRIVILEGED_FUNCTION;\r
+void vTaskPriorityDisinherit( xTaskHandle const pxMutexHolder ) PRIVILEGED_FUNCTION;\r
\r
/*\r
* Generic version of the task creation function which is in turn called by the\r
#ifdef __cplusplus\r
}\r
#endif\r
-#endif /* TASK_H */\r
+#endif /* INC_TASK_H */\r
\r
\r
\r
#error "include FreeRTOS.h must appear in source files before include timers.h"\r
#endif\r
\r
-#include "portable.h"\r
-#include "list.h"\r
+/*lint -e537 This headers are only multiply included if the application code\r
+happens to also be including task.h. */\r
#include "task.h"\r
+/*lint +e956 */\r
\r
#ifdef __cplusplus\r
extern "C" {\r
/* IDs for commands that can be sent/received on the timer queue. These are to\r
be used solely through the macros that make up the public software timer API,\r
as defined below. */\r
-#define tmrCOMMAND_START 0\r
-#define tmrCOMMAND_STOP 1\r
-#define tmrCOMMAND_CHANGE_PERIOD 2\r
-#define tmrCOMMAND_DELETE 3\r
+#define tmrCOMMAND_START ( ( portBASE_TYPE ) 0 )\r
+#define tmrCOMMAND_STOP ( ( portBASE_TYPE ) 1 )\r
+#define tmrCOMMAND_CHANGE_PERIOD ( ( portBASE_TYPE ) 2 )\r
+#define tmrCOMMAND_DELETE ( ( portBASE_TYPE ) 3 )\r
\r
/*-----------------------------------------------------------\r
* MACROS AND DEFINITIONS\r
/* The list structure contains a list item which is used to mark the\r
end of the list. To initialise the list the list end is inserted\r
as the only list entry. */\r
- pxList->pxIndex = ( xListItem * ) &( pxList->xListEnd );\r
+ pxList->pxIndex = ( xListItem * ) &( pxList->xListEnd ); /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */\r
\r
/* The list end value is the highest possible value in the list to\r
ensure it remains at the end of the list. */\r
\r
/* The list end next and previous pointers point to itself so we know\r
when the list is empty. */\r
- pxList->xListEnd.pxNext = ( xListItem * ) &( pxList->xListEnd );\r
- pxList->xListEnd.pxPrevious = ( xListItem * ) &( pxList->xListEnd );\r
+ pxList->xListEnd.pxNext = ( xListItem * ) &( pxList->xListEnd ); /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */\r
+ pxList->xListEnd.pxPrevious = ( xListItem * ) &( pxList->xListEnd );/*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */\r
\r
pxList->uxNumberOfItems = ( unsigned portBASE_TYPE ) 0U;\r
}\r
See http://www.freertos.org/FAQHelp.html for more tips.\r
**********************************************************************/\r
\r
- for( pxIterator = ( xListItem * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext )\r
+ for( pxIterator = ( xListItem * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */\r
{\r
/* There is nothing to do here, we are just iterating to the\r
wanted insertion position. */\r
\r
#if( configUSE_16_BIT_TICKS == 1 )\r
typedef unsigned portSHORT portTickType;\r
- #define portMAX_DELAY ( portTickType ) 0xffff\r
+ #define portMAX_DELAY 0xffff\r
#else\r
typedef unsigned portLONG portTickType;\r
- #define portMAX_DELAY ( portTickType ) 0xffffffff\r
+ #define portMAX_DELAY 0xffffffffUL\r
#endif\r
/*-----------------------------------------------------------*/\r
\r
\r
/* Scheduler utilities. */\r
extern void vPortYield( void );\r
-#define portNVIC_INT_CTRL_REG ( * ( ( volatile unsigned long * ) 0xe000ed04 ) )\r
+#define portNVIC_INT_CTRL_REG ( * ( ( volatile unsigned long * ) 0xe000ed04UL ) )\r
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )\r
#define portYIELD() vPortYield()\r
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT\r
#endif\r
\r
/* Store/clear the ready priorities in a bit map. */\r
- #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )\r
- #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )\r
+ #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) ) )\r
+ #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) ) )\r
\r
/*-----------------------------------------------------------*/\r
\r
#include "croutine.h"\r
#endif\r
\r
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\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
+\r
\r
/* Constants used with the cRxLock and xTxLock structure members. */\r
#define queueUNLOCKED ( ( signed portBASE_TYPE ) -1 )\r
#define queueLOCKED_UNMODIFIED ( ( signed portBASE_TYPE ) 0 )\r
\r
-#define queueERRONEOUS_UNBLOCK ( -1 )\r
-\r
/* When the xQUEUE structure is used to represent a base queue its pcHead and\r
pcTail members are used as pointers into the queue storage area. When the\r
xQUEUE structure is used to represent a mutex pcHead and pcTail pointers are\r
/* Semaphores do not actually store or copy data, so have an item size of\r
zero. */\r
#define queueSEMAPHORE_QUEUE_ITEM_LENGTH ( ( unsigned portBASE_TYPE ) 0 )\r
-#define queueDONT_BLOCK ( ( portTickType ) 0U )\r
#define queueMUTEX_GIVE_BLOCK_TIME ( ( portTickType ) 0U )\r
\r
\r
/*\r
* Copies an item out of a queue.\r
*/\r
-static void prvCopyDataFromQueue( xQUEUE * const pxQueue, const void *pvBuffer ) PRIVILEGED_FUNCTION;\r
+static void prvCopyDataFromQueue( xQUEUE * const pxQueue, const void * const pvBuffer ) PRIVILEGED_FUNCTION;\r
\r
#if ( configUSE_QUEUE_SETS == 1 )\r
/*\r
* Checks to see if a queue is a member of a queue set, and if so, notifies\r
* the queue set that the queue contains data.\r
*/\r
- static portBASE_TYPE prvNotifyQueueSetContainer( xQUEUE *pxQueue, portBASE_TYPE xCopyPosition ) PRIVILEGED_FUNCTION;\r
+ static portBASE_TYPE prvNotifyQueueSetContainer( const xQUEUE * const pxQueue, portBASE_TYPE xCopyPosition ) PRIVILEGED_FUNCTION;\r
#endif\r
\r
/*-----------------------------------------------------------*/\r
{\r
/* Create the list of pointers to queue items. The queue is one byte\r
longer than asked for to make wrap checking easier/faster. */\r
- xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ) + ( size_t ) 1;\r
+ xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ) + ( size_t ) 1; /*lint !e961 MISRA exception as the casts are only redundant for some ports. */\r
\r
pxNewQueue->pcHead = ( signed char * ) pvPortMalloc( xQueueSizeInBytes );\r
if( pxNewQueue->pcHead != NULL )\r
queue type is defined. */\r
pxNewQueue->uxLength = uxQueueLength;\r
pxNewQueue->uxItemSize = uxItemSize;\r
- xQueueGenericReset( pxNewQueue, pdTRUE );\r
+ ( void ) xQueueGenericReset( pxNewQueue, pdTRUE );\r
\r
#if ( configUSE_TRACE_FACILITY == 1 )\r
{\r
traceCREATE_MUTEX( pxNewQueue );\r
\r
/* Start with the semaphore in the expected state. */\r
- xQueueGenericSend( pxNewQueue, NULL, ( portTickType ) 0U, queueSEND_TO_BACK );\r
+ ( void ) xQueueGenericSend( pxNewQueue, NULL, ( portTickType ) 0U, queueSEND_TO_BACK );\r
}\r
else\r
{\r
this is the only condition we are interested in it does not matter if\r
pxMutexHolder is accessed simultaneously by another task. Therefore no\r
mutual exclusion is required to test the pxMutexHolder variable. */\r
- if( pxMutex->pxMutexHolder == ( void * ) xTaskGetCurrentTaskHandle() )\r
+ if( pxMutex->pxMutexHolder == ( void * ) xTaskGetCurrentTaskHandle() ) /*lint !e961 Not a redundant cast as xTaskHandle is a typedef. */\r
{\r
traceGIVE_MUTEX_RECURSIVE( pxMutex );\r
\r
( pxMutex->u.uxRecursiveCallCount )--;\r
\r
/* Have we unwound the call count? */\r
- if( pxMutex->u.uxRecursiveCallCount == 0 )\r
+ if( pxMutex->u.uxRecursiveCallCount == ( unsigned portBASE_TYPE ) 0 )\r
{\r
/* Return the mutex. This will automatically unblock any other\r
task that might be waiting to access the mutex. */\r
- xQueueGenericSend( pxMutex, NULL, queueMUTEX_GIVE_BLOCK_TIME, queueSEND_TO_BACK );\r
+ ( void ) xQueueGenericSend( pxMutex, NULL, queueMUTEX_GIVE_BLOCK_TIME, queueSEND_TO_BACK );\r
}\r
\r
xReturn = pdPASS;\r
\r
traceTAKE_MUTEX_RECURSIVE( pxMutex );\r
\r
- if( pxMutex->pxMutexHolder == ( void * ) xTaskGetCurrentTaskHandle() )\r
+ if( pxMutex->pxMutexHolder == ( void * ) xTaskGetCurrentTaskHandle() ) /*lint !e961 Cast is not redundant as xTaskHandle is a typedef. */\r
{\r
( pxMutex->u.uxRecursiveCallCount )++;\r
xReturn = pdPASS;\r
{\r
xQueueHandle xHandle;\r
\r
- xHandle = xQueueGenericCreate( ( unsigned portBASE_TYPE ) uxCountValue, queueSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_COUNTING_SEMAPHORE );\r
+ xHandle = xQueueGenericCreate( uxCountValue, queueSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_COUNTING_SEMAPHORE );\r
\r
if( xHandle != NULL )\r
{\r
vTaskSetTimeOutState( &xTimeOut );\r
xEntryTimeSet = pdTRUE;\r
}\r
+ else\r
+ {\r
+ /* Entry time was already set. */ \r
+ }\r
}\r
}\r
taskEXIT_CRITICAL();\r
}\r
/*-----------------------------------------------------------*/\r
\r
-signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking )\r
+signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, const void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking )\r
{\r
signed portBASE_TYPE xEntryTimeSet = pdFALSE;\r
xTimeOutType xTimeOut;\r
{\r
/* Record the information required to implement\r
priority inheritance should it become necessary. */\r
- pxQueue->pxMutexHolder = ( void * ) xTaskGetCurrentTaskHandle();\r
+ pxQueue->pxMutexHolder = ( void * ) xTaskGetCurrentTaskHandle(); /*lint !e961 Cast is not redundant as xTaskHandle is a typedef. */\r
}\r
}\r
#endif\r
vTaskSetTimeOutState( &xTimeOut );\r
xEntryTimeSet = pdTRUE;\r
}\r
+ else\r
+ {\r
+ /* Entry time was already set. */\r
+ }\r
}\r
}\r
taskEXIT_CRITICAL();\r
}\r
/*-----------------------------------------------------------*/\r
\r
-signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken )\r
+signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, const void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken )\r
{\r
signed portBASE_TYPE xReturn;\r
unsigned portBASE_TYPE uxSavedInterruptStatus;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, void * const pvBuffer )\r
+signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, const void * const pvBuffer )\r
{\r
signed portBASE_TYPE xReturn;\r
unsigned portBASE_TYPE uxSavedInterruptStatus;\r
taskEXIT_CRITICAL();\r
\r
return uxReturn;\r
-}\r
+} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */\r
/*-----------------------------------------------------------*/\r
\r
unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle xQueue )\r
uxReturn = ( ( xQUEUE * ) xQueue )->uxMessagesWaiting;\r
\r
return uxReturn;\r
-}\r
+} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */\r
/*-----------------------------------------------------------*/\r
\r
void vQueueDelete( xQueueHandle xQueue )\r
}\r
else if( xPosition == queueSEND_TO_BACK )\r
{\r
- memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( size_t ) pxQueue->uxItemSize );\r
+ ( void ) memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 !e418 MISRA exception as the casts are only redundant for some ports, plus previous logic ensures a null pointer can only be passed to memcpy() if the copy size is 0. */\r
pxQueue->pcWriteTo += pxQueue->uxItemSize;\r
- if( pxQueue->pcWriteTo >= pxQueue->pcTail )\r
+ if( pxQueue->pcWriteTo >= pxQueue->pcTail ) /*lint !e946 MISRA exception justified as comparison of pointers is the cleanest solution. */\r
{\r
pxQueue->pcWriteTo = pxQueue->pcHead;\r
}\r
}\r
else\r
{\r
- memcpy( ( void * ) pxQueue->u.pcReadFrom, pvItemToQueue, ( size_t ) pxQueue->uxItemSize );\r
+ ( void ) memcpy( ( void * ) pxQueue->u.pcReadFrom, pvItemToQueue, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */\r
pxQueue->u.pcReadFrom -= pxQueue->uxItemSize;\r
- if( pxQueue->u.pcReadFrom < pxQueue->pcHead )\r
+ if( pxQueue->u.pcReadFrom < pxQueue->pcHead ) /*lint !e946 MISRA exception justified as comparison of pointers is the cleanest solution. */\r
{\r
pxQueue->u.pcReadFrom = ( pxQueue->pcTail - pxQueue->uxItemSize );\r
}\r
\r
if( xPosition == queueOVERWRITE )\r
{\r
- if( pxQueue->uxMessagesWaiting > 0 )\r
+ if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )\r
{\r
/* An item is not being added but overwritten, so subtract\r
one from the recorded number of items in the queue so when\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvCopyDataFromQueue( xQUEUE * const pxQueue, const void *pvBuffer )\r
+static void prvCopyDataFromQueue( xQUEUE * const pxQueue, const void * const pvBuffer )\r
{\r
if( pxQueue->uxQueueType != queueQUEUE_IS_MUTEX )\r
{\r
pxQueue->u.pcReadFrom += pxQueue->uxItemSize;\r
- if( pxQueue->u.pcReadFrom >= pxQueue->pcTail )\r
+ if( pxQueue->u.pcReadFrom >= pxQueue->pcTail ) /*lint !e946 MISRA exception justified as use of the relational operator is the cleanest solutions. */\r
{\r
pxQueue->u.pcReadFrom = pxQueue->pcHead;\r
}\r
- memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.pcReadFrom, ( size_t ) pxQueue->uxItemSize );\r
+ ( void ) memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.pcReadFrom, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 !e418 MISRA exception as the casts are only redundant for some ports. Also previous logic ensures a null pointer can only be passed to memcpy() when the count is 0. */\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
taskENTER_CRITICAL();\r
{\r
- if( pxQueue->uxMessagesWaiting == 0 )\r
+ if( pxQueue->uxMessagesWaiting == ( unsigned portBASE_TYPE ) 0 )\r
{\r
xReturn = pdTRUE;\r
}\r
signed portBASE_TYPE xReturn;\r
\r
configASSERT( xQueue );\r
- if( ( ( xQUEUE * ) xQueue )->uxMessagesWaiting == 0 )\r
+ if( ( ( xQUEUE * ) xQueue )->uxMessagesWaiting == ( unsigned portBASE_TYPE ) 0 )\r
{\r
xReturn = pdTRUE;\r
}\r
}\r
\r
return xReturn;\r
-}\r
+} /*lint !e818 xQueue could not be pointer to const because it is a typedef. */\r
/*-----------------------------------------------------------*/\r
\r
static signed portBASE_TYPE prvIsQueueFull( const xQUEUE *pxQueue )\r
}\r
\r
return xReturn;\r
-}\r
+} /*lint !e818 xQueue could not be pointer to const because it is a typedef. */\r
/*-----------------------------------------------------------*/\r
\r
#if ( configUSE_CO_ROUTINES == 1 )\r
}\r
}\r
\r
- }\r
+ } /*lint !e818 xQueue could not be pointer to const because it is a typedef. */\r
\r
#endif /* configQUEUE_REGISTRY_SIZE */\r
/*-----------------------------------------------------------*/\r
/* Cannot add a queue/semaphore to more than one queue set. */\r
xReturn = pdFAIL;\r
}\r
- else if( ( ( xQUEUE * ) xQueueOrSemaphore )->uxMessagesWaiting != 0 )\r
+ else if( ( ( xQUEUE * ) xQueueOrSemaphore )->uxMessagesWaiting != ( unsigned portBASE_TYPE ) 0 )\r
{\r
/* Cannot add a queue/semaphore to a queue set if there are already\r
items in the queue/semaphore. */\r
/* The queue was not a member of the set. */\r
xReturn = pdFAIL;\r
}\r
- else if( pxQueueOrSemaphore->uxMessagesWaiting != 0 )\r
+ else if( pxQueueOrSemaphore->uxMessagesWaiting != ( unsigned portBASE_TYPE ) 0 )\r
{\r
/* It is dangerous to remove a queue from a set when the queue is\r
not empty because the queue set will still hold pending events for\r
}\r
\r
return xReturn;\r
- }\r
+ } /*lint !e818 xQueueSet could not be declared as pointing to const as it is a typedef. */\r
\r
#endif /* configUSE_QUEUE_SETS */\r
/*-----------------------------------------------------------*/\r
{\r
xQueueSetMemberHandle xReturn = NULL;\r
\r
- xQueueGenericReceive( ( xQueueHandle ) xQueueSet, &xReturn, xBlockTimeTicks, pdFALSE );\r
+ ( void ) xQueueGenericReceive( ( xQueueHandle ) xQueueSet, &xReturn, xBlockTimeTicks, pdFALSE ); /*lint !e961 Casting from one typedef to another is not redundant. */\r
return xReturn;\r
}\r
\r
{\r
xQueueSetMemberHandle xReturn = NULL;\r
\r
- xQueueReceiveFromISR( ( xQueueHandle ) xQueueSet, &xReturn, NULL );\r
+ ( void ) xQueueReceiveFromISR( ( xQueueHandle ) xQueueSet, &xReturn, NULL ); /*lint !e961 Casting from one typedef to another is not redundant. */\r
return xReturn;\r
}\r
\r
\r
#if ( configUSE_QUEUE_SETS == 1 )\r
\r
- static portBASE_TYPE prvNotifyQueueSetContainer( xQUEUE *pxQueue, portBASE_TYPE xCopyPosition )\r
+ static portBASE_TYPE prvNotifyQueueSetContainer( const xQUEUE * const pxQueue, portBASE_TYPE xCopyPosition )\r
{\r
xQUEUE *pxQueueSetContainer = pxQueue->pxQueueSetContainer;\r
portBASE_TYPE xReturn = pdFALSE;\r
*/\r
\r
/* Standard includes. */\r
-#include <stdio.h>\r
#include <stdlib.h>\r
#include <string.h>\r
\r
#include "timers.h"\r
#include "StackMacros.h"\r
\r
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\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
+\r
+#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configINCLUDE_STATS_FORMATTING_FUNCTIONS == 1 ) )\r
+ /* At the bottom of this file are two optional functions that can be used\r
+ to generate human readable text from the raw data generated by the\r
+ xTaskGetSystemState() function. Note the formatting functions are provided\r
+ for convenience only, and are NOT considered part of the kernel. */\r
+ #include <stdio.h>\r
+#endif /* ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configINCLUDE_STATS_FORMATTING_FUNCTIONS == 1 ) ) */\r
\r
/* Sanity check the configuration. */\r
#if configUSE_TICKLESS_IDLE != 0\r
#define static\r
#endif\r
\r
+/*lint -e956 A manual analysis and inspection has been used to determine which\r
+static variables must be declared volatile. */\r
+\r
PRIVILEGED_DATA tskTCB * volatile pxCurrentTCB = NULL;\r
\r
/* Lists for ready and blocked tasks. --------------------*/\r
PRIVILEGED_DATA static volatile signed portBASE_TYPE xSchedulerRunning = pdFALSE;\r
PRIVILEGED_DATA static volatile unsigned portBASE_TYPE uxSchedulerSuspended = ( unsigned portBASE_TYPE ) pdFALSE;\r
PRIVILEGED_DATA static volatile unsigned portBASE_TYPE uxPendedTicks = ( unsigned portBASE_TYPE ) 0U;\r
-PRIVILEGED_DATA static volatile portBASE_TYPE xYieldPending = ( portBASE_TYPE ) pdFALSE;\r
+PRIVILEGED_DATA static volatile portBASE_TYPE xYieldPending = pdFALSE;\r
PRIVILEGED_DATA static volatile portBASE_TYPE xNumOfOverflows = ( portBASE_TYPE ) 0;\r
PRIVILEGED_DATA static unsigned portBASE_TYPE uxTaskNumber = ( unsigned portBASE_TYPE ) 0U;\r
-PRIVILEGED_DATA static volatile portTickType xNextTaskUnblockTime = ( portTickType ) portMAX_DELAY;\r
+PRIVILEGED_DATA static volatile portTickType xNextTaskUnblockTime = portMAX_DELAY;\r
\r
#if ( configGENERATE_RUN_TIME_STATS == 1 )\r
\r
\r
#endif\r
\r
+/*lint +e956 */\r
+\r
/* Debugging and trace facilities private variables and macros. ------------*/\r
\r
/*\r
#define prvAddTaskToReadyList( pxTCB ) \\r
traceMOVED_TASK_TO_READY_STATE( pxTCB ) \\r
taskRECORD_READY_PRIORITY( ( pxTCB )->uxPriority ); \\r
- vListInsertEnd( ( xList * ) &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xGenericListItem ) )\r
+ vListInsertEnd( &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xGenericListItem ) )\r
/*-----------------------------------------------------------*/\r
\r
/*\r
#if( portSTACK_GROWTH < 0 )\r
{\r
pxTopOfStack = pxNewTCB->pxStack + ( usStackDepth - ( unsigned short ) 1 );\r
- pxTopOfStack = ( portSTACK_TYPE * ) ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack ) & ( ( portPOINTER_SIZE_TYPE ) ~portBYTE_ALIGNMENT_MASK ) );\r
+ pxTopOfStack = ( portSTACK_TYPE * ) ( ( ( 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
\r
/* Check the alignment of the calculated top of stack is correct. */\r
configASSERT( ( ( ( unsigned long ) pxTopOfStack & ( unsigned long ) portBYTE_ALIGNMENT_MASK ) == 0UL ) );\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
- if( uxListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) ) == 0 )\r
+ if( uxListRemove( &( pxTCB->xGenericListItem ) ) == ( unsigned portBASE_TYPE ) 0 )\r
{\r
taskRESET_READY_PRIORITY( pxTCB->uxPriority );\r
}\r
/* Is the task waiting on an event also? */\r
if( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) != NULL )\r
{\r
- uxListRemove( &( pxTCB->xEventListItem ) );\r
+ ( void ) uxListRemove( &( pxTCB->xEventListItem ) );\r
}\r
\r
- vListInsertEnd( ( xList * ) &xTasksWaitingTermination, &( pxTCB->xGenericListItem ) );\r
+ vListInsertEnd( &xTasksWaitingTermination, &( pxTCB->xGenericListItem ) );\r
\r
/* Increment the ucTasksDeleted variable so the idle task knows\r
there is a task that has been deleted and that it should therefore\r
/* Force a reschedule if we have just deleted the current task. */\r
if( xSchedulerRunning != pdFALSE )\r
{\r
- if( ( void * ) xTaskToDelete == NULL )\r
+ if( ( void * ) xTaskToDelete == NULL ) /*lint !e961 MISRA exception as this is not a redundant cast when used with some supported compilers. */\r
{\r
portYIELD_WITHIN_API();\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
- if( uxListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) ) == 0 )\r
+ if( uxListRemove( &( pxCurrentTCB->xGenericListItem ) ) == ( unsigned portBASE_TYPE ) 0 )\r
{\r
/* The current task must be in a ready list, so there is\r
no need to check, and the port reset macro can be called\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
- if( uxListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) ) == 0 )\r
+ if( uxListRemove( &( pxCurrentTCB->xGenericListItem ) ) == ( unsigned portBASE_TYPE ) 0 )\r
{\r
/* The current task must be in a ready list, so there is\r
no need to check, and the port reset macro can be called\r
configASSERT( ( uxNewPriority < configMAX_PRIORITIES ) );\r
\r
/* Ensure the new priority is valid. */\r
- if( uxNewPriority >= configMAX_PRIORITIES )\r
+ if( uxNewPriority >= ( unsigned portBASE_TYPE ) configMAX_PRIORITIES )\r
{\r
- uxNewPriority = configMAX_PRIORITIES - ( unsigned portBASE_TYPE ) 1U;\r
+ uxNewPriority = ( unsigned portBASE_TYPE ) configMAX_PRIORITIES - ( unsigned portBASE_TYPE ) 1U;\r
}\r
\r
taskENTER_CRITICAL();\r
task of higher priority that is ready to execute. */\r
xYieldRequired = pdTRUE;\r
}\r
+ else\r
+ {\r
+ /* Yield not required. */\r
+ }\r
\r
/* Remember the ready list the task might be referenced from\r
before its uxPriority member is changed so the\r
}\r
#endif\r
\r
- listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( configMAX_PRIORITIES - ( portTickType ) uxNewPriority ) );\r
+ listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( ( portTickType ) configMAX_PRIORITIES - ( portTickType ) uxNewPriority ) ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */\r
\r
/* If the task is in the blocked or suspended list we need do\r
nothing more than change it's priority variable. However, if\r
the task is in a ready list it needs to be removed and placed\r
in the queue appropriate to its new priority. */\r
- if( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ uxCurrentPriority ] ), &( pxTCB->xGenericListItem ) ) )\r
+ if( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ uxCurrentPriority ] ), &( pxTCB->xGenericListItem ) ) != pdFALSE )\r
{\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
- if( uxListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) ) == 0 )\r
+ if( uxListRemove( &( pxTCB->xGenericListItem ) ) == ( unsigned portBASE_TYPE ) 0 )\r
{\r
taskRESET_READY_PRIORITY( uxPriorityUsedOnEntry );\r
}\r
traceTASK_SUSPEND( pxTCB );\r
\r
/* Remove task from the ready/delayed list and place in the suspended list. */\r
- if( uxListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) ) == 0 )\r
+ if( uxListRemove( &( pxTCB->xGenericListItem ) ) == ( unsigned portBASE_TYPE ) 0 )\r
{\r
taskRESET_READY_PRIORITY( pxTCB->uxPriority );\r
}\r
/* Is the task waiting on an event also? */\r
if( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) != NULL )\r
{\r
- uxListRemove( &( pxTCB->xEventListItem ) );\r
+ ( void ) uxListRemove( &( pxTCB->xEventListItem ) );\r
}\r
\r
- vListInsertEnd( ( xList * ) &xSuspendedTaskList, &( pxTCB->xGenericListItem ) );\r
+ vListInsertEnd( &xSuspendedTaskList, &( pxTCB->xGenericListItem ) );\r
}\r
taskEXIT_CRITICAL();\r
\r
- if( ( void * ) xTaskToSuspend == NULL )\r
+ if( ( void * ) xTaskToSuspend == NULL ) /*lint !e961 MISRA exception justified because it is not a redundant cast for some supported compilers. */\r
{\r
if( xSchedulerRunning != pdFALSE )\r
{\r
if( listIS_CONTAINED_WITHIN( &xSuspendedTaskList, &( pxTCB->xGenericListItem ) ) != pdFALSE )\r
{\r
/* Has the task already been resumed from within an ISR? */\r
- if( listIS_CONTAINED_WITHIN( &xPendingReadyList, &( pxTCB->xEventListItem ) ) != pdTRUE )\r
+ if( listIS_CONTAINED_WITHIN( &xPendingReadyList, &( pxTCB->xEventListItem ) ) == pdFALSE )\r
{\r
/* Is it in the suspended list because it is in the\r
Suspended state? It is possible to be in the suspended\r
list because it is blocked on a task with no timeout\r
specified. */\r
- if( listIS_CONTAINED_WITHIN( NULL, &( pxTCB->xEventListItem ) ) == pdTRUE )\r
+ if( listIS_CONTAINED_WITHIN( NULL, &( pxTCB->xEventListItem ) ) != pdFALSE )\r
{\r
xReturn = pdTRUE;\r
}\r
}\r
\r
return xReturn;\r
- }\r
+ } /*lint !e818 xTask cannot be a pointer to const because it is a typedef. */\r
\r
#endif /* INCLUDE_vTaskSuspend */\r
/*-----------------------------------------------------------*/\r
\r
/* As we are in a critical section we can access the ready\r
lists even if the scheduler is suspended. */\r
- uxListRemove( &( pxTCB->xGenericListItem ) );\r
+ ( void ) uxListRemove( &( pxTCB->xGenericListItem ) );\r
prvAddTaskToReadyList( 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
- uxListRemove( &( pxTCB->xGenericListItem ) );\r
+ ( void ) uxListRemove( &( pxTCB->xGenericListItem ) );\r
prvAddTaskToReadyList( pxTCB );\r
}\r
else\r
/* We cannot access the delayed or ready lists, so will hold this\r
task pending until the scheduler is resumed, at which point a\r
yield will be performed if necessary. */\r
- vListInsertEnd( ( xList * ) &( xPendingReadyList ), &( pxTCB->xEventListItem ) );\r
+ vListInsertEnd( &( xPendingReadyList ), &( pxTCB->xEventListItem ) );\r
}\r
}\r
}\r
{\r
/* Create the idle task, storing its handle in xIdleTaskHandle so it can\r
be returned by the xTaskGetIdleTaskHandle() function. */\r
- xReturn = xTaskCreate( prvIdleTask, ( signed char * ) "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), &xIdleTaskHandle );\r
+ xReturn = xTaskCreate( prvIdleTask, ( signed char * ) "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), &xIdleTaskHandle ); /*lint !e961 MISRA exception, justified as it is not a redundant explicit cast to all supported compilers. */\r
}\r
#else\r
{\r
/* Create the idle task without storing its handle. */\r
- xReturn = xTaskCreate( prvIdleTask, ( signed char * ) "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), NULL );\r
+ xReturn = xTaskCreate( prvIdleTask, ( signed char * ) "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), NULL ); /*lint !e961 MISRA exception, justified as it is not a redundant explicit cast to all supported compilers. */\r
}\r
#endif /* INCLUDE_xTaskGetIdleTaskHandle */\r
\r
\r
signed portBASE_TYPE xTaskResumeAll( void )\r
{\r
-register tskTCB *pxTCB;\r
-signed portBASE_TYPE xAlreadyYielded = pdFALSE;\r
+tskTCB *pxTCB;\r
+portBASE_TYPE xAlreadyYielded = pdFALSE;\r
portBASE_TYPE xYieldRequired = pdFALSE;\r
\r
/* If uxSchedulerSuspended is zero then this function does not match a\r
{\r
/* Move any readied tasks from the pending list into the\r
appropriate ready list. */\r
- while( listLIST_IS_EMPTY( ( xList * ) &xPendingReadyList ) == pdFALSE )\r
+ while( listLIST_IS_EMPTY( &xPendingReadyList ) == pdFALSE )\r
{\r
- pxTCB = ( tskTCB * ) listGET_OWNER_OF_HEAD_ENTRY( ( ( xList * ) &xPendingReadyList ) );\r
- uxListRemove( &( pxTCB->xEventListItem ) );\r
- uxListRemove( &( pxTCB->xGenericListItem ) );\r
+ pxTCB = ( tskTCB * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyList ) );\r
+ ( void ) uxListRemove( &( pxTCB->xEventListItem ) );\r
+ ( void ) uxListRemove( &( pxTCB->xGenericListItem ) );\r
prvAddTaskToReadyList( pxTCB );\r
\r
/* If we have moved a task that has a priority higher than\r
do\r
{\r
uxQueue--;\r
- uxTask += prvListTaskWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), ( xList * ) &( pxReadyTasksLists[ uxQueue ] ), eReady );\r
+ uxTask += prvListTaskWithinSingleList( &( pxTaskStatusArray[ uxTask ] ), &( pxReadyTasksLists[ uxQueue ] ), eReady );\r
\r
- }while( uxQueue > ( unsigned short ) tskIDLE_PRIORITY );\r
+ } while( uxQueue > ( unsigned portBASE_TYPE ) tskIDLE_PRIORITY ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */\r
\r
/* Fill in an xTaskStatusType structure with information on each\r
task in the Blocked state. */\r
#endif\r
}\r
}\r
- xTaskResumeAll();\r
+ ( void ) xTaskResumeAll();\r
\r
return uxTask;\r
}\r
}\r
\r
/* It is time to remove the item from the Blocked state. */\r
- uxListRemove( &( pxTCB->xGenericListItem ) );\r
+ ( void ) uxListRemove( &( pxTCB->xGenericListItem ) );\r
\r
/* Is the task waiting on an event also? If so remove it\r
from the event list. */\r
if( listLIST_ITEM_CONTAINER( &( pxTCB->xEventListItem ) ) != NULL )\r
{\r
- uxListRemove( &( pxTCB->xEventListItem ) );\r
+ ( void ) uxListRemove( &( pxTCB->xEventListItem ) );\r
}\r
\r
/* Place the unblocked task into the appropriate ready\r
writer has not explicitly turned time slicing off. */\r
#if ( ( configUSE_PREEMPTION == 1 ) && ( configUSE_TIME_SLICING == 1 ) )\r
{\r
- if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ pxCurrentTCB->uxPriority ] ) ) > 1 )\r
+ if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ pxCurrentTCB->uxPriority ] ) ) > ( unsigned portBASE_TYPE ) 1 )\r
{\r
xSwitchRequired = pdTRUE;\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-void vTaskPlaceOnEventList( const xList * const pxEventList, portTickType xTicksToWait )\r
+void vTaskPlaceOnEventList( xList * const pxEventList, portTickType xTicksToWait )\r
{\r
portTickType xTimeToWake;\r
\r
/* Place the event list item of the TCB in the appropriate event list.\r
This is placed in the list in priority order so the highest priority task\r
is the first to be woken by the event. */\r
- vListInsert( ( xList * ) pxEventList, ( xListItem * ) &( pxCurrentTCB->xEventListItem ) );\r
+ vListInsert( pxEventList, &( pxCurrentTCB->xEventListItem ) );\r
\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
- if( uxListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) ) == 0 )\r
+ if( uxListRemove( &( pxCurrentTCB->xGenericListItem ) ) == ( unsigned portBASE_TYPE ) 0 )\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
/* Add ourselves to the suspended task list instead of a delayed task\r
list to ensure we are not woken by a timing event. We will block\r
indefinitely. */\r
- vListInsertEnd( ( xList * ) &xSuspendedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
+ vListInsertEnd( &xSuspendedTaskList, &( pxCurrentTCB->xGenericListItem ) );\r
}\r
else\r
{\r
\r
#if configUSE_TIMERS == 1\r
\r
- void vTaskPlaceOnEventListRestricted( const xList * const pxEventList, portTickType xTicksToWait )\r
+ void vTaskPlaceOnEventListRestricted( xList * const pxEventList, portTickType xTicksToWait )\r
{\r
portTickType xTimeToWake;\r
\r
In this case it is assume that this is the only task that is going to\r
be waiting on this event list, so the faster vListInsertEnd() function\r
can be used in place of vListInsert. */\r
- vListInsertEnd( ( xList * ) pxEventList, ( xListItem * ) &( pxCurrentTCB->xEventListItem ) );\r
+ vListInsertEnd( pxEventList, &( pxCurrentTCB->xEventListItem ) );\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
- if( uxListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) ) == 0 )\r
+ if( uxListRemove( &( pxCurrentTCB->xGenericListItem ) ) == ( unsigned portBASE_TYPE ) 0 )\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
pxEventList is not empty. */\r
pxUnblockedTCB = ( tskTCB * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList );\r
configASSERT( pxUnblockedTCB );\r
- uxListRemove( &( pxUnblockedTCB->xEventListItem ) );\r
+ ( void ) uxListRemove( &( pxUnblockedTCB->xEventListItem ) );\r
\r
if( uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE )\r
{\r
- uxListRemove( &( pxUnblockedTCB->xGenericListItem ) );\r
+ ( void ) uxListRemove( &( pxUnblockedTCB->xGenericListItem ) );\r
prvAddTaskToReadyList( pxUnblockedTCB );\r
}\r
else\r
{\r
/* We cannot access the delayed or ready lists, so will hold this\r
task pending until the scheduler is resumed. */\r
- vListInsertEnd( ( xList * ) &( xPendingReadyList ), &( pxUnblockedTCB->xEventListItem ) );\r
+ vListInsertEnd( &( xPendingReadyList ), &( pxUnblockedTCB->xEventListItem ) );\r
}\r
\r
if( pxUnblockedTCB->uxPriority >= pxCurrentTCB->uxPriority )\r
else /* We are not blocking indefinitely, perform the checks below. */\r
#endif\r
\r
- if( ( xNumOfOverflows != pxTimeOut->xOverflowCount ) && ( ( portTickType ) xConstTickCount >= ( portTickType ) pxTimeOut->xTimeOnEntering ) )\r
+ if( ( xNumOfOverflows != pxTimeOut->xOverflowCount ) && ( xConstTickCount >= pxTimeOut->xTimeOnEntering ) ) /*lint !e525 Indentation preferred as is to make code within pre-processor directives clearer. */\r
{\r
/* The tick count is greater than the time at which vTaskSetTimeout()\r
was called, but has also overflowed since vTaskSetTimeOut() was called.\r
passed since vTaskSetTimeout() was called. */\r
xReturn = pdTRUE;\r
}\r
- else if( ( ( portTickType ) ( ( portTickType ) xConstTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering ) ) < ( portTickType ) *pxTicksToWait )\r
+ else if( ( xConstTickCount - pxTimeOut->xTimeOnEntering ) < *pxTicksToWait )\r
{\r
/* Not a genuine timeout. Adjust parameters for time remaining. */\r
- *pxTicksToWait -= ( ( portTickType ) xConstTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering );\r
+ *pxTicksToWait -= ( xConstTickCount - pxTimeOut->xTimeOnEntering );\r
vTaskSetTimeOutState( pxTimeOut );\r
xReturn = pdFALSE;\r
}\r
\r
static void prvInitialiseTCBVariables( tskTCB *pxTCB, const signed char * const pcName, unsigned portBASE_TYPE uxPriority, const xMemoryRegion * const xRegions, unsigned short usStackDepth )\r
{\r
-portBASE_TYPE x;\r
+unsigned portBASE_TYPE x;\r
\r
/* Store the task name in the TCB. */\r
- for( x = 0; x < configMAX_TASK_NAME_LEN; x++ )\r
+ for( x = ( unsigned portBASE_TYPE ) 0; x < ( unsigned portBASE_TYPE ) configMAX_TASK_NAME_LEN; x++ )\r
{\r
pxTCB->pcTaskName[ x ] = pcName[ x ];\r
\r
\r
/* This is used as an array index so must ensure it's not too large. First\r
remove the privilege bit if one is present. */\r
- if( uxPriority >= configMAX_PRIORITIES )\r
+ if( uxPriority >= ( unsigned portBASE_TYPE ) configMAX_PRIORITIES )\r
{\r
- uxPriority = configMAX_PRIORITIES - ( unsigned portBASE_TYPE ) 1U;\r
+ uxPriority = ( unsigned portBASE_TYPE ) configMAX_PRIORITIES - ( unsigned portBASE_TYPE ) 1U;\r
}\r
\r
pxTCB->uxPriority = uxPriority;\r
listSET_LIST_ITEM_OWNER( &( pxTCB->xGenericListItem ), pxTCB );\r
\r
/* Event lists are always in priority order. */\r
- listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), configMAX_PRIORITIES - ( portTickType ) uxPriority );\r
+ listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( portTickType ) configMAX_PRIORITIES - ( portTickType ) uxPriority ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */\r
listSET_LIST_ITEM_OWNER( &( pxTCB->xEventListItem ), pxTCB );\r
\r
#if ( portCRITICAL_NESTING_IN_TCB == 1 )\r
{\r
unsigned portBASE_TYPE uxPriority;\r
\r
- for( uxPriority = ( unsigned portBASE_TYPE ) 0U; uxPriority < configMAX_PRIORITIES; uxPriority++ )\r
+ for( uxPriority = ( unsigned portBASE_TYPE ) 0U; uxPriority < ( unsigned portBASE_TYPE ) configMAX_PRIORITIES; uxPriority++ )\r
{\r
- vListInitialise( ( xList * ) &( pxReadyTasksLists[ uxPriority ] ) );\r
+ vListInitialise( &( pxReadyTasksLists[ uxPriority ] ) );\r
}\r
\r
- vListInitialise( ( xList * ) &xDelayedTaskList1 );\r
- vListInitialise( ( xList * ) &xDelayedTaskList2 );\r
- vListInitialise( ( xList * ) &xPendingReadyList );\r
+ vListInitialise( &xDelayedTaskList1 );\r
+ vListInitialise( &xDelayedTaskList2 );\r
+ vListInitialise( &xPendingReadyList );\r
\r
#if ( INCLUDE_vTaskDelete == 1 )\r
{\r
- vListInitialise( ( xList * ) &xTasksWaitingTermination );\r
+ vListInitialise( &xTasksWaitingTermination );\r
}\r
#endif /* INCLUDE_vTaskDelete */\r
\r
#if ( INCLUDE_vTaskSuspend == 1 )\r
{\r
- vListInitialise( ( xList * ) &xSuspendedTaskList );\r
+ vListInitialise( &xSuspendedTaskList );\r
}\r
#endif /* INCLUDE_vTaskSuspend */\r
\r
{\r
vTaskSuspendAll();\r
xListIsEmpty = listLIST_IS_EMPTY( &xTasksWaitingTermination );\r
- xTaskResumeAll();\r
+ ( void ) xTaskResumeAll();\r
\r
if( xListIsEmpty == pdFALSE )\r
{\r
\r
taskENTER_CRITICAL();\r
{\r
- pxTCB = ( tskTCB * ) listGET_OWNER_OF_HEAD_ENTRY( ( ( xList * ) &xTasksWaitingTermination ) );\r
- uxListRemove( &( pxTCB->xGenericListItem ) );\r
+ pxTCB = ( tskTCB * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) );\r
+ ( void ) uxListRemove( &( pxTCB->xGenericListItem ) );\r
--uxCurrentNumberOfTasks;\r
--uxTasksDeleted;\r
}\r
if( xTimeToWake < xTickCount )\r
{\r
/* Wake time has overflowed. Place this item in the overflow list. */\r
- vListInsert( ( xList * ) pxOverflowDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
+ vListInsert( pxOverflowDelayedTaskList, &( pxCurrentTCB->xGenericListItem ) );\r
}\r
else\r
{\r
/* The wake time has not overflowed, so we can use the current block list. */\r
- vListInsert( ( xList * ) pxDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );\r
+ vListInsert( pxDelayedTaskList, &( pxCurrentTCB->xGenericListItem ) );\r
\r
/* If the task entering the blocked state was placed at the head of the\r
list of blocked tasks then xNextTaskUnblockTime needs to be updated\r
/* Allocate space for the stack used by the task being created.\r
The base of the stack memory stored in the TCB so the task can\r
be deleted later if required. */\r
- pxNewTCB->pxStack = ( portSTACK_TYPE * ) pvPortMallocAligned( ( ( ( size_t )usStackDepth ) * sizeof( portSTACK_TYPE ) ), puxStackBuffer );\r
+ pxNewTCB->pxStack = ( portSTACK_TYPE * ) pvPortMallocAligned( ( ( ( size_t ) usStackDepth ) * sizeof( portSTACK_TYPE ) ), puxStackBuffer ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */\r
\r
if( pxNewTCB->pxStack == NULL )\r
{\r
else\r
{\r
/* Just to help debugging. */\r
- memset( pxNewTCB->pxStack, ( int ) tskSTACK_FILL_BYTE, ( size_t ) usStackDepth * sizeof( portSTACK_TYPE ) );\r
+ ( void ) memset( pxNewTCB->pxStack, ( int ) tskSTACK_FILL_BYTE, ( size_t ) usStackDepth * sizeof( portSTACK_TYPE ) );\r
}\r
}\r
\r
volatile tskTCB *pxNextTCB, *pxFirstTCB;\r
unsigned portBASE_TYPE uxTask = 0;\r
\r
- if( listCURRENT_LIST_LENGTH( pxList ) > 0 )\r
+ if( listCURRENT_LIST_LENGTH( pxList ) > ( unsigned portBASE_TYPE ) 0 )\r
{\r
listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList );\r
\r
\r
#if ( configUSE_MUTEXES == 1 )\r
\r
- void vTaskPriorityInherit( xTaskHandle * const pxMutexHolder )\r
+ void vTaskPriorityInherit( xTaskHandle const pxMutexHolder )\r
{\r
tskTCB * const pxTCB = ( tskTCB * ) pxMutexHolder;\r
\r
if( pxTCB->uxPriority < pxCurrentTCB->uxPriority )\r
{\r
/* Adjust the mutex holder state to account for its new priority. */\r
- listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), configMAX_PRIORITIES - ( portTickType ) pxCurrentTCB->uxPriority );\r
+ listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( portTickType ) configMAX_PRIORITIES - ( portTickType ) pxCurrentTCB->uxPriority ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */\r
\r
/* If the task being modified is in the ready state it will need to\r
be moved into a new list. */\r
if( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ pxTCB->uxPriority ] ), &( pxTCB->xGenericListItem ) ) != pdFALSE )\r
{\r
- if( uxListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) ) == 0 )\r
+ if( uxListRemove( &( pxTCB->xGenericListItem ) ) == ( unsigned portBASE_TYPE ) 0 )\r
{\r
taskRESET_READY_PRIORITY( pxTCB->uxPriority );\r
}\r
\r
#if ( configUSE_MUTEXES == 1 )\r
\r
- void vTaskPriorityDisinherit( xTaskHandle * const pxMutexHolder )\r
+ void vTaskPriorityDisinherit( xTaskHandle const pxMutexHolder )\r
{\r
tskTCB * const pxTCB = ( tskTCB * ) pxMutexHolder;\r
\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
- if( uxListRemove( ( xListItem * ) &( pxTCB->xGenericListItem ) ) == 0 )\r
+ if( uxListRemove( &( pxTCB->xGenericListItem ) ) == ( unsigned portBASE_TYPE ) 0 )\r
{\r
taskRESET_READY_PRIORITY( pxTCB->uxPriority );\r
}\r
ready list. */\r
traceTASK_PRIORITY_DISINHERIT( pxTCB, pxTCB->uxBasePriority );\r
pxTCB->uxPriority = pxTCB->uxBasePriority;\r
- listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), configMAX_PRIORITIES - ( portTickType ) pxTCB->uxPriority );\r
+ listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( portTickType ) configMAX_PRIORITIES - ( portTickType ) pxTCB->uxPriority ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */\r
prvAddTaskToReadyList( pxTCB );\r
}\r
}\r
mission critical applications that require provable dependability.\r
*/\r
\r
+/* Standard includes. */\r
+#include <stdlib.h>\r
+\r
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining\r
all the API functions to use the MPU wrappers. That should only be done when\r
task.h is included from an application file. */\r
#include "queue.h"\r
#include "timers.h"\r
\r
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\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
+\r
\r
/* This entire source file will be skipped if the application is not configured\r
to include software timer functionality. This #if is closed at the very bottom\r
xTIMER * pxTimer; /*<< The timer to which the command will be applied. */\r
} xTIMER_MESSAGE;\r
\r
+/*lint -e956 A manual analysis and inspection has been used to determine which\r
+static variables must be declared volatile. */\r
\r
/* The list in which active timers are stored. Timers are referenced in expire\r
time order, with the nearest expiry time at the front of the list. Only the\r
\r
#endif\r
\r
+/*lint +e956 */\r
+\r
/*-----------------------------------------------------------*/\r
\r
/*\r
/* Remove the timer from the list of active timers. A check has already\r
been performed to ensure the list is not empty. */\r
pxTimer = ( xTIMER * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList );\r
- uxListRemove( &( pxTimer->xTimerListItem ) );\r
+ ( void ) uxListRemove( &( pxTimer->xTimerListItem ) );\r
traceTIMER_EXPIRED( pxTimer );\r
\r
/* If the timer is an auto reload timer then calculate the next\r
/* The tick count has not overflowed, has the timer expired? */\r
if( ( xListWasEmpty == pdFALSE ) && ( xNextExpireTime <= xTimeNow ) )\r
{\r
- xTaskResumeAll();\r
+ ( void ) xTaskResumeAll();\r
prvProcessExpiredTimer( xNextExpireTime, xTimeNow );\r
}\r
else\r
}\r
else\r
{\r
- xTaskResumeAll();\r
+ ( void ) xTaskResumeAll();\r
}\r
}\r
}\r
static portTickType prvSampleTimeNow( portBASE_TYPE *pxTimerListsWereSwitched )\r
{\r
portTickType xTimeNow;\r
-PRIVILEGED_DATA static portTickType xLastTime = ( portTickType ) 0U;\r
+PRIVILEGED_DATA static portTickType xLastTime = ( portTickType ) 0U; /*lint !e956 Variable is only accessible to one task. */\r
\r
xTimeNow = xTaskGetTickCount();\r
\r
{\r
/* Has the expiry time elapsed between the command to start/reset a\r
timer was issued, and the time the command was processed? */\r
- if( ( ( portTickType ) ( xTimeNow - xCommandTime ) ) >= pxTimer->xTimerPeriodInTicks )\r
+ if( ( xTimeNow - xCommandTime ) >= pxTimer->xTimerPeriodInTicks )\r
{\r
/* The time between a command being issued and the command being\r
processed actually exceeds the timers period. */\r
portBASE_TYPE xTimerListsWereSwitched, xResult;\r
portTickType xTimeNow;\r
\r
- while( xQueueReceive( xTimerQueue, &xMessage, tmrNO_DELAY ) != pdFAIL )\r
+ while( xQueueReceive( xTimerQueue, &xMessage, tmrNO_DELAY ) != pdFAIL ) /*lint !e603 xMessage does not have to be initialised as it is passed out, not in, and it is not used unless xQueueReceive() returns pdTRUE. */\r
{\r
pxTimer = xMessage.pxTimer;\r
\r
if( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) == pdFALSE )\r
{\r
/* The timer is in a list, remove it. */\r
- uxListRemove( &( pxTimer->xTimerListItem ) );\r
+ ( void ) uxListRemove( &( pxTimer->xTimerListItem ) );\r
}\r
\r
traceTIMER_COMMAND_RECEIVED( pxTimer, xMessage.xMessageID, xMessage.xMessageValue );\r
case tmrCOMMAND_CHANGE_PERIOD :\r
pxTimer->xTimerPeriodInTicks = xMessage.xMessageValue;\r
configASSERT( ( pxTimer->xTimerPeriodInTicks > 0 ) );\r
- prvInsertTimerInActiveList( pxTimer, ( xTimeNow + pxTimer->xTimerPeriodInTicks ), xTimeNow, xTimeNow );\r
+ ( void ) prvInsertTimerInActiveList( pxTimer, ( xTimeNow + pxTimer->xTimerPeriodInTicks ), xTimeNow, xTimeNow );\r
break;\r
\r
case tmrCOMMAND_DELETE :\r
\r
/* Remove the timer from the list. */\r
pxTimer = ( xTIMER * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList );\r
- uxListRemove( &( pxTimer->xTimerListItem ) );\r
+ ( void ) uxListRemove( &( pxTimer->xTimerListItem ) );\r
\r
/* Execute its callback, then send a command to restart the timer if\r
it is an auto-reload timer. It cannot be restarted here as the lists\r