Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Commit 3761a1e

Browse files
authored
Change uxPendedTicks to xPendedTicks in all proofs (#1758)
This ensures that CBMC proofs are able to build after the name-change in commit 23839bb.
1 parent 1ac6935 commit 3761a1e

File tree

8 files changed

+19
-16
lines changed

8 files changed

+19
-16
lines changed

tools/cbmc/patches/0005-Remove-volatile-qualifier-from-tasks-variables.patch

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,15 @@ index ff657733..8b57d198 100644
6565
PRIVILEGED_DATA static List_t xPendingReadyList; /*< Tasks that have been readied while the scheduler was suspended. They will be moved to the ready list when the scheduler is resumed. */
6666

6767
#if( INCLUDE_vTaskDelete == 1 )
68-
@@ -368,7 +368,7 @@ PRIVILEGED_DATA static volatile UBaseType_t uxCurrentNumberOfTasks = ( UBaseTyp
68+
@@ -368,10 +368,10 @@ PRIVILEGED_DATA static volatile UBaseType_t uxCurrentNumberOfTasks = ( UBaseTyp
69+
70+
/* Other file private variables. --------------------------------*/
71+
PRIVILEGED_DATA static volatile UBaseType_t uxCurrentNumberOfTasks = ( UBaseType_t ) 0U;
6972
PRIVILEGED_DATA static volatile TickType_t xTickCount = ( TickType_t ) configINITIAL_TICK_COUNT;
7073
PRIVILEGED_DATA static volatile UBaseType_t uxTopReadyPriority = tskIDLE_PRIORITY;
7174
PRIVILEGED_DATA static volatile BaseType_t xSchedulerRunning = pdFALSE;
72-
-PRIVILEGED_DATA static volatile UBaseType_t uxPendedTicks = ( UBaseType_t ) 0U;
73-
+PRIVILEGED_DATA static UBaseType_t uxPendedTicks = ( UBaseType_t ) 0U;
75+
-PRIVILEGED_DATA static volatile TickType_t xPendedTicks = ( TickType_t ) 0U;
76+
+PRIVILEGED_DATA static TickType_t xPendedTicks = ( TickType_t ) 0U;
7477
PRIVILEGED_DATA static volatile BaseType_t xYieldPending = pdFALSE;
7578
PRIVILEGED_DATA static volatile BaseType_t xNumOfOverflows = ( BaseType_t ) 0;
7679
PRIVILEGED_DATA static UBaseType_t uxTaskNumber = ( UBaseType_t ) 0U;

tools/cbmc/patches/0006-Remove-static-from-prvNotifyQueueSetContainer.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ index 17a6964e..24a40c29 100644
66
* Checks to see if a queue is a member of a queue set, and if so, notifies
77
* the queue set that the queue contains data.
88
*/
9-
- static BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue, const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
10-
+ BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue, const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
9+
- static BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue ) PRIVILEGED_FUNCTION;
10+
+ BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue ) PRIVILEGED_FUNCTION;
1111
#endif
1212

1313
/*
1414
@@ -2887,7 +2887,7 @@ Queue_t * const pxQueue = xQueue;
1515

1616
#if ( configUSE_QUEUE_SETS == 1 )
1717

18-
- static BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue, const BaseType_t xCopyPosition )
19-
+ BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue, const BaseType_t xCopyPosition )
18+
- static BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue )
19+
+ BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue )
2020
{
2121
Queue_t *pxQueueSetContainer = pxQueue->pxQueueSetContainer;
2222
BaseType_t xReturn = pdFALSE;

tools/cbmc/proofs/Queue/QueueGenericSend/QueueGenericSend_harness.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ BaseType_t prvCopyDataToQueue( Queue_t * const pxQueue, const void *pvItemToQueu
5959
}
6060
}
6161
#else
62-
BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue, const BaseType_t xCopyPosition )
62+
BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue )
6363
{
6464
Queue_t *pxQueueSetContainer = pxQueue->pxQueueSetContainer;
6565
configASSERT( pxQueueSetContainer );
@@ -69,7 +69,7 @@ BaseType_t prvCopyDataToQueue( Queue_t * const pxQueue, const void *pvItemToQueu
6969
configASSERT( pxQueue );
7070
if( pxQueue->pxQueueSetContainer != NULL )
7171
{
72-
prvNotifyQueueSetContainer(pxQueue, queueSEND_TO_BACK);
72+
prvNotifyQueueSetContainer(pxQueue);
7373
}
7474
listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) );
7575
pxQueue->cTxLock = queueUNLOCKED;

tools/cbmc/proofs/TaskPool/TaskDelay/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ This proof demonstrates the memory safety of the TaskDelay function. We assume
22
that `pxCurrentTCB` is initialized and inserted in one of the ready tasks lists
33
(with and without another task in the same list). We abstract function
44
`xTaskResumeAll` by assuming that `xPendingReadyList` is empty and
5-
`uxPendedTicks` is `0`. Finally, we assume nondeterministic values for global
5+
`xPendedTicks` is `0`. Finally, we assume nondeterministic values for global
66
variables `xTickCount` and `xNextTaskUnblockTime`, and `pdFALSE` for
77
`uxSchedulerSuspended` (to avoid assertion failure).
88

tools/cbmc/proofs/TaskPool/TaskDelay/tasks_test_access_functions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ BaseType_t xPrepareTaskLists( void )
124124
/*
125125
* We stub out `xTaskResumeAll` including the assertion and change on
126126
* variables `uxSchedulerSuspended`. We assume that `xPendingReadyList`
127-
* is empty to avoid the first loop, and uxPendedTicks to avoid the second
127+
* is empty to avoid the first loop, and xPendedTicks to avoid the second
128128
* one. Finally, we return a nondeterministic value (overapproximation)
129129
*/
130130
BaseType_t xTaskResumeAllStub( void )
@@ -137,7 +137,7 @@ BaseType_t xTaskResumeAllStub( void )
137137
{
138138
--uxSchedulerSuspended;
139139
__CPROVER_assert( listLIST_IS_EMPTY( &xPendingReadyList ), "Pending ready tasks list not empty." );
140-
__CPROVER_assert( uxPendedTicks == 0 , "uxPendedTicks is not equal to zero.");
140+
__CPROVER_assert( xPendedTicks == 0 , "xPendedTicks is not equal to zero.");
141141
}
142142
taskEXIT_CRITICAL();
143143

tools/cbmc/proofs/TaskPool/TaskIncrementTick/tasks_test_access_functions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ TaskHandle_t xUnconstrainedTCB( void )
7272
*/
7373
void vSetGlobalVariables()
7474
{
75-
uxPendedTicks = nondet_ubasetype();
75+
xPendedTicks = nondet_ubasetype();
7676
uxSchedulerSuspended = nondet_ubasetype();
7777
xYieldPending = nondet_basetype();
7878
xTickCount = nondet_ticktype();

tools/cbmc/proofs/TaskPool/TaskResumeAll/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
This proof demonstrates the memory safety of the TaskResumeAll function. We
22
assume that task lists are initialized and filled with a few list items. We
33
also assume that some global variables are set to a nondeterministic value,
4-
except for `uxSchedulerSuspended` which cannot be 0 and `uxPendedTicks` which
4+
except for `uxSchedulerSuspended` which cannot be 0 and `xPendedTicks` which
55
is either `1` (to unwind a loop in a reasonable amount of time) or `0`.
66

77
Configurations available:

tools/cbmc/proofs/TaskPool/TaskResumeAll/tasks_test_access_functions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ TaskHandle_t xUnconstrainedTCB( void )
6767
}
6868

6969
/*
70-
* We set uxPendedTicks since __CPROVER_assume does not work
70+
* We set xPendedTicks since __CPROVER_assume does not work
7171
* well with statically initialised variables
7272
*/
7373
void vSetGlobalVariables( void ) {
@@ -76,7 +76,7 @@ void vSetGlobalVariables( void ) {
7676
__CPROVER_assume( uxNonZeroValue != 0 );
7777

7878
uxSchedulerSuspended = uxNonZeroValue;
79-
uxPendedTicks = nondet_bool() ? PENDED_TICKS : 0;
79+
xPendedTicks = nondet_bool() ? PENDED_TICKS : 0;
8080
uxCurrentNumberOfTasks = nondet_ubasetype();
8181
xTickCount = nondet_ticktype();
8282
}

0 commit comments

Comments
 (0)