Correct an err in queue.c introduced when previously updating behaviour when queue sets are used in combination with queue overwrites.

This commit is contained in:
Richard Barry 2020-01-29 19:52:38 +00:00
parent f5b5b2db04
commit 0d54d1c4dc
4 changed files with 68 additions and 41 deletions

View file

@ -219,7 +219,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597221</id> <id>1580324678127</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -228,7 +228,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597236</id> <id>1580324678132</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -237,7 +237,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597244</id> <id>1580324678137</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -246,7 +246,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597250</id> <id>1580324678144</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -255,7 +255,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597254</id> <id>1580324678149</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -264,7 +264,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597258</id> <id>1580324678155</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -273,7 +273,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597263</id> <id>1580324678160</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -282,7 +282,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597267</id> <id>1580324678165</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -291,7 +291,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597271</id> <id>1580324678171</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -300,7 +300,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597278</id> <id>1580324678176</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -309,7 +309,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597282</id> <id>1580324678196</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -318,7 +318,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597288</id> <id>1580324678207</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -327,7 +327,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597292</id> <id>1580324678218</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -336,7 +336,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597302</id> <id>1580324678227</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -345,7 +345,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597306</id> <id>1580324678238</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -354,7 +354,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597310</id> <id>1580324678249</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -363,7 +363,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597314</id> <id>1580324678260</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -372,7 +372,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597318</id> <id>1580324678271</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -381,7 +381,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597321</id> <id>1580324678282</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -390,7 +390,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597325</id> <id>1580324678293</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -399,7 +399,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597330</id> <id>1580324678305</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -408,7 +408,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597334</id> <id>1580324678315</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -417,7 +417,7 @@
</matcher> </matcher>
</filter> </filter>
<filter> <filter>
<id>1528755597338</id> <id>1580324678325</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name> <name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type> <type>5</type>
<matcher> <matcher>
@ -425,6 +425,15 @@
<arguments>1.0-name-matches-false-false-StreamBufferInterrupt.c</arguments> <arguments>1.0-name-matches-false-false-StreamBufferInterrupt.c</arguments>
</matcher> </matcher>
</filter> </filter>
<filter>
<id>1580324678334</id>
<name>src/Full_Demo/Standard-Demo-Tasks/Minimal</name>
<type>5</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-QueueSet.c</arguments>
</matcher>
</filter>
<filter> <filter>
<id>1461598705091</id> <id>1461598705091</id>
<name>src/lwIP_Demo/lwip-1.4.0/src/core</name> <name>src/lwIP_Demo/lwip-1.4.0/src/core</name>

View file

@ -114,6 +114,7 @@
#include "StreamBufferDemo.h" #include "StreamBufferDemo.h"
#include "StreamBufferInterrupt.h" #include "StreamBufferInterrupt.h"
#include "MessageBufferAMP.h" #include "MessageBufferAMP.h"
#include "QueueSet.h"
/* Priorities for the demo application tasks. */ /* Priorities for the demo application tasks. */
@ -233,6 +234,12 @@ void main_full( void )
vStartStreamBufferInterruptDemo(); vStartStreamBufferInterruptDemo();
vStartMessageBufferAMPTasks( mainMESSAGE_BUFFER_STACK_SIZE ); vStartMessageBufferAMPTasks( mainMESSAGE_BUFFER_STACK_SIZE );
#if( configUSE_QUEUE_SETS == 1 )
{
vStartQueueSetTasks();
}
#endif
/* Start the tasks that implements the command console on the UART, as /* Start the tasks that implements the command console on the UART, as
described above. */ described above. */
vUARTCommandConsoleStart( mainUART_COMMAND_CONSOLE_STACK_SIZE, mainUART_COMMAND_CONSOLE_TASK_PRIORITY ); vUARTCommandConsoleStart( mainUART_COMMAND_CONSOLE_STACK_SIZE, mainUART_COMMAND_CONSOLE_TASK_PRIORITY );
@ -403,17 +410,26 @@ unsigned long ulErrorFound = pdFALSE;
ulErrorFound |= 1UL << 20UL; ulErrorFound |= 1UL << 20UL;
} }
#if( configUSE_QUEUE_SETS == 1 )
{
if( xAreQueueSetTasksStillRunning() != pdPASS )
{
ulErrorFound |= 1UL << 21UL;
}
}
#endif
/* Check that the register test 1 task is still running. */ /* Check that the register test 1 task is still running. */
if( ulLastRegTest1Value == ulRegTest1LoopCounter ) if( ulLastRegTest1Value == ulRegTest1LoopCounter )
{ {
ulErrorFound |= 1UL << 21UL; ulErrorFound |= 1UL << 22UL;
} }
ulLastRegTest1Value = ulRegTest1LoopCounter; ulLastRegTest1Value = ulRegTest1LoopCounter;
/* Check that the register test 2 task is still running. */ /* Check that the register test 2 task is still running. */
if( ulLastRegTest2Value == ulRegTest2LoopCounter ) if( ulLastRegTest2Value == ulRegTest2LoopCounter )
{ {
ulErrorFound |= 1UL << 22UL; ulErrorFound |= 1UL << 23UL;
} }
ulLastRegTest2Value = ulRegTest2LoopCounter; ulLastRegTest2Value = ulRegTest2LoopCounter;

