Refined task control block predicate TCB_p such that it can be used to justify memset-ing the stack.

This commit is contained in:
Tobias Reinhard 2022-10-25 13:22:10 -04:00
parent 80134a65ed
commit 1042ea8cf8
3 changed files with 15 additions and 7 deletions

View file

@ -1356,12 +1356,12 @@ static void prvYieldForTask( TCB_t * pxTCB,
pxNewTCB = ( TCB_t * ) pvPortMalloc( sizeof( TCB_t ) ); /*lint !e9087 !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack, and the first member of TCB_t is always a pointer to the task's stack. */
if( pxNewTCB != NULL )
{
{
/* Store the stack location in the TCB. */
pxNewTCB->pxStack = pxStack;
//@ close xLIST_ITEM(&pxNewTCB->xStateListItem, _, _, _, _);
//@ close xLIST_ITEM(&pxNewTCB->xEventListItem, _, _, _, _);
//@ close TCB_p(pxNewTCB);
//@ close TCB_p(pxNewTCB, ((size_t) usStackDepth) * sizeof(StackType_t));
}
else
{

View file

@ -81,7 +81,7 @@ predicate xLIST_ITEM(
/*@
// This predicate represents the memory corresponding to an
// instance of type `TCB_t` aka `tskTaskControlBlock`.
predicate TCB_p(TCB_t * tcb) =
predicate TCB_p(TCB_t * tcb, int stackSize) =
malloc_block_tskTaskControlBlock(tcb) &*&
tcb->pxTopOfStack |-> _ &*&
@ -91,7 +91,11 @@ predicate TCB_p(TCB_t * tcb) =
struct_xLIST_ITEM_padding(&tcb->xEventListItem) &*&
tcb->uxPriority |-> _ &*&
tcb->pxStack |-> _ &*&
tcb->pxStack |-> ?stackPtr &*&
chars_((char*) stackPtr, stackSize, _) &*&
malloc_block_chars((char*) stackPtr, stackSize) &*&
tcb->xTaskRunState |-> _ &*&
tcb->xIsIdle |-> _ &*&
@ -10723,7 +10727,7 @@ static void prvYieldForTask( TCB_t * pxTCB,
pxNewTCB->pxStack = pxStack;
//@ close xLIST_ITEM(&pxNewTCB->xStateListItem, _, _, _, _);
//@ close xLIST_ITEM(&pxNewTCB->xEventListItem, _, _, _, _);
//@ close TCB_p(pxNewTCB);
//@ close TCB_p(pxNewTCB, ((size_t) usStackDepth) * sizeof(StackType_t));
}
else
{

View file

@ -8,7 +8,7 @@
/*@
// This predicate represents the memory corresponding to an
// instance of type `TCB_t` aka `tskTaskControlBlock`.
predicate TCB_p(TCB_t * tcb) =
predicate TCB_p(TCB_t * tcb, int stackSize) =
malloc_block_tskTaskControlBlock(tcb) &*&
tcb->pxTopOfStack |-> _ &*&
@ -18,7 +18,11 @@ predicate TCB_p(TCB_t * tcb) =
struct_xLIST_ITEM_padding(&tcb->xEventListItem) &*&
tcb->uxPriority |-> _ &*&
tcb->pxStack |-> _ &*&
tcb->pxStack |-> ?stackPtr &*&
chars_((char*) stackPtr, stackSize, _) &*&
malloc_block_chars((char*) stackPtr, stackSize) &*&
tcb->xTaskRunState |-> _ &*&
tcb->xIsIdle |-> _ &*&