]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/Common/mpu_wrappers.c
First pass at updating from MISRA 2004 to MISRA 2012:
[freertos] / FreeRTOS / Source / portable / Common / mpu_wrappers.c
index 18435cb2f794e932fc1492a9fff6ec550fbea132..b08a834117b4934bdc8123d4dc3b1c35aadcc995 100644 (file)
@@ -1,71 +1,29 @@
 /*\r
-    FreeRTOS V9.0.0rc2 - 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
-\r
-    This file is part of the FreeRTOS distribution.\r
-\r
-    FreeRTOS is free software; you can redistribute it and/or modify it under\r
-    the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
-\r
-    ***************************************************************************\r
-    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
-    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
-    >>!   obliged to provide the source code for proprietary components     !<<\r
-    >>!   outside of the FreeRTOS kernel.                                   !<<\r
-    ***************************************************************************\r
-\r
-    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
-    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
-    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
-    link: http://www.freertos.org/a00114.html\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS provides completely free yet professionally developed,    *\r
-     *    robust, strictly quality controlled, supported, and cross          *\r
-     *    platform software that is more than just the market leader, it     *\r
-     *    is the industry's de facto standard.                               *\r
-     *                                                                       *\r
-     *    Help yourself get started quickly while simultaneously helping     *\r
-     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
-     *    tutorial book, reference manual, or both:                          *\r
-     *    http://www.FreeRTOS.org/Documentation                              *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
-    the FAQ page "My application does not run, what could be wrong?".  Have you\r
-    defined configASSERT()?\r
-\r
-    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
-    embedded software for free we request you assist our global community by\r
-    participating in the support forum.\r
-\r
-    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
-    be as productive as possible as early as possible.  Now you can receive\r
-    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
-    Ltd, and the world's leading authority on the world's leading RTOS.\r
-\r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
-    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
-\r
-    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
-    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
-    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and commercial middleware.\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
-    1 tab == 4 spaces!\r
-*/\r
+ * FreeRTOS Kernel V10.0.1\r
+ * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
+ * this software and associated documentation files (the "Software"), to deal in\r
+ * the Software without restriction, including without limitation the rights to\r
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
+ * the Software, and to permit persons to whom the Software is furnished to do so,\r
+ * subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in all\r
+ * copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://aws.amazon.com/freertos\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ */\r
 \r
 /*\r
  * Implementation of the wrapper functions used to raise the processor privilege\r
@@ -83,6 +41,7 @@ task.h is included from an application file. */
 #include "queue.h"\r
 #include "timers.h"\r
 #include "event_groups.h"\r
+#include "stream_buffer.h"\r
 #include "mpu_prototypes.h"\r
 \r
 #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
@@ -96,15 +55,30 @@ extern BaseType_t xPortRaisePrivilege( void );
 \r
 /*-----------------------------------------------------------*/\r
 \r
-BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask )\r
-{\r
-BaseType_t xReturn;\r
-BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
+       BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask )\r
+       {\r
+       BaseType_t xReturn;\r
+       BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
 \r
-       xReturn = xTaskCreateRestricted( pxTaskDefinition, pxCreatedTask );\r
-       vPortResetPrivilege( xRunningPrivileged );\r
-       return xReturn;\r
-}\r
+               xReturn = xTaskCreateRestricted( pxTaskDefinition, pxCreatedTask );\r
+               vPortResetPrivilege( xRunningPrivileged );\r
+               return xReturn;\r
+       }\r
+#endif /* conifgSUPPORT_DYNAMIC_ALLOCATION */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
+       BaseType_t MPU_xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask )\r
+       {\r
+       BaseType_t xReturn;\r
+       BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+               xReturn = xTaskCreateRestrictedStatic( pxTaskDefinition, pxCreatedTask );\r
+               vPortResetPrivilege( xRunningPrivileged );\r
+               return xReturn;\r
+       }\r
+#endif /* conifgSUPPORT_DYNAMIC_ALLOCATION */\r
 /*-----------------------------------------------------------*/\r
 \r
 #if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
@@ -189,7 +163,7 @@ BaseType_t xRunningPrivileged = xPortRaisePrivilege();
 /*-----------------------------------------------------------*/\r
 \r
 #if ( INCLUDE_uxTaskPriorityGet == 1 )\r
