This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
FreeRTOS-Kernel/portable/ThirdParty/XCC/Xtensa
magicse7en b9748e50ea
Xtensa: fix stack overlap coproc_area issue (#118)
In function pxPortInitialiseStack of port.c:
	sp = ( StackType_t * ) ( ( ( UBaseType_t ) ( pxTopOfStack + 1 )  - XT_CP_SIZE - XT_STK_FRMSZ ) & ~0xf );
We assume XT_CP_SIZE is 0xE4, XT_STK_FRMSZ is 0xA0, pxTopOfStack is 0xA0000000, sp is 0x9FFFFE80.
From port.c, we know the frame->a1 as below:
	frame->a1 = ( UBaseType_t ) sp + XT_STK_FRMSZ;  /* physical top of stack frame    */
So frame->a1 is 0x9FFFFF20. Therefore the interrupt stack frame range is 0x9FFFFE80 ~ 0x9FFFFF20.

The coproc_area is: p = ( uint32_t * ) ( ( ( uint32_t ) pxTopOfStack - XT_CP_SIZE ) & ~0xf );
So its value is 0x9FFFFF10. Obviously, the interrupt stack frame overlaps the coproc_area.

Co-authored-by: Carl Lundin <53273776+lundinc2@users.noreply.github.com>
2020-10-26 11:07:32 -07:00
..
Makefile Re-sync with upstream and stripping away none kernel related. 2020-02-10 13:45:57 -08:00
port.c Xtensa: fix stack overlap coproc_area issue (#118) 2020-10-26 11:07:32 -07:00
portasm.S Re-sync with upstream and stripping away none kernel related. 2020-02-10 13:45:57 -08:00
portbenchmark.h Style: Revert uncrustify for portable directories (#122) 2020-08-17 10:51:02 -07:00
portclib.c Style: Revert uncrustify for portable directories (#122) 2020-08-17 10:51:02 -07:00
portmacro.h Update version number to 10.4.1 (#173) 2020-09-17 15:25:15 -07:00
porttrace.h Style: Revert uncrustify for portable directories (#122) 2020-08-17 10:51:02 -07:00
readme_xtensa.txt Re-sync with upstream and stripping away none kernel related. 2020-02-10 13:45:57 -08:00
xtensa_api.h Style: Revert uncrustify for portable directories (#122) 2020-08-17 10:51:02 -07:00
xtensa_config.h Style: Revert uncrustify for portable directories (#122) 2020-08-17 10:51:02 -07:00
xtensa_context.h Style: Revert uncrustify for portable directories (#122) 2020-08-17 10:51:02 -07:00
xtensa_context.S Re-sync with upstream and stripping away none kernel related. 2020-02-10 13:45:57 -08:00
xtensa_init.c Style: Revert uncrustify for portable directories (#122) 2020-08-17 10:51:02 -07:00
xtensa_intr_asm.S Re-sync with upstream and stripping away none kernel related. 2020-02-10 13:45:57 -08:00
xtensa_intr.c Style: Revert uncrustify for portable directories (#122) 2020-08-17 10:51:02 -07:00
xtensa_overlay_os_hook.c Style: Revert uncrustify for portable directories (#122) 2020-08-17 10:51:02 -07:00
xtensa_rtos.h Style: Revert uncrustify for portable directories (#122) 2020-08-17 10:51:02 -07:00
xtensa_timer.h Style: Revert uncrustify for portable directories (#122) 2020-08-17 10:51:02 -07:00
xtensa_vectors.S Re-sync with upstream and stripping away none kernel related. 2020-02-10 13:45:57 -08:00