esp-idf/components/freertos/xtensa
Ivan Grokhotkov 04b95f3567 freertos: don't clobber a4 while spilling register windows
Commit 891eb3b0 was fixing an issue with PS and EPC1 not being
preserved after the window spill procedure. It did so by saving PS in
a2 and EPC1 in a4. However the a4 register may be a live register of
another window in the call stack, and if it is overwritten and then
spilled to the stack, then the corresponding register value will end
up being corrupted. In practice the problem would show up as an
IllegalInstruction exception, when trying to return from a function
when a0 value was 0x40020.
Fix by using a0 register instead of a4 as scratch. Also fix a comment
about xthal_save_extra_nw, as this function in fact doesn't clobber
a4 or a5 because XCHAL_NCP_NUM_ATMPS is defined as 1.

Closes https://github.com/espressif/esp-idf/issues/5758
2020-09-02 15:40:41 +02:00
..
include/freertos freertos: ensure the interrupt stack is aligned 2020-08-05 12:51:41 +02:00
port.c esp32s3: clk, memory layout 2020-07-27 13:05:22 +08:00
portasm.S Merge branch 'feature/freertos_fpu_isr' into 'master' 2020-01-30 13:38:37 +08:00
portmacro_priv.h freertos: moved all xtensa specific files into a separated folder 2020-01-27 16:05:30 -03:00
readme_xtensa.txt freertos: moved all xtensa specific files into a separated folder 2020-01-27 16:05:30 -03:00
xt_asm_utils.h freertos: moved all xtensa specific files into a separated folder 2020-01-27 16:05:30 -03:00
xtensa_context.S freertos: don't clobber a4 while spilling register windows 2020-09-02 15:40:41 +02:00
xtensa_init.c freertos: moved all xtensa specific files into a separated folder 2020-01-27 16:05:30 -03:00
xtensa_intr_asm.S freertos: moved all xtensa specific files into a separated folder 2020-01-27 16:05:30 -03:00
xtensa_intr.c esp_rom: extract common ets apis into esp_rom_sys.h 2020-07-27 15:27:01 +08:00
xtensa_loadstore_handler.S Exception handlers for LoadStoreError and LoadStoreAlignmentError 2020-02-26 20:21:59 +08:00
xtensa_overlay_os_hook.c freertos: moved all xtensa specific files into a separated folder 2020-01-27 16:05:30 -03:00
xtensa_vector_defaults.S freertos: moved all xtensa specific files into a separated folder 2020-01-27 16:05:30 -03:00
xtensa_vectors.S esp32, esp32s2: move panic handling code to new component 2020-03-10 19:56:24 +08:00