From f423f94d08170575f68909fd8b007b916df854fd Mon Sep 17 00:00:00 2001 From: zhuyanlin Date: Tue, 10 May 2022 18:30:11 +0800 Subject: [PATCH] arch:xtensa: modify xtensa_context_save/restore function with FPU registers in xcp context, use pointer instead of double pointer Signed-off-by: zhuyanlin --- arch/xtensa/include/syscall.h | 2 +- arch/xtensa/src/common/xtensa_dumpstate.c | 2 +- arch/xtensa/src/common/xtensa_exit.c | 2 +- arch/xtensa/src/common/xtensa_sigdeliver.c | 2 +- arch/xtensa/src/common/xtensa_swint.c | 4 ++-- arch/xtensa/src/esp32/esp32_cpustart.c | 2 +- arch/xtensa/src/esp32s3/esp32s3_cpustart.c | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/xtensa/include/syscall.h b/arch/xtensa/include/syscall.h index adc1facd8a..e93fb6f545 100644 --- a/arch/xtensa/include/syscall.h +++ b/arch/xtensa/include/syscall.h @@ -107,7 +107,7 @@ /* SYS call 1: * - * void xtensa_context_restore(uint32_t **restoreregs) noreturn_function; + * void xtensa_context_restore(uint32_t *restoreregs) noreturn_function; */ #define SYS_restore_context (1) diff --git a/arch/xtensa/src/common/xtensa_dumpstate.c b/arch/xtensa/src/common/xtensa_dumpstate.c index 13dcf03123..77b478d676 100644 --- a/arch/xtensa/src/common/xtensa_dumpstate.c +++ b/arch/xtensa/src/common/xtensa_dumpstate.c @@ -299,7 +299,7 @@ void xtensa_dumpstate(void) } else { - up_saveusercontext(&rtcb->xcp.regs); + up_saveusercontext(rtcb->xcp.regs); } /* Dump the registers (if available) */ diff --git a/arch/xtensa/src/common/xtensa_exit.c b/arch/xtensa/src/common/xtensa_exit.c index a59cfe1236..9a0111a279 100644 --- a/arch/xtensa/src/common/xtensa_exit.c +++ b/arch/xtensa/src/common/xtensa_exit.c @@ -139,7 +139,7 @@ void up_exit(int status) /* Then switch contexts */ - xtensa_context_restore(&tcb->xcp.regs); + xtensa_context_restore(tcb->xcp.regs); /* xtensa_context_restore() should not return but could if the * software interrupts are disabled. diff --git a/arch/xtensa/src/common/xtensa_sigdeliver.c b/arch/xtensa/src/common/xtensa_sigdeliver.c index e0c81c29b5..6f8024c602 100644 --- a/arch/xtensa/src/common/xtensa_sigdeliver.c +++ b/arch/xtensa/src/common/xtensa_sigdeliver.c @@ -178,5 +178,5 @@ void xtensa_sig_deliver(void) */ board_autoled_off(LED_SIGNAL); - xtensa_context_restore(®s); + xtensa_context_restore(regs); } diff --git a/arch/xtensa/src/common/xtensa_swint.c b/arch/xtensa/src/common/xtensa_swint.c index 8ff6b43384..8d1715739d 100644 --- a/arch/xtensa/src/common/xtensa_swint.c +++ b/arch/xtensa/src/common/xtensa_swint.c @@ -96,7 +96,7 @@ int xtensa_swint(int irq, void *context, void *arg) case SYS_save_context: { DEBUGASSERT(regs[REG_A3] != 0); - memcpy(*(uint32_t **)regs[REG_A3], regs, XCPTCONTEXT_SIZE); + memcpy((uint32_t *)regs[REG_A3], regs, XCPTCONTEXT_SIZE); } break; @@ -121,7 +121,7 @@ int xtensa_swint(int irq, void *context, void *arg) case SYS_restore_context: { DEBUGASSERT(regs[REG_A3] != 0); - CURRENT_REGS = *(uint32_t **)regs[REG_A3]; + CURRENT_REGS = (uint32_t *)regs[REG_A3]; } break; diff --git a/arch/xtensa/src/esp32/esp32_cpustart.c b/arch/xtensa/src/esp32/esp32_cpustart.c index bc54defc08..ab770c4d3e 100644 --- a/arch/xtensa/src/esp32/esp32_cpustart.c +++ b/arch/xtensa/src/esp32/esp32_cpustart.c @@ -209,7 +209,7 @@ void IRAM_ATTR xtensa_appcpu_start(void) * be the CPUs NULL task. */ - xtensa_context_restore(&tcb->xcp.regs); + xtensa_context_restore(tcb->xcp.regs); } /**************************************************************************** diff --git a/arch/xtensa/src/esp32s3/esp32s3_cpustart.c b/arch/xtensa/src/esp32s3/esp32s3_cpustart.c index b907b06692..ad0857f506 100644 --- a/arch/xtensa/src/esp32s3/esp32s3_cpustart.c +++ b/arch/xtensa/src/esp32s3/esp32s3_cpustart.c @@ -169,7 +169,7 @@ void xtensa_appcpu_start(void) * be the CPUs NULL task. */ - xtensa_context_restore(&tcb->xcp.regs); + xtensa_context_restore(tcb->xcp.regs); } /****************************************************************************