]> git.sur5r.net Git - freertos/commitdiff
Introduce vTaskInternalSetTimeOutState() which does not have a critical section,...
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 24 Feb 2017 02:16:54 +0000 (02:16 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 24 Feb 2017 02:16:54 +0000 (02:16 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2486 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Source/include/task.h
FreeRTOS/Source/portable/CCS/ARM_CM3/port.c
FreeRTOS/Source/portable/GCC/ARM_CM3/port.c
FreeRTOS/Source/portable/IAR/ARM_CA5_No_GIC/portASM.s
FreeRTOS/Source/queue.c
FreeRTOS/Source/tasks.c

index c8e7c355c00c18dfb44ac6200049714b87e965bd..0f979f853227cc495d44dde491e923f540a4598e 100644 (file)
@@ -2364,6 +2364,13 @@ eSleepModeStatus eTaskConfirmSleepModeStatus( void ) PRIVILEGED_FUNCTION;
  */\r
 void *pvTaskIncrementMutexHeldCount( void ) PRIVILEGED_FUNCTION;\r
 \r
+/*\r
+ * For internal use only.  Same as vTaskSetTimeOutState(), but without a critial\r
+ * section.\r
+ */\r
+void vTaskInternalSetTimeOutState( TimeOut_t * const pxTimeOut ) PRIVILEGED_FUNCTION;\r
+\r
+\r
 #ifdef __cplusplus\r
 }\r
 #endif\r
index 83e5e05744cc527f6495612402499c1b5c0a436d..7ec544e0443d235b59e788f7bb450af521942dd4 100644 (file)
@@ -548,7 +548,7 @@ void xPortSysTickHandler( void )
 void vPortSetupTimerInterrupt( void )\r
 {\r
        /* Calculate the constants required to configure the tick interrupt. */\r
-       #if configUSE_TICKLESS_IDLE == 1\r
+       #if( configUSE_TICKLESS_IDLE == 1 )\r
        {\r
                ulTimerCountsForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ );\r
                xMaximumPossibleSuppressedTicks = portMAX_24_BIT_NUMBER / ulTimerCountsForOneTick;\r
index 856ff0d293135c618506b6c5d6582fbdeb7c46e1..f61ce66ea94c92817216cc0131098abeaf33d875 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.\r
+    FreeRTOS V9.0.1 - Copyright (C) 2017 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
index c08875cba6ef555696e7846f00a26b9a230f441b..69b6b2f29112b8c89f8dcc140c80bebbbad59a90 100644 (file)
@@ -132,12 +132,12 @@ FreeRTOS_IRQ_Handler
        AND             r2, r2, #4\r
        SUB             sp, sp, r2\r
 \r
-       PUSH    {r0-r3, lr}\r
+       PUSH    {r0-r4, lr}\r
 \r
        ; Call the port part specific handler.\r
        LDR             r0, =vApplicationIRQHandler\r
        BLX             r0\r
-       POP             {r0-r3, lr}\r
+       POP             {r0-r4, lr}\r
        ADD             sp, sp, r2\r
 \r
        CPSID   i\r
index 9fbe6ba983fe05456d6ae70a71d4f88a0244e2a0..72bdff50835e3df6a84009c4de409561ca8ea5d3 100644 (file)
@@ -891,7 +891,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
                                {\r
                                        /* The queue was full and a block time was specified so\r
                                        configure the timeout structure. */\r
-                                       vTaskSetTimeOutState( &xTimeOut );\r
+                                       vTaskInternalSetTimeOutState( &xTimeOut );\r
                                        xEntryTimeSet = pdTRUE;\r
                                }\r
                                else\r
@@ -1346,7 +1346,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
                                {\r
                                        /* The queue was empty and a block time was specified so\r
                                        configure the timeout structure. */\r
-                                       vTaskSetTimeOutState( &xTimeOut );\r
+                                       vTaskInternalSetTimeOutState( &xTimeOut );\r
                                        xEntryTimeSet = pdTRUE;\r
                                }\r
                                else\r
@@ -1502,7 +1502,11 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
                                        /* For inheritance to have occurred there must have been an\r
                                        initial timeout, and an adjusted timeout cannot become 0, as\r
                                        if it were 0 the function would have exited. */\r
-                                       configASSERT( xInheritanceOccurred == pdFALSE );\r
+                                       #if( configUSE_MUTEXES == 1 )\r
+                                       {\r
+                                               configASSERT( xInheritanceOccurred == pdFALSE );\r
+                                       }\r
+                                       #endif /* configUSE_MUTEXES */\r
 \r
                                        /* The semaphore count was 0 and no block time is specified\r
                                        (or the block time has expired) so exit now. */\r
@@ -1514,7 +1518,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
                                {\r
                                        /* The semaphore count was 0 and a block time was specified\r
                                        so configure the timeout structure ready to block. */\r
-                                       vTaskSetTimeOutState( &xTimeOut );\r
+                                       vTaskInternalSetTimeOutState( &xTimeOut );\r
                                        xEntryTimeSet = pdTRUE;\r
                                }\r
                                else\r
@@ -1711,7 +1715,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
                                        /* The queue was empty and a block time was specified so\r
                                        configure the timeout structure ready to enter the blocked\r
                                        state. */\r
-                                       vTaskSetTimeOutState( &xTimeOut );\r
+                                       vTaskInternalSetTimeOutState( &xTimeOut );\r
                                        xEntryTimeSet = pdTRUE;\r
                                }\r
                                else\r
index 6cf5ed8610689e433deb706031ec1f7ecaaeb4b0..76abb9e7cac283a0d4496d2e4c1316911e6e4960 100644 (file)
@@ -3123,6 +3123,18 @@ TCB_t *pxUnblockedTCB;
 void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut )\r
 {\r
        configASSERT( pxTimeOut );\r
+       taskENTER_CRITICAL();\r
+       {\r
+               pxTimeOut->xOverflowCount = xNumOfOverflows;\r
+               pxTimeOut->xTimeOnEntering = xTickCount;\r
+       }\r
+       taskEXIT_CRITICAL();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vTaskInternalSetTimeOutState( TimeOut_t * const pxTimeOut )\r
+{\r
+       /* For internal use only as it does not use a critical section. */\r
        pxTimeOut->xOverflowCount = xNumOfOverflows;\r
        pxTimeOut->xTimeOnEntering = xTickCount;\r
 }\r
@@ -3176,7 +3188,7 @@ BaseType_t xReturn;
                {\r
                        /* Not a genuine timeout. Adjust parameters for time remaining. */\r
                        *pxTicksToWait -= xElapsedTime;\r
-                       vTaskSetTimeOutState( pxTimeOut );\r
+                       vTaskInternalSetTimeOutState( pxTimeOut );\r
                        xReturn = pdFALSE;\r
                }\r
                else\r