diff --git a/arch/risc-v/src/common/Make.defs b/arch/risc-v/src/common/Make.defs index b614213c1ba..b85fdcd1006 100644 --- a/arch/risc-v/src/common/Make.defs +++ b/arch/risc-v/src/common/Make.defs @@ -28,7 +28,7 @@ CMN_ASRCS += riscv_saveusercontext.S # Specify C code within the common directory to be included CMN_CSRCS += riscv_initialize.c riscv_swint.c riscv_mtimer.c -CMN_CSRCS += riscv_allocateheap.c riscv_createstack.c riscv_copystate.c +CMN_CSRCS += riscv_allocateheap.c riscv_createstack.c CMN_CSRCS += riscv_cpuidlestack.c riscv_doirq.c riscv_exit.c riscv_exception.c CMN_CSRCS += riscv_getnewintctx.c riscv_getintstack.c riscv_initialstate.c CMN_CSRCS += riscv_idle.c riscv_modifyreg32.c riscv_nputs.c riscv_releasestack.c diff --git a/arch/risc-v/src/common/riscv_copystate.c b/arch/risc-v/src/common/riscv_copystate.c deleted file mode 100644 index 064e1af5226..00000000000 --- a/arch/risc-v/src/common/riscv_copystate.c +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** - * arch/risc-v/src/common/riscv_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 "riscv_internal.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: riscv_copystate - ****************************************************************************/ - -/* A little faster than most memcpy's */ - -void riscv_copystate(uintptr_t *dest, uintptr_t *src) -{ - int i; - - /* In the RISC-V model, the state is copied from the stack to the TCB, - * but only a reference is passed to get the state from the TCB. So the - * following check avoids copying the TCB save area onto itself: - */ - - if (src != dest) - { - /* save integer registers first */ - - for (i = 0; i < XCPTCONTEXT_REGS; i++) - { - *dest++ = *src++; - } - } -} diff --git a/arch/risc-v/src/common/riscv_internal.h b/arch/risc-v/src/common/riscv_internal.h index a6602b06aa6..5dcfde75f24 100644 --- a/arch/risc-v/src/common/riscv_internal.h +++ b/arch/risc-v/src/common/riscv_internal.h @@ -195,8 +195,6 @@ void riscv_addregion(void); void riscv_ack_irq(int irq); -void riscv_copystate(uintptr_t *dest, uintptr_t *src); - void riscv_sigdeliver(void); int riscv_swint(int irq, void *context, void *arg); uintptr_t riscv_get_newintctx(void);