change(vector.S): port hw stack guard change to p4

This commit is contained in:
Armando
2023-07-19 16:26:14 +08:00
committed by Armando (Dou Yiwen)
parent ecf1461f1c
commit fd096c012d
2 changed files with 14 additions and 2 deletions

View File

@@ -40,7 +40,7 @@
.type rtos_int_enter, @function .type rtos_int_enter, @function
rtos_int_enter: rtos_int_enter:
#if CONFIG_IDF_TARGET_ESP32P4 #if CONFIG_IDF_TARGET_ESP32P4
/* needs jira for p4 */ //TODO: IDF-7861
/* preserve the return address */ /* preserve the return address */
mv t1, ra mv t1, ra
mv t2, a0 mv t2, a0
@@ -106,7 +106,7 @@ rtos_int_enter:
rtos_enter_end: rtos_enter_end:
#if CONFIG_IDF_TARGET_ESP32P4 #if CONFIG_IDF_TARGET_ESP32P4
/* needs jira for p4 */ //TODO: IDF-7861
mv ra, t1 mv ra, t1
#endif #endif
ret ret

View File

@@ -300,6 +300,12 @@ _interrupt_handler:
/* Save SP */ /* Save SP */
sw t0, RV_STK_SP(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 call rtos_int_enter
/* If this is a non-nested interrupt, SP now points to the interrupt stack */ /* If this is a non-nested interrupt, SP now points to the interrupt stack */
@@ -375,6 +381,12 @@ _interrupt_handler:
#endif #endif
call rtos_int_exit 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 */ /* restore the rest of the registers */
csrw mcause, s1 csrw mcause, s1
csrw mstatus, s2 csrw mstatus, s2