arch: Move setjmp/longjmp to libc/machine

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2021-04-05 03:51:24 +08:00 committed by Brennan Ashton
parent 92c61058c1
commit d62ae03bf8
33 changed files with 52 additions and 158 deletions

View File

@ -25,12 +25,6 @@ ifneq ($(CONFIG_CXD56_TESTSET),y)
CMN_ASRCS += arm_testset.S
endif
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c
CMN_CSRCS += arm_createstack.c arm_exit.c
CMN_CSRCS += arm_initialize.c arm_initialstate.c arm_interruptcontext.c

View File

@ -21,12 +21,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_allocateheap.c arm_assert.c arm_blocktask.c arm_copyfullstate.c
CMN_CSRCS += arm_createstack.c arm_doirq.c arm_exit.c arm_hardfault.c
CMN_CSRCS += arm_initialize.c arm_initialstate.c arm_interruptcontext.c

View File

@ -21,12 +21,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_allocateheap.c arm_assert.c arm_blocktask.c arm_copyfullstate.c
CMN_CSRCS += arm_createstack.c arm_doirq.c arm_exit.c arm_hardfault.c
CMN_CSRCS += arm_initialize.c arm_initialstate.c arm_interruptcontext.c

View File

@ -23,12 +23,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c
CMN_CSRCS += arm_createstack.c arm_mdelay.c arm_udelay.c arm_exit.c
CMN_CSRCS += arm_initialize.c arm_initialstate.c arm_interruptcontext.c

View File

@ -21,12 +21,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_mdelay.c arm_udelay.c arm_exit.c arm_initialize.c arm_memfault.c
CMN_CSRCS += arm_initialstate.c arm_interruptcontext.c arm_modifyreg8.c

View File

@ -21,12 +21,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c
CMN_CSRCS += arm_createstack.c arm_mdelay.c arm_udelay.c arm_exit.c
CMN_CSRCS += arm_initialize.c arm_initialstate.c arm_interruptcontext.c

View File

@ -23,12 +23,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_mdelay.c arm_udelay.c arm_exit.c arm_initialize.c arm_memfault.c
CMN_CSRCS += arm_initialstate.c arm_interruptcontext.c arm_modifyreg8.c

View File

@ -21,12 +21,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_doirq.c arm_exit.c arm_hardfault.c arm_initialize.c
CMN_CSRCS += arm_initialstate.c arm_interruptcontext.c arm_mdelay.c

View File

@ -21,12 +21,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_doirq.c arm_exit.c arm_hardfault.c arm_initialize.c
CMN_CSRCS += arm_initialstate.c arm_interruptcontext.c arm_mdelay.c

View File

@ -23,12 +23,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_allocateheap.c arm_assert.c arm_blocktask.c arm_copyfullstate.c
CMN_CSRCS += arm_createstack.c arm_doirq.c arm_exit.c arm_hardfault.c
CMN_CSRCS += arm_initialize.c arm_initialstate.c arm_interruptcontext.c

View File

@ -36,12 +36,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c
CMN_CSRCS += arm_createstack.c arm_doirq.c arm_exit.c arm_hardfault.c
CMN_CSRCS += arm_initialize.c arm_initialstate.c arm_interruptcontext.c

View File

@ -23,12 +23,6 @@
CMN_ASRCS += arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS += arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_doirq.c arm_hardfault.c arm_initialstate.c arm_memfault.c
CMN_CSRCS += arm_releasepending.c arm_reprioritizertr.c arm_schedulesigaction.c

View File

@ -25,12 +25,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_doirq.c arm_exit.c arm_hardfault.c arm_initialize.c
CMN_CSRCS += arm_initialstate.c arm_interruptcontext.c arm_mdelay.c

View File

@ -25,12 +25,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_allocateheap.c arm_assert.c arm_blocktask.c arm_copyfullstate.c
CMN_CSRCS += arm_createstack.c arm_exit.c arm_initialize.c arm_initialstate.c
CMN_CSRCS += arm_interruptcontext.c arm_mdelay.c arm_memfault.c arm_modifyreg8.c

View File

@ -26,12 +26,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_doirq.c arm_exit.c arm_hardfault.c arm_initialize.c
CMN_CSRCS += arm_initialstate.c arm_interruptcontext.c arm_mdelay.c

View File

@ -21,12 +21,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_exit.c arm_hardfault.c arm_initialize.c arm_initialstate.c
CMN_CSRCS += arm_interruptcontext.c arm_memfault.c arm_modifyreg8.c

View File

@ -26,12 +26,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_doirq.c arm_exit.c arm_hardfault.c arm_initialize.c
CMN_CSRCS += arm_initialstate.c arm_interruptcontext.c arm_mdelay.c

View File

@ -26,12 +26,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_doirq.c arm_exit.c arm_hardfault.c arm_initialize.c
CMN_CSRCS += arm_initialstate.c arm_interruptcontext.c arm_mdelay.c arm_memfault.c

View File

@ -26,12 +26,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_doirq.c arm_exit.c arm_hardfault.c arm_initialize.c
CMN_CSRCS += arm_initialstate.c arm_interruptcontext.c arm_mdelay.c arm_memfault.c

View File

@ -31,12 +31,6 @@ CMN_UCSRCS =
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_doirq.c arm_exit.c arm_hardfault.c arm_initialize.c
CMN_CSRCS += arm_initialstate.c arm_interruptcontext.c arm_mdelay.c arm_memfault.c

