Return stack size and usage in task status array
These values are in place of the stack base pointer that was not being set.
This commit is contained in:
parent
1b7bdfaa0e
commit
241ecad44e
1 changed files with 5 additions and 0 deletions
|
@ -87,6 +87,7 @@ task.h is included from an application file. */
|
||||||
#include "StackMacros.h"
|
#include "StackMacros.h"
|
||||||
#include "portmacro.h"
|
#include "portmacro.h"
|
||||||
#include "semphr.h"
|
#include "semphr.h"
|
||||||
|
#include "heap_regions_debug.h"
|
||||||
|
|
||||||
/* Lint e961 and e750 are suppressed as a MISRA exception justified because the
|
/* Lint e961 and e750 are suppressed as a MISRA exception justified because the
|
||||||
MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined for the
|
MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined for the
|
||||||
|
@ -3660,6 +3661,10 @@ BaseType_t xTaskGetAffinity( TaskHandle_t xTask )
|
||||||
pxTaskStatusArray[ uxTask ].xTaskNumber = pxNextTCB->uxTCBNumber;
|
pxTaskStatusArray[ uxTask ].xTaskNumber = pxNextTCB->uxTCBNumber;
|
||||||
pxTaskStatusArray[ uxTask ].eCurrentState = eState;
|
pxTaskStatusArray[ uxTask ].eCurrentState = eState;
|
||||||
pxTaskStatusArray[ uxTask ].uxCurrentPriority = pxNextTCB->uxPriority;
|
pxTaskStatusArray[ uxTask ].uxCurrentPriority = pxNextTCB->uxPriority;
|
||||||
|
os_block_t* stackblk = (os_block_t*)(pxNextTCB->pxStack - sizeof(os_block_t));
|
||||||
|
uint32_t stackinfo = (stackblk->size - sizeof(debug_block_t) - sizeof(block_tail_t)) << 16;
|
||||||
|
stackinfo |= pxNextTCB->pxTopOfStack - pxNextTCB->pxStack;
|
||||||
|
pxTaskStatusArray[ uxTask ].pxStackBase = (StackType_t*)stackinfo;
|
||||||
|
|
||||||
#if ( INCLUDE_vTaskSuspend == 1 )
|
#if ( INCLUDE_vTaskSuspend == 1 )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue