I see at the porting of threadx that in the top of each thread stack there are reserved uninitialized bytes, and then 16 zero bytes and just then the stack really begins.
The zero bytes called there backtrace. At the arm ports it is 4 bytes uninitialized and 4 zero (here for example), and at ARC porting both are 16 bytes sizes (here for example).
One more important thing is that the uninitialized bytes are initialized to 0xef if TX_DISABLE_STACK_FILLING isn't defined.
My questions are:
- Why there is a difference between ARC porting and ARM porting?
- Why those bytes exist? Is there is a trace tool or somthing in the algorithm that uses those bytes, or they are just for seeing in the memory 'by hands' that this memory didn't changed?