]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/include/semphr.h
Changes to core code and port layer:
[freertos] / FreeRTOS / Source / include / semphr.h
index fe31007c7a86a3fa6da8dfa1e1315f4ff54210ad..257cc9e907e0898e3d9e65f1f62a37c167c23bf5 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+    FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -132,14 +132,16 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * \defgroup vSemaphoreCreateBinary vSemaphoreCreateBinary\r
  * \ingroup Semaphores\r
  */\r
-#define vSemaphoreCreateBinary( xSemaphore )                                                                                                                                                                                                           \\r
-       {                                                                                                                                                                                                                                                                                               \\r
-               ( xSemaphore ) = xQueueGenericCreate( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, NULL, NULL, queueQUEUE_TYPE_BINARY_SEMAPHORE );        \\r
-               if( ( xSemaphore ) != NULL )                                                                                                                                                                                                                            \\r
-               {                                                                                                                                                                                                                                                                                       \\r
-                       ( void ) xSemaphoreGive( ( xSemaphore ) );                                                                                                                                                                                              \\r
-               }                                                                                                                                                                                                                                                                                       \\r
-       }\r
+#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
+       #define vSemaphoreCreateBinary( xSemaphore )                                                                                                                                                                                    \\r
+               {                                                                                                                                                                                                                                                                       \\r
+                       ( xSemaphore ) = xQueueGenericCreate( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_BINARY_SEMAPHORE );    \\r
+                       if( ( xSemaphore ) != NULL )                                                                                                                                                                                                    \\r
+                       {                                                                                                                                                                                                                                                               \\r
+                               ( void ) xSemaphoreGive( ( xSemaphore ) );                                                                                                                                                                      \\r
+                       }                                                                                                                                                                                                                                                               \\r
+               }\r
+#endif\r
 \r
 /**\r
  * semphr. h\r
@@ -158,9 +160,8 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * automatically dynamically allocated inside the xSemaphoreCreateBinary()\r
  * function.  (see http://www.freertos.org/a00111.html).  If a binary semaphore\r
  * is created using xSemaphoreCreateBinaryStatic() then the application writer\r
- * can instead optionally provide the memory that will get used by the binary\r
- * semaphore.  xSemaphoreCreateBinaryStatic() therefore allows a binary\r
- * semaphore to be created without using any dynamic memory allocation.\r
+ * must provide the memory.  xSemaphoreCreateBinaryStatic() therefore allows a\r
+ * binary semaphore to be created without using any dynamic memory allocation.\r
  *\r
  * The old vSemaphoreCreateBinary() macro is now deprecated in favour of this\r
  * xSemaphoreCreateBinary() function.  Note that binary semaphores created using\r
@@ -199,7 +200,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * \defgroup xSemaphoreCreateBinary xSemaphoreCreateBinary\r
  * \ingroup Semaphores\r
  */\r
-#define xSemaphoreCreateBinary() xQueueGenericCreate( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, NULL, NULL, queueQUEUE_TYPE_BINARY_SEMAPHORE )\r
+#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
+       #define xSemaphoreCreateBinary() xQueueGenericCreate( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_BINARY_SEMAPHORE )\r
+#endif\r
 \r
 /**\r
  * semphr. h\r
@@ -218,9 +221,8 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * automatically dynamically allocated inside the xSemaphoreCreateBinary()\r
  * function.  (see http://www.freertos.org/a00111.html).  If a binary semaphore\r
  * is created using xSemaphoreCreateBinaryStatic() then the application writer\r
- * can instead optionally provide the memory that will get used by the binary\r
- * semaphore.  xSemaphoreCreateBinaryStatic() therefore allows a binary\r
- * semaphore to be created without using any dynamic memory allocation.\r
+ * must provide the memory.  xSemaphoreCreateBinaryStatic() therefore allows a\r
+ * binary semaphore to be created without using any dynamic memory allocation.\r
  *\r
  * This type of semaphore can be used for pure synchronisation between tasks or\r
  * between an interrupt and a task.  The semaphore need not be given back once\r
@@ -229,21 +231,12 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * semaphore does not use a priority inheritance mechanism.  For an alternative\r
  * that does use priority inheritance see xSemaphoreCreateMutex().\r
  *\r
- * @param pxSemaphoreBuffer If pxSemaphoreBuffer is NULL then the memory\r
- * required to hold the semaphore's data structures will be allocated\r
- * dynamically, just as when a semaphore is created using\r
- * xSemaphoreCreateBinary().  If pxSemaphoreBuffer is not NULL then it must\r
- * point to a variable of type StaticSemaphore_t, which will then be used to\r
- * hold the semaphore's data structure, removing the need for the memory to be\r
- * allocated dynamically.\r
- *\r
- * @return If pxSemaphoreBuffer is not NULL then the function will not attempt\r
- * any dynamic memory allocation, and a handle to the created semaphore will\r
- * always be returned.  If pxSemaphoreBuffer is NULL then the function will\r
- * attempt to dynamically allocate the memory required to hold the semaphore's\r
- * data structures.  In this case, if the allocation succeeds then a handle to\r
- * the created semaphore will be returned, and if the allocation fails NULL will\r
- * be returned.\r
+ * @param pxSemaphoreBuffer Must point to a variable of type StaticSemaphore_t,\r
+ * which will then be used to hold the semaphore's data structure, removing the\r
+ * need for the memory to be allocated dynamically.\r
+ *\r
+ * @return If the semaphore is created then a handle to the created semaphore is\r
+ * returned.  If pxSemaphoreBuffer is NULL then NULL is returned.\r
  *\r
  * Example usage:\r
  <pre>\r
@@ -267,7 +260,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * \ingroup Semaphores\r
  */\r
 #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
-       #define xSemaphoreCreateBinaryStatic( pxStaticSemaphore ) xQueueGenericCreate( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, NULL, pxStaticSemaphore, queueQUEUE_TYPE_BINARY_SEMAPHORE )\r
+       #define xSemaphoreCreateBinaryStatic( pxStaticSemaphore ) xQueueGenericCreateStatic( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, NULL, pxStaticSemaphore, queueQUEUE_TYPE_BINARY_SEMAPHORE )\r
 #endif /* configSUPPORT_STATIC_ALLOCATION */\r
 \r
 /**\r
@@ -428,22 +421,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * \defgroup xSemaphoreTakeRecursive xSemaphoreTakeRecursive\r
  * \ingroup Semaphores\r
  */\r
-#define xSemaphoreTakeRecursive( xMutex, xBlockTime )  xQueueTakeMutexRecursive( ( xMutex ), ( xBlockTime ) )\r
-\r
-\r
-/*\r
- * xSemaphoreAltTake() is an alternative version of xSemaphoreTake().\r
- *\r
- * The source code that implements the alternative (Alt) API is much\r
- * simpler     because it executes everything from within a critical section.\r
- * This is     the approach taken by many other RTOSes, but FreeRTOS.org has the\r
- * preferred fully featured API too.  The fully featured API has more\r
- * complex     code that takes longer to execute, but makes much less use of\r
- * critical sections.  Therefore the alternative API sacrifices interrupt\r
- * responsiveness to gain execution speed, whereas the fully featured API\r
- * sacrifices execution speed to ensure better interrupt responsiveness.\r
- */\r
-#define xSemaphoreAltTake( xSemaphore, xBlockTime )            xQueueAltGenericReceive( ( QueueHandle_t ) ( xSemaphore ), NULL, ( xBlockTime ), pdFALSE )\r
+#if( configUSE_RECURSIVE_MUTEXES == 1 )\r
+       #define xSemaphoreTakeRecursive( xMutex, xBlockTime )   xQueueTakeMutexRecursive( ( xMutex ), ( xBlockTime ) )\r
+#endif\r
 \r
 /**\r
  * semphr. h\r
@@ -590,21 +570,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * \defgroup xSemaphoreGiveRecursive xSemaphoreGiveRecursive\r
  * \ingroup Semaphores\r
  */\r