View file

@ -78,6 +78,7 @@
#include "IntSemTest.h" #include "IntSemTest.h"
#include "StreamBufferInterrupt.h" #include "StreamBufferInterrupt.h"
#include "StreamBufferDemo.h" #include "StreamBufferDemo.h"
#include "QueueSet.h"
/* Xilinx includes. */ /* Xilinx includes. */
#include "platform.h" #include "platform.h"
@ -303,6 +304,12 @@ void vApplicationTickHook( void )
a stream being sent from an interrupt to a task. */ a stream being sent from an interrupt to a task. */
vBasicStreamBufferSendFromISR(); vBasicStreamBufferSendFromISR();
#if( configUSE_QUEUE_SETS == 1 )
{
vQueueSetAccessQueueSetFromISR();
}
#endif
/* Test flop alignment in interrupts - calling printf from an interrupt /* Test flop alignment in interrupts - calling printf from an interrupt
is BAD! */ is BAD! */
#if( configASSERT_DEFINED == 1 ) #if( configASSERT_DEFINED == 1 )

View file

@ -983,17 +983,10 @@ Queue_t * const pxQueue = xQueue;
if( ( pxQueue->uxMessagesWaiting < pxQueue->uxLength ) || ( xCopyPosition == queueOVERWRITE ) ) if( ( pxQueue->uxMessagesWaiting < pxQueue->uxLength ) || ( xCopyPosition == queueOVERWRITE ) )
{ {
const int8_t cTxLock = pxQueue->cTxLock; const int8_t cTxLock = pxQueue->cTxLock;
const UBaseType_t uxPreviousMessagesWaiting = pxQueue->uxMessagesWaiting;
traceQUEUE_SEND_FROM_ISR( pxQueue ); traceQUEUE_SEND_FROM_ISR( pxQueue );
/* The event list is not altered if the queue is locked. This will
be done when the queue is unlocked later. */
if( cTxLock == queueUNLOCKED )
{
#if ( configUSE_QUEUE_SETS == 1 )
{
const UBaseType_t uxPreviousMessagesWaiting = pxQueue->uxMessagesWaiting;
/* Semaphores use xQueueGiveFromISR(), so pxQueue will not be a /* Semaphores use xQueueGiveFromISR(), so pxQueue will not be a
semaphore or mutex. That means prvCopyDataToQueue() cannot result semaphore or mutex. That means prvCopyDataToQueue() cannot result
in a task disinheriting a priority and prvCopyDataToQueue() can be in a task disinheriting a priority and prvCopyDataToQueue() can be
@ -1001,6 +994,12 @@ Queue_t * const pxQueue = xQueue;
the scheduler is suspended before accessing the ready lists. */ the scheduler is suspended before accessing the ready lists. */
( void ) prvCopyDataToQueue( pxQueue, pvItemToQueue, xCopyPosition ); ( void ) prvCopyDataToQueue( pxQueue, pvItemToQueue, xCopyPosition );
/* The event list is not altered if the queue is locked. This will
be done when the queue is unlocked later. */
if( cTxLock == queueUNLOCKED )
{
#if ( configUSE_QUEUE_SETS == 1 )
{
if( pxQueue->pxQueueSetContainer != NULL ) if( pxQueue->pxQueueSetContainer != NULL )
{ {
if( ( xCopyPosition == queueOVERWRITE ) && ( uxPreviousMessagesWaiting != ( UBaseType_t ) 0 ) ) if( ( xCopyPosition == queueOVERWRITE ) && ( uxPreviousMessagesWaiting != ( UBaseType_t ) 0 ) )
@ -1059,13 +1058,6 @@ Queue_t * const pxQueue = xQueue;
} }
#else /* configUSE_QUEUE_SETS */ #else /* configUSE_QUEUE_SETS */
{ {
/* Semaphores use xQueueGiveFromISR(), so pxQueue will not be a
semaphore or mutex. That means prvCopyDataToQueue() cannot result
in a task disinheriting a priority and prvCopyDataToQueue() can be
called here even though the disinherit function does not check if
the scheduler is suspended before accessing the ready lists. */
( void ) prvCopyDataToQueue( pxQueue, pvItemToQueue, xCopyPosition );
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )
{ {
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
@ -1090,6 +1082,9 @@ Queue_t * const pxQueue = xQueue;
{ {
mtCOVERAGE_TEST_MARKER(); mtCOVERAGE_TEST_MARKER();
} }
/* Not used in this path. */
( void ) uxPreviousMessagesWaiting;
} }
#endif /* configUSE_QUEUE_SETS */ #endif /* configUSE_QUEUE_SETS */
} }