-       UBaseType_t MPU_uxTaskPriorityGet( TaskHandle_t pxTask )\r
+       UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t pxTask )\r
        {\r
        UBaseType_t uxReturn;\r
        BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
@@ -337,7 +311,7 @@ BaseType_t xRunningPrivileged = xPortRaisePrivilege();
 #endif\r
 /*-----------------------------------------------------------*/\r
 \r
-#if ( configUSE_TRACE_FACILITY == 1 )\r
+#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
        void MPU_vTaskList( char *pcWriteBuffer )\r
        {\r
        BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
@@ -348,7 +322,7 @@ BaseType_t xRunningPrivileged = xPortRaisePrivilege();
 #endif\r
 /*-----------------------------------------------------------*/\r
 \r
-#if ( configGENERATE_RUN_TIME_STATS == 1 )\r
+#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
        void MPU_vTaskGetRunTimeStats( char *pcWriteBuffer )\r
        {\r
        BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
@@ -614,12 +588,34 @@ UBaseType_t uxReturn;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-BaseType_t MPU_xQueueGenericReceive( QueueHandle_t pxQueue, void * const pvBuffer, TickType_t xTicksToWait, BaseType_t xJustPeeking )\r
+BaseType_t MPU_xQueueReceive( QueueHandle_t pxQueue, void * const pvBuffer, TickType_t xTicksToWait )\r
 {\r
 BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
 BaseType_t xReturn;\r
 \r
-       xReturn = xQueueGenericReceive( pxQueue, pvBuffer, xTicksToWait, xJustPeeking );\r
+       xReturn = xQueueReceive( pxQueue, pvBuffer, xTicksToWait );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+BaseType_t MPU_xQueuePeek( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait )\r
+{\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+BaseType_t xReturn;\r
+\r
+       xReturn = xQueuePeek( xQueue, pvBuffer, xTicksToWait );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue, TickType_t xTicksToWait )\r
+{\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+BaseType_t xReturn;\r
+\r
+       xReturn = xQueueSemaphoreTake( xQueue, xTicksToWait );\r
        vPortResetPrivilege( xRunningPrivileged );\r
        return xReturn;\r
 }\r
@@ -700,7 +696,7 @@ void * xReturn;
 #endif\r
 /*-----------------------------------------------------------*/\r
 \r
-#if ( configUSE_MUTEXES == 1 )\r
+#if ( configUSE_RECURSIVE_MUTEXES == 1 )\r
        BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xBlockTime )\r
        {\r
        BaseType_t xReturn;\r
@@ -713,7 +709,7 @@ void * xReturn;
 #endif\r
 /*-----------------------------------------------------------*/\r
 \r
-#if ( configUSE_MUTEXES == 1 )\r
+#if ( configUSE_RECURSIVE_MUTEXES == 1 )\r
        BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t xMutex )\r
        {\r
        BaseType_t xReturn;\r
@@ -726,7 +722,7 @@ void * xReturn;
 #endif\r
 /*-----------------------------------------------------------*/\r
 \r
-#if ( configUSE_QUEUE_SETS == 1 )\r
+#if( ( configUSE_QUEUE_SETS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
        QueueSetHandle_t MPU_xQueueCreateSet( UBaseType_t uxEventQueueLength )\r
        {\r
        QueueSetHandle_t xReturn;\r
@@ -827,7 +823,6 @@ BaseType_t xRunningPrivileged = xPortRaisePrivilege();
 /*-----------------------------------------------------------*/\r
 \r
 #if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
-\r
        void *MPU_pvPortMalloc( size_t xSize )\r
        {\r
        void *pvReturn;\r
@@ -839,12 +834,10 @@ BaseType_t xRunningPrivileged = xPortRaisePrivilege();
 \r
                return pvReturn;\r
        }\r
-\r
 #endif /* configSUPPORT_DYNAMIC_ALLOCATION */\r
 /*-----------------------------------------------------------*/\r
 \r
 #if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
-\r
        void MPU_vPortFree( void *pv )\r
        {\r
        BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
@@ -853,31 +846,34 @@ BaseType_t xRunningPrivileged = xPortRaisePrivilege();
 \r
                vPortResetPrivilege( xRunningPrivileged );\r
        }\r
-\r
 #endif /* configSUPPORT_DYNAMIC_ALLOCATION */\r
 /*-----------------------------------------------------------*/\r
 \r
-void MPU_vPortInitialiseBlocks( void )\r
-{\r
-BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
+       void MPU_vPortInitialiseBlocks( void )\r
+       {\r
+       BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
 \r
-       vPortInitialiseBlocks();\r
+               vPortInitialiseBlocks();\r
 \r
-       vPortResetPrivilege( xRunningPrivileged );\r
-}\r
+               vPortResetPrivilege( xRunningPrivileged );\r
+       }\r
+#endif /* configSUPPORT_DYNAMIC_ALLOCATION */\r
 /*-----------------------------------------------------------*/\r
 \r
-size_t MPU_xPortGetFreeHeapSize( void )\r
-{\r
-size_t xReturn;\r
-BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
+       size_t MPU_xPortGetFreeHeapSize( void )\r
+       {\r
+       size_t xReturn;\r
+       BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
 \r
-       xReturn = xPortGetFreeHeapSize();\r
+               xReturn = xPortGetFreeHeapSize();\r
 \r
-       vPortResetPrivilege( xRunningPrivileged );\r
+               vPortResetPrivilege( xRunningPrivileged );\r
 \r
-       return xReturn;\r
-}\r
+               return xReturn;\r
+       }\r
+#endif /* configSUPPORT_DYNAMIC_ALLOCATION */\r
 /*-----------------------------------------------------------*/\r
 \r
 #if( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configUSE_TIMERS == 1 ) )\r
@@ -1116,8 +1112,174 @@ BaseType_t xRunningPrivileged = xPortRaisePrivilege();
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, TickType_t xTicksToWait )\r
+{\r
+size_t xReturn;\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+       xReturn = xStreamBufferSend( xStreamBuffer, pvTxData, xDataLengthBytes, xTicksToWait );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+size_t MPU_xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken )\r
+{\r
+size_t xReturn;\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+       xReturn = xStreamBufferSendFromISR( xStreamBuffer, pvTxData, xDataLengthBytes, pxHigherPriorityTaskWoken );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer )\r
+{\r
+size_t xReturn;\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+       xReturn = xStreamBufferNextMessageLengthBytes( xStreamBuffer );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, TickType_t xTicksToWait )\r
+{\r
+size_t xReturn;\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+       xReturn = xStreamBufferReceive( xStreamBuffer, pvRxData, xBufferLengthBytes, xTicksToWait );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+size_t MPU_xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken )\r
+{\r
+size_t xReturn;\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+       xReturn = xStreamBufferReceiveFromISR( xStreamBuffer, pvRxData, xBufferLengthBytes, pxHigherPriorityTaskWoken );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer )\r
+{\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+       vStreamBufferDelete( xStreamBuffer );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer )\r
+{\r
+BaseType_t xReturn;\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+       xReturn = xStreamBufferIsFull( xStreamBuffer );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer )\r
+{\r
+BaseType_t xReturn;\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+       xReturn = xStreamBufferIsEmpty( xStreamBuffer );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer )\r
+{\r
+BaseType_t xReturn;\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+       xReturn = xStreamBufferReset( xStreamBuffer );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer )\r
+{\r
+size_t xReturn;\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+       xReturn = xStreamBufferSpacesAvailable( xStreamBuffer );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer )\r
+{\r
+size_t xReturn;\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+       xReturn = xStreamBufferBytesAvailable( xStreamBuffer );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer, size_t xTriggerLevel )\r
+{\r
+BaseType_t xReturn;\r
+BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+       xReturn = xStreamBufferSetTriggerLevel( xStreamBuffer, xTriggerLevel );\r
+       vPortResetPrivilege( xRunningPrivileged );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )\r
+       StreamBufferHandle_t MPU_xStreamBufferGenericCreate( size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer )\r
+       {\r
+       StreamBufferHandle_t xReturn;\r
+       BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+               xReturn = xStreamBufferGenericCreate( xBufferSizeBytes, xTriggerLevelBytes, xIsMessageBuffer );\r
+               vPortResetPrivilege( xRunningPrivileged );\r
+\r
+               return xReturn;\r
+       }\r
+#endif /* configSUPPORT_DYNAMIC_ALLOCATION */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
+       StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer, uint8_t * const pucStreamBufferStorageArea, StaticStreamBuffer_t * const pxStaticStreamBuffer )\r
+       {\r
+       StreamBufferHandle_t xReturn;\r
+       BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
 \r
+               xReturn = xStreamBufferGenericCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, xIsMessageBuffer, pucStreamBufferStorageArea, pxStaticStreamBuffer );\r
+               vPortResetPrivilege( xRunningPrivileged );\r
 \r
+               return xReturn;\r
+       }\r
+#endif /* configSUPPORT_STATIC_ALLOCATION */\r
+/*-----------------------------------------------------------*/\r
 \r
 \r
 /* Functions that the application writer wants to execute in privileged mode\r