diff --git a/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S b/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S index 519c76da12..d3f24f27d2 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S +++ b/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S @@ -40,7 +40,7 @@ .type rtos_int_enter, @function rtos_int_enter: #if CONFIG_IDF_TARGET_ESP32P4 - /* needs jira for p4 */ + //TODO: IDF-7861 /* preserve the return address */ mv t1, ra mv t2, a0 @@ -106,7 +106,7 @@ rtos_int_enter: rtos_enter_end: #if CONFIG_IDF_TARGET_ESP32P4 - /* needs jira for p4 */ + //TODO: IDF-7861 mv ra, t1 #endif ret diff --git a/components/riscv/vectors.S b/components/riscv/vectors.S index b3c59c8e98..1e055433a3 100644 --- a/components/riscv/vectors.S +++ b/components/riscv/vectors.S @@ -300,6 +300,12 @@ _interrupt_handler: /* Save SP */ sw t0, RV_STK_SP(sp) +#if CONFIG_IDF_TARGET_ESP32P4 + //TODO: IDF-7861 + /* Before doing anythig preserve the stack pointer */ + /* It will be saved in current TCB, if needed */ + mv a0, sp +#endif //#if CONFIG_IDF_TARGET_ESP32P4 call rtos_int_enter /* If this is a non-nested interrupt, SP now points to the interrupt stack */ @@ -375,6 +381,12 @@ _interrupt_handler: #endif call rtos_int_exit +#if CONFIG_IDF_TARGET_ESP32P4 + //TODO: IDF-7861 + /* The next (or current) stack pointer is returned in a0 */ + mv sp, a0 +#endif //#if CONFIG_IDF_TARGET_ESP32P4 + /* restore the rest of the registers */ csrw mcause, s1 csrw mstatus, s2