Xtensa: fix stack overlap coproc_area issue #118
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In function
We assume
XT_CP_SIZEis0xE4,XT_STK_FRMSZis0xA0,pxTopOfStackis0xA0000000,spis0x9FFFFE80.From port.c, we know the
frame->a1as below:frame->a1 = ( UBaseType_t ) sp + XT_STK_FRMSZ; /* physical top of stack frame */So
frame->a1is0x9FFFFF20. Therefore the interrupt stack frame range is0x9FFFFE80 ~ 0x9FFFFF20.The
coproc_areais:p = ( uint32_t * ) ( ( ( uint32_t ) pxTopOfStack - XT_CP_SIZE ) & ~0xf );So its value is
0x9FFFFF10. Obviously, the interrupt stack frame overlaps the coproc_area.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.