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
\r
/* Check the alignment of the calculated top of stack is correct. */\r
- configASSERT( ( ( ( uint32_t ) pxTopOfStack & ( uint32_t ) portBYTE_ALIGNMENT_MASK ) == 0UL ) );\r
+ configASSERT( ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack & ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) == 0UL ) );\r
}\r
#else /* portSTACK_GROWTH */\r
{\r
pxTopOfStack = pxNewTCB->pxStack;\r
\r
/* Check the alignment of the stack buffer is correct. */\r
- configASSERT( ( ( ( uint32_t ) pxNewTCB->pxStack & ( uint32_t ) portBYTE_ALIGNMENT_MASK ) == 0UL ) );\r
+ configASSERT( ( ( ( portPOINTER_SIZE_TYPE ) pxNewTCB->pxStack & ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) == 0UL ) );\r
\r
/* If we want to use stack checking on architectures that use\r
a positive stack growth direction then we also need to store the\r
\r
if( pxMutexHolder != NULL )\r
{\r
+ configASSERT( pxTCB->uxMutexesHeld );\r
+ ( pxTCB->uxMutexesHeld )--;\r
+\r
if( pxTCB->uxPriority != pxTCB->uxBasePriority )\r
{\r
/* Only disinherit if no other mutexes are held. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
-void vTaskIncrementMutexHeldCount( void )\r
+void *pvTaskIncrementMutexHeldCount( void )\r
{\r
#if ( configUSE_MUTEXES == 1 )\r
{\r
{\r
( pxCurrentTCB->uxMutexesHeld )++;\r
}\r
- }\r
- #endif\r
-}\r
-/*-----------------------------------------------------------*/\r
\r
-void vTaskDecrementMutexHeldCount( void )\r
-{\r
- #if ( configUSE_MUTEXES == 1 )\r
- {\r
- /* If xSemaphoreCreateMutex() is called before any tasks have been created\r
- then pxCurrentTCB will be NULL. */\r
- if( pxCurrentTCB != NULL )\r
- {\r
- configASSERT( pxCurrentTCB->uxMutexesHeld );\r
- ( pxCurrentTCB->uxMutexesHeld )--;\r
- }\r
+ return pxCurrentTCB;\r
}\r
#endif\r
}\r
+/*-----------------------------------------------------------*/\r
\r
#ifdef FREERTOS_MODULE_TEST\r
#include "tasks_test_access_functions.h"\r