-#define xSemaphoreGiveRecursive( xMutex )      xQueueGiveMutexRecursive( ( xMutex ) )\r
-\r
-/*\r
- * xSemaphoreAltGive() is an alternative version of xSemaphoreGive().\r
- *\r
- * The source code that implements the alternative (Alt) API is much\r
- * simpler     because it executes everything from within a critical section.\r
- * This is     the approach taken by many other RTOSes, but FreeRTOS.org has the\r
- * preferred fully featured API too.  The fully featured API has more\r
- * complex     code that takes longer to execute, but makes much less use of\r
- * critical sections.  Therefore the alternative API sacrifices interrupt\r
- * responsiveness to gain execution speed, whereas the fully featured API\r
- * sacrifices execution speed to ensure better interrupt responsiveness.\r
- */\r
-#define xSemaphoreAltGive( xSemaphore )                xQueueAltGenericSend( ( QueueHandle_t ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK )\r
+#if( configUSE_RECURSIVE_MUTEXES == 1 )\r
+       #define xSemaphoreGiveRecursive( xMutex )       xQueueGiveMutexRecursive( ( xMutex ) )\r
+#endif\r
 \r
 /**\r
  * semphr. h\r
@@ -743,10 +711,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * using xSemaphoreCreateMutex() then the required memory is automatically\r
  * dynamically allocated inside the xSemaphoreCreateMutex() function.  (see\r
  * http://www.freertos.org/a00111.html).  If a mutex is created using\r
- * xSemaphoreCreateMutexStatic() then the application writer can instead\r
- * optionally provide the memory that will get used by the mutex.\r
- * xSemaphoreCreateMutexStatic() therefore allows a mutex to be created without\r
- * using any dynamic memory allocation.\r
+ * xSemaphoreCreateMutexStatic() then the application writer must provided the\r
+ * memory.  xSemaphoreCreateMutexStatic() therefore allows a mutex to be created\r
+ * without using any dynamic memory allocation.\r
  *\r
  * Mutexes created using this function can be accessed using the xSemaphoreTake()\r
  * and xSemaphoreGive() macros.  The xSemaphoreTakeRecursive() and\r
@@ -787,7 +754,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * \defgroup xSemaphoreCreateMutex xSemaphoreCreateMutex\r
  * \ingroup Semaphores\r
  */\r
-#define xSemaphoreCreateMutex() xQueueCreateMutex( queueQUEUE_TYPE_MUTEX, NULL )\r
+#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
+       #define xSemaphoreCreateMutex() xQueueCreateMutex( queueQUEUE_TYPE_MUTEX )\r
+#endif\r
 \r
 /**\r
  * semphr. h\r
@@ -801,10 +770,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * using xSemaphoreCreateMutex() then the required memory is automatically\r
  * dynamically allocated inside the xSemaphoreCreateMutex() function.  (see\r
  * http://www.freertos.org/a00111.html).  If a mutex is created using\r
- * xSemaphoreCreateMutexStatic() then the application writer can instead\r
- * optionally provide the memory that will get used by the mutex.\r
- * xSemaphoreCreateMutexStatic() therefore allows a mutex to be created without\r
- * using any dynamic memory allocation.\r
+ * xSemaphoreCreateMutexStatic() then the application writer must provided the\r
+ * memory.  xSemaphoreCreateMutexStatic() therefore allows a mutex to be created\r
+ * without using any dynamic memory allocation.\r
  *\r
  * Mutexes created using this function can be accessed using the xSemaphoreTake()\r
  * and xSemaphoreGive() macros.  The xSemaphoreTakeRecursive() and\r
@@ -821,16 +789,12 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * semaphore and another always 'takes' the semaphore) and from within interrupt\r
  * service routines.\r
  *\r
- * @param pxMutexBuffer If pxMutexBuffer is NULL then the memory required to\r
- * hold the mutex's data structures will be allocated dynamically, just as when\r
- * a mutex is created using xSemaphoreCreateMutex().  If pxMutexBuffer is not\r
- * NULL then it must point to a variable of type StaticSemaphore_t, which will\r
- * then be used to hold the mutex's data structure, removing the need for\r
+ * @param pxMutexBuffer Must point to a variable of type StaticSemaphore_t,\r
+ * which will be used to hold the mutex's data structure, removing the need for\r
  * the memory to be allocated dynamically.\r
  *\r
  * @return If the mutex was successfully created then a handle to the created\r
- * mutex is returned.  If pxMutexBuffer was NULL, and there was not enough\r
- * heap to allocate the mutex data structures, then NULL is returned.\r
+ * mutex is returned.  If pxMutexBuffer was NULL then NULL is returned.\r
  *\r
  * Example usage:\r
  <pre>\r
@@ -852,7 +816,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * \ingroup Semaphores\r
  */\r
  #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
