From 8fe3ab3e39fc15ec04593eae8fa7e955584945eb Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Thu, 17 Oct 2024 11:43:25 +0300 Subject: [PATCH] arch/arm64: Remove arm64_copystate.c The file is not referenced from anywhere and is obsolete / dead code anyway -> remove it from the index. --- arch/arm64/src/common/CMakeLists.txt | 2 +- arch/arm64/src/common/Make.defs | 2 +- arch/arm64/src/common/arm64_copystate.c | 120 ------------------------ 3 files changed, 2 insertions(+), 122 deletions(-) delete mode 100644 arch/arm64/src/common/arm64_copystate.c diff --git a/arch/arm64/src/common/CMakeLists.txt b/arch/arm64/src/common/CMakeLists.txt index c86e4604f7e..ad9b1d07259 100644 --- a/arch/arm64/src/common/CMakeLists.txt +++ b/arch/arm64/src/common/CMakeLists.txt @@ -27,7 +27,7 @@ list(APPEND SRCS arm64_fork_func.S) # Common C source files ( OS call up_xxx) list(APPEND SRCS arm64_initialize.c arm64_initialstate.c arm64_boot.c) -list(APPEND SRCS arm64_nputs.c arm64_copystate.c arm64_createstack.c) +list(APPEND SRCS arm64_nputs.c arm64_createstack.c) list(APPEND SRCS arm64_releasestack.c arm64_stackframe.c arm64_usestack.c) list(APPEND SRCS arm64_exit.c arm64_fork.c) list(APPEND SRCS arm64_schedulesigaction.c arm64_sigdeliver.c) diff --git a/arch/arm64/src/common/Make.defs b/arch/arm64/src/common/Make.defs index 6d39bd8b59b..c22af8617ea 100644 --- a/arch/arm64/src/common/Make.defs +++ b/arch/arm64/src/common/Make.defs @@ -39,7 +39,7 @@ CMN_ASRCS += arm64_fork_func.S # Common C source files ( OS call up_xxx) CMN_CSRCS = arm64_initialize.c arm64_initialstate.c arm64_boot.c -CMN_CSRCS += arm64_nputs.c arm64_copystate.c arm64_createstack.c +CMN_CSRCS += arm64_nputs.c arm64_createstack.c CMN_CSRCS += arm64_releasestack.c arm64_stackframe.c arm64_usestack.c CMN_CSRCS += arm64_exit.c arm64_fork.c CMN_CSRCS += arm64_schedulesigaction.c arm64_sigdeliver.c diff --git a/arch/arm64/src/common/arm64_copystate.c b/arch/arm64/src/common/arm64_copystate.c deleted file mode 100644 index bc50fefa7bc..00000000000 --- a/arch/arm64/src/common/arm64_copystate.c +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** - * arch/arm64/src/common/arm64_copystate.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "arm64_internal.h" -#include "sched/sched.h" - -#ifdef CONFIG_ARCH_FPU -#include "arm64_fpu.h" -#endif - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -#ifdef CONFIG_ARCH_FPU -int arch_save_fpucontext(void *saveregs) -{ - irqstate_t flags; - uintptr_t p_save; - - /* Take a snapshot of the thread context right now */ - - flags = enter_critical_section(); - - p_save = (uintptr_t)saveregs + ARM64_CONTEXT_SIZE; - arm64_fpu_save((uint64_t *)p_save); - ARM64_DSB(); - - leave_critical_section(flags); - return 0; -} -#endif - -int arm64_syscall_save_context(uint64_t * regs) -{ - uint64_t *p_save; - int i; - -#ifdef CONFIG_ARCH_FPU - uint64_t *p_fpu; - struct tcb_s *rtcb; - struct tcb_s *rtcb_cur = running_task(); -#endif - - DEBUGASSERT(regs); - - DEBUGASSERT(regs[REG_X1] != 0 && regs[REG_X2] != 0); - - p_save = (uint64_t *)regs[REG_X2]; - - for (i = 0; i < ARM64_CONTEXT_REGS; i++) - { - p_save[i] = regs[i]; - } - -#ifdef CONFIG_ARCH_FPU - rtcb = (struct tcb_s *)regs[REG_X1]; - p_save += ARM64_CONTEXT_SIZE; - if (rtcb_cur == rtcb) - { - arch_save_fpucontext(p_save); - } - else - { - p_fpu = (uint64_t *)rtcb->xcp.regs; - p_fpu += ARM64_CONTEXT_REGS; - for (i = 0; i < FPU_CONTEXT_REGS; i++) - { - p_save[i] = p_fpu[i]; - } - } -#endif - - return OK; -}