From: rtel Date: Thu, 24 Apr 2014 12:29:40 +0000 (+0000) Subject: Add xQueueGetMutexHolder() to MPU functions. X-Git-Tag: V8.0.1~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=efb68ddc82222a2ee0caae1d0ba8e9ee8a22b83a;p=freertos Add xQueueGetMutexHolder() to MPU functions. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2239 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/FreeRTOS/Source/include/mpu_wrappers.h b/FreeRTOS/Source/include/mpu_wrappers.h index 360b4f92b..0472c46c0 100644 --- a/FreeRTOS/Source/include/mpu_wrappers.h +++ b/FreeRTOS/Source/include/mpu_wrappers.h @@ -117,6 +117,7 @@ only for ports that are using the MPU. */ #define xQueueAddToSet MPU_xQueueAddToSet #define xQueueRemoveFromSet MPU_xQueueRemoveFromSet #define xQueuePeekFromISR MPU_xQueuePeekFromISR + #define xQueueGetMutexHolder MPU_xQueueGetMutexHolder #define pvPortMalloc MPU_pvPortMalloc #define vPortFree MPU_vPortFree diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c b/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c index 116f1ba38..9465aa141 100644 --- a/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c +++ b/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c @@ -216,6 +216,7 @@ QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet, Tick BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ); BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ); BaseType_t MPU_xQueuePeekFromISR( QueueHandle_t xQueue, void * const pvBuffer ); +void* MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ); /*-----------------------------------------------------------*/ @@ -1016,6 +1017,17 @@ BaseType_t xReturn; } /*-----------------------------------------------------------*/ +void* MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ) +{ +BaseType_t xRunningPrivileged = prvRaisePrivilege(); +void * xReturn; + + xReturn = ( void * ) xQueueGetMutexHolder( xSemaphore ); + portRESET_PRIVILEGE( xRunningPrivileged ); + return xReturn; +} +/*-----------------------------------------------------------*/ + #if ( configUSE_MUTEXES == 1 ) QueueHandle_t MPU_xQueueCreateMutex( void ) {