From 6b38a045a5a650fd64ff9170d53c127bb5f56d09 Mon Sep 17 00:00:00 2001 From: hujun5 Date: Fri, 29 Nov 2024 18:13:46 +0800 Subject: [PATCH] arm64: change some format fix the comment in https://github.com/apache/nuttx/pull/14980 Signed-off-by: hujun5 --- arch/arm64/src/common/arm64_syscall.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/arch/arm64/src/common/arm64_syscall.c b/arch/arm64/src/common/arm64_syscall.c index 4ada7b2288a43..d7d0a66a03e75 100644 --- a/arch/arm64/src/common/arm64_syscall.c +++ b/arch/arm64/src/common/arm64_syscall.c @@ -192,7 +192,11 @@ uint64_t *arm64_syscall(uint64_t *regs) /* Restore the cpu lock */ restore_critical_section(tcb, cpu); +#ifdef CONFIG_ARCH_ADDRENV + addrenv_switch(tcb); +#endif break; + case SYS_switch_context: /* Update scheduler parameters */ @@ -204,6 +208,9 @@ uint64_t *arm64_syscall(uint64_t *regs) /* Restore the cpu lock */ restore_critical_section(tcb, cpu); +#ifdef CONFIG_ARCH_ADDRENV + addrenv_switch(tcb); +#endif break; #ifdef CONFIG_BUILD_KERNEL @@ -315,18 +322,5 @@ uint64_t *arm64_syscall(uint64_t *regs) break; } -#ifdef CONFIG_ARCH_ADDRENV - /* Make sure that the address environment for the previously - * running task is closed down gracefully (data caches dump, - * MMU flushed) and set up the address environment for the new - * thread at the head of the ready-to-run list. - */ - - if (SYS_restore_context == cmd || SYS_switch_context == cmd) - { - addrenv_switch(NULL); - } -#endif - return tcb->xcp.regs; }