diff --git a/arch/arm64/src/common/arm64_internal.h b/arch/arm64/src/common/arm64_internal.h index 081908cffb8..98c4e79c00d 100644 --- a/arch/arm64/src/common/arm64_internal.h +++ b/arch/arm64/src/common/arm64_internal.h @@ -254,7 +254,6 @@ void arm64_secondary_start(void); void arm64_fullcontextrestore(uint64_t *restoreregs) noreturn_function; void arm64_switchcontext(uint64_t **saveregs, uint64_t *restoreregs); -void arm64_context_snapshot(void *savereg); /* Signal handling **********************************************************/ diff --git a/arch/arm64/src/common/arm64_task_sched.c b/arch/arm64/src/common/arm64_task_sched.c index bb5254345a1..69f27df8c1a 100644 --- a/arch/arm64/src/common/arm64_task_sched.c +++ b/arch/arm64/src/common/arm64_task_sched.c @@ -44,44 +44,6 @@ * Public Functions ****************************************************************************/ -/**************************************************************************** - * Name: up_saveusercontext - * - * Description: - * Save the current thread context. Full prototype is: - * - * int up_saveusercontext(void *saveregs); - * - * Returned Value: - * 0: Normal return - * 1: Context switch return - * - ****************************************************************************/ -#ifdef CONFIG_BUILD_FLAT - -int up_saveusercontext(void *saveregs) -{ - irqstate_t flags; - - /* Take a snapshot of the thread context right now */ - - flags = enter_critical_section(); - - arm64_context_snapshot(saveregs); - - leave_critical_section(flags); - return 0; -} - -#else - -int up_saveusercontext(void *saveregs) -{ - return sys_call1(SYS_save_context, (uintptr_t)saveregs); -} - -#endif - /**************************************************************************** * Name: arm64_fullcontextrestore * diff --git a/arch/arm64/src/common/arm64_vectors.S b/arch/arm64/src/common/arm64_vectors.S index 14c6f61ada6..77507cfad9d 100644 --- a/arch/arm64/src/common/arm64_vectors.S +++ b/arch/arm64/src/common/arm64_vectors.S @@ -60,15 +60,15 @@ ****************************************************************************/ /**************************************************************************** - * Function: arm64_context_snapshot + * Function: up_saveusercontext * * Description: * Take a snapshot of the thread GP registers context * x0 --- pointer to struct regs_context * ****************************************************************************/ -GTEXT(arm64_context_snapshot) -SECTION_FUNC(text, arm64_context_snapshot) +GTEXT(up_saveusercontext) +SECTION_FUNC(text, up_saveusercontext) str x0, [sp, #-16]! stp x0, x1, [x0, #8 * REG_X0]