-       #define xSemaphoreCreateMutexStatic( pxMutexBuffer ) xQueueCreateMutex( queueQUEUE_TYPE_MUTEX, ( pxMutexBuffer ) )\r
+       #define xSemaphoreCreateMutexStatic( pxMutexBuffer ) xQueueCreateMutexStatic( queueQUEUE_TYPE_MUTEX, ( pxMutexBuffer ) )\r
 #endif /* configSUPPORT_STATIC_ALLOCATION */\r
 \r
 \r
@@ -869,8 +833,8 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * automatically dynamically allocated inside the\r
  * xSemaphoreCreateRecursiveMutex() function.  (see\r
  * http://www.freertos.org/a00111.html).  If a recursive mutex is created using\r
- * xSemaphoreCreateRecursiveMutexStatic() then the application writer can\r
- * instead optionally provide the memory that will get used by the mutex.\r
+ * xSemaphoreCreateRecursiveMutexStatic() then the application writer must\r
+ * provide the memory that will get used by the mutex.\r
  * xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to\r
  * be created without using any dynamic memory allocation.\r
  *\r
@@ -919,7 +883,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * \defgroup xSemaphoreCreateRecursiveMutex xSemaphoreCreateRecursiveMutex\r
  * \ingroup Semaphores\r
  */\r
-#define xSemaphoreCreateRecursiveMutex() xQueueCreateMutex( queueQUEUE_TYPE_RECURSIVE_MUTEX, NULL )\r
+#if( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configUSE_RECURSIVE_MUTEXES == 1 ) )\r
+       #define xSemaphoreCreateRecursiveMutex() xQueueCreateMutex( queueQUEUE_TYPE_RECURSIVE_MUTEX )\r
+#endif\r
 \r
 /**\r
  * semphr. h\r
@@ -934,8 +900,8 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * automatically dynamically allocated inside the\r
  * xSemaphoreCreateRecursiveMutex() function.  (see\r
  * http://www.freertos.org/a00111.html).  If a recursive mutex is created using\r
- * xSemaphoreCreateRecursiveMutexStatic() then the application writer can\r
- * instead optionally provide the memory that will get used by the mutex.\r
+ * xSemaphoreCreateRecursiveMutexStatic() then the application writer must\r
+ * provide the memory that will get used by the mutex.\r
  * xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to\r
  * be created without using any dynamic memory allocation.\r
  *\r
@@ -961,17 +927,12 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * semaphore and another always 'takes' the semaphore) and from within interrupt\r
  * service routines.\r
  *\r
- * @param pxMutexBuffer If pxMutexBuffer is NULL then the memory required to\r
- * hold the recursive mutex's data structures will be allocated dynamically,\r
- * just as when a recursive mutex is created using\r
- * xSemaphoreCreateRecursiveMutex().  If pxMutexBuffer is not NULL then it must\r
- * point to a variable of type StaticSemaphore_t, which will then be used to\r
- * hold the recursive mutex's data structure, removing the need for the memory\r
- * to be allocated dynamically.\r
+ * @param pxMutexBuffer Must point to a variable of type StaticSemaphore_t,\r
+ * which will then be used to hold the recursive mutex's data structure,\r
+ * removing the need for the memory to be allocated dynamically.\r
  *\r
  * @return If the recursive mutex was successfully created then a handle to the\r
- * created recursive mutex is returned.  If pxMutexBuffer was NULL, and there\r
- * was not enough heap to allocate the mutex data structures, then NULL is\r
+ * created recursive mutex is returned.  If pxMutexBuffer was NULL then NULL is\r
  * returned.\r
  *\r
  * Example usage:\r
@@ -995,8 +956,8 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * \defgroup xSemaphoreCreateRecursiveMutexStatic xSemaphoreCreateRecursiveMutexStatic\r
  * \ingroup Semaphores\r
  */\r
-#if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
-       #define xSemaphoreCreateRecursiveMutexStatic( pxStaticSemaphore ) xQueueCreateMutex( queueQUEUE_TYPE_RECURSIVE_MUTEX, pxStaticSemaphore )\r
+#if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_RECURSIVE_MUTEXES == 1 ) )\r
+       #define xSemaphoreCreateRecursiveMutexStatic( pxStaticSemaphore ) xQueueCreateMutexStatic( queueQUEUE_TYPE_RECURSIVE_MUTEX, pxStaticSemaphore )\r
 #endif /* configSUPPORT_STATIC_ALLOCATION */\r
 \r
 /**\r
@@ -1006,6 +967,10 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * Creates a new counting semaphore instance, and returns a handle by which the\r
  * new counting semaphore can be referenced.\r
  *\r
+ * In many usage scenarios it is faster and more memory efficient to use a\r
+ * direct to task notification in place of a counting semaphore!\r
+ * http://www.freertos.org/RTOS-task-notifications.html\r
+ *\r
  * Internally, within the FreeRTOS implementation, counting semaphores use a\r
  * block of memory, in which the counting semaphore structure is stored.  If a\r
  * counting semaphore is created using xSemaphoreCreateCounting() then the\r
@@ -1071,7 +1036,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * \defgroup xSemaphoreCreateCounting xSemaphoreCreateCounting\r
  * \ingroup Semaphores\r
  */\r
-#define xSemaphoreCreateCounting( uxMaxCount, uxInitialCount ) xQueueCreateCountingSemaphore( ( uxMaxCount ), ( uxInitialCount ), ( NULL ) )\r
+#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
+       #define xSemaphoreCreateCounting( uxMaxCount, uxInitialCount ) xQueueCreateCountingSemaphore( ( uxMaxCount ), ( uxInitialCount ) )\r
+#endif\r
 \r
 /**\r
  * semphr. h\r
@@ -1080,16 +1047,19 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * Creates a new counting semaphore instance, and returns a handle by which the\r
  * new counting semaphore can be referenced.\r
  *\r
+ * In many usage scenarios it is faster and more memory efficient to use a\r
+ * direct to task notification in place of a counting semaphore!\r
+ * http://www.freertos.org/RTOS-task-notifications.html\r
+ *\r
  * Internally, within the FreeRTOS implementation, counting semaphores use a\r
  * block of memory, in which the counting semaphore structure is stored.  If a\r
  * counting semaphore is created using xSemaphoreCreateCounting() then the\r
  * required memory is automatically dynamically allocated inside the\r
  * xSemaphoreCreateCounting() function.  (see\r
  * http://www.freertos.org/a00111.html).  If a counting semaphore is created\r
- * using xSemaphoreCreateCountingStatic() then the application writer can\r
- * instead optionally provide the memory that will get used by the counting\r
- * semaphore.  xSemaphoreCreateCountingStatic() therefore allows a counting\r
- * semaphore to be created without using any dynamic memory allocation.\r
+ * using xSemaphoreCreateCountingStatic() then the application writer must\r
+ * provide the memory.  xSemaphoreCreateCountingStatic() therefore allows a\r
+ * counting semaphore to be created without using any dynamic memory allocation.\r
  *\r
  * Counting semaphores are typically used for two things:\r
  *\r
@@ -1119,18 +1089,13 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * @param uxInitialCount The count value assigned to the semaphore when it is\r
  *        created.\r
  *\r
- * @param pxSemaphoreBuffer If pxSemaphoreBuffer is NULL then the memory\r
- * required to hold the semaphore's data structures will be allocated\r
- * dynamically, just as when a counting semaphore is created using\r
- * xSemaphoreCreateCounting().  If pxSemaphoreBuffer is not NULL then it must\r
- * point to a variable of type StaticSemaphore_t, which will then be used to\r
- * hold the semaphore's data structure, removing the need for the memory\r
- * to be allocated dynamically.\r
+ * @param pxSemaphoreBuffer Must point to a variable of type StaticSemaphore_t,\r
+ * which will then be used to hold the semaphore's data structure, removing the\r
+ * need for the memory to be allocated dynamically.\r
  *\r
  * @return If the counting semaphore was successfully created then a handle to\r
- * the created counting semaphore is returned.  If pxSemaphoreBuffer was NULL,\r
- * and there was not enough heap to allocate the counting semaphore data\r
- * structures, then NULL is returned.\r
+ * the created counting semaphore is returned.  If pxSemaphoreBuffer was NULL\r
+ * then NULL is returned.\r
  *\r
  * Example usage:\r
  <pre>\r
@@ -1157,7 +1122,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
  * \ingroup Semaphores\r
  */\r
 #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
-       #define xSemaphoreCreateCountingStatic( uxMaxCount, uxInitialCount, pxSemaphoreBuffer ) xQueueCreateCountingSemaphore( ( uxMaxCount ), ( uxInitialCount ), ( pxSemaphoreBuffer ) )\r
+       #define xSemaphoreCreateCountingStatic( uxMaxCount, uxInitialCount, pxSemaphoreBuffer ) xQueueCreateCountingSemaphoreStatic( ( uxMaxCount ), ( uxInitialCount ), ( pxSemaphoreBuffer ) )\r
 #endif /* configSUPPORT_STATIC_ALLOCATION */\r
 \r
 /**\r
@@ -1191,11 +1156,22 @@ typedef QueueHandle_t SemaphoreHandle_t;
 \r
 /**\r
  * semphr.h\r
- * <pre>TaskHandle_t xSemaphoreGetCount( SemaphoreHandle_t xMutex );</pre>\r
+ * <pre>TaskHandle_t xSemaphoreGetMutexHolderFromISR( SemaphoreHandle_t xMutex );</pre>\r
+ *\r
+ * If xMutex is indeed a mutex type semaphore, return the current mutex holder.\r
+ * If xMutex is not a mutex type semaphore, or the mutex is available (not held\r
+ * by a task), return NULL.\r
+ *\r
+ */\r
+#define xSemaphoreGetMutexHolderFromISR( xSemaphore ) xQueueGetMutexHolderFromISR( ( xSemaphore ) )\r
+\r
+/**\r
+ * semphr.h\r
+ * <pre>UBaseType_t uxSemaphoreGetCount( SemaphoreHandle_t xSemaphore );</pre>\r
  *\r
- * If the semaphore is a counting semaphore then xSemaphoreGetCount() returns\r
+ * If the semaphore is a counting semaphore then uxSemaphoreGetCount() returns\r
  * its current count value.  If the semaphore is a binary semaphore then\r
- * xSemaphoreGetCount() returns 1 if the semaphore is available, and 0 if the\r
+ * uxSemaphoreGetCount() returns 1 if the semaphore is available, and 0 if the\r
  * semaphore is not available.\r
  *\r
  */\r