View File

@ -21,12 +21,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_doirq.c arm_exit.c arm_hardfault.c arm_initialize.c
CMN_CSRCS += arm_initialstate.c arm_interruptcontext.c arm_mdelay.c

View File

@ -21,12 +21,6 @@
CMN_ASRCS = arm_saveusercontext.S arm_fullcontextrestore.S arm_switchcontext.S
CMN_ASRCS += arm_testset.S arm_fetchadd.S vfork.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
CMN_ASRCS += arm_setjmp.S
endif
endif
CMN_CSRCS = arm_assert.c arm_blocktask.c arm_copyfullstate.c arm_createstack.c
CMN_CSRCS += arm_doirq.c arm_exit.c arm_initialize.c arm_initialstate.c
CMN_CSRCS += arm_hardfault.c arm_interruptcontext.c arm_memfault.c arm_mdelay.c

View File

@ -25,10 +25,6 @@ HEAD_ASRC = esp32c3_head.S
CHIP_ASRCS = esp32c3_vectors.S esp32c3_interrupt.S riscv_syscall.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
CMN_ASRCS += riscv_setjmp.S
endif
# Specify C code within the common directory to be included
CMN_CSRCS += riscv_initialize.c riscv_swint.c

View File

@ -25,10 +25,6 @@ HEAD_ASRC = fe310_vectors.S
# Specify our general Assembly files
CHIP_ASRCS = fe310_head.S riscv_syscall.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
CMN_ASRCS += riscv_setjmp.S
endif
# Specify C code within the common directory to be included
CMN_CSRCS += riscv_initialize.c riscv_swint.c
CMN_CSRCS += riscv_allocateheap.c riscv_createstack.c riscv_exit.c

View File

@ -27,10 +27,6 @@ CHIP_ASRCS = k210_head.S
CMN_ASRCS += riscv_testset.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
CMN_ASRCS += riscv_setjmp.S
endif
# Specify C code within the common directory to be included
CMN_CSRCS += riscv_initialize.c riscv_swint.c
CMN_CSRCS += riscv_allocateheap.c riscv_createstack.c riscv_exit.c riscv_fault.c

View File

@ -25,10 +25,6 @@ HEAD_ASRC = litex_vectors.S
# Specify our general Assembly files
CHIP_ASRCS = litex_head.S riscv_syscall.S
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
CMN_ASRCS += riscv_setjmp.S
endif
# Specify C code within the common directory to be included
CMN_CSRCS += riscv_initialize.c riscv_swint.c
CMN_CSRCS += riscv_allocateheap.c riscv_createstack.c riscv_exit.c

View File

@ -20,8 +20,6 @@
ifeq ($(CONFIG_ARMV7M_MEMCPY),y)
ASRCS += arch_memcpy.S
DEPPATH += --dep-path machine/arm/armv7-m/gnu
VPATH += :machine/arm/armv7-m/gnu
endif
ifeq ($(CONFIG_LIBC_ARCH_ELF),y)
@ -38,5 +36,14 @@ CSRCS += arch_sqrtf.c
endif
endif
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ASRCS += arch_setjmp.S
endif
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
DEPPATH += --dep-path machine/arm/armv7-m/gnu
VPATH += :machine/arm/armv7-m/gnu
endif
DEPPATH += --dep-path machine/arm/armv7-m
VPATH += :machine/arm/armv7-m

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/arm/src/armv7-m/gnu/arm_setjmp.S
* libs/libc/machine/arm/armv7-m/gnu/arm_setjmp.S
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with

View File

@ -74,5 +74,14 @@ endif
endif # CONFIG_ARMV8M_LIBM
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ASRCS += arch_setjmp.S
endif
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
DEPPATH += --dep-path machine/arm/armv8-m/gnu
VPATH += :machine/arm/armv8-m/gnu
endif
DEPPATH += --dep-path machine/arm/armv8-m
VPATH += :machine/arm/armv8-m

View File

@ -1,5 +1,5 @@
/****************************************************************************
* arch/arm/src/armv8-m/arm_setjmp.S
* libs/libc/machine/arm/armv8-m/gnu/arm_setjmp.S
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with

View File

@ -18,11 +18,7 @@
#
############################################################################
ifeq ($(CONFIG_LIBC_ARCH_ELF),y)
CSRCS += arch_elf.c
DEPPATH += --dep-path machine/risc-v/common
VPATH += :machine/risc-v/common
endif
include $(TOPDIR)/libs/libc/machine/risc-v/common/Make.defs
ifeq ($(CONFIG_ARCH_RV64GC),y)
include $(TOPDIR)/libs/libc/machine/risc-v/rv64/Make.defs

View File

@ -0,0 +1,30 @@
############################################################################
# libs/libc/machine/risc-v/common/Make.defs
#
# 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.
#
############################################################################
ifeq ($(CONFIG_LIBC_ARCH_ELF),y)
CSRCS += arch_elf.c
endif
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ASRCS += arch_setjmp.S
endif
DEPPATH += --dep-path machine/risc-v/common
VPATH += :machine/risc-v/common

View File

@ -1,5 +1,5 @@
############################################################################
# arch/risc-v/src/common/riscv_setjmp.S
# libs/libc/machine/risc-v/common/arch_setjmp.S
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with