arch/arm: Support setjmp/longjmp for all socs

After check the official specification of ARM ISA
and Thumb ISA, the arch_setjmp_thumb.S are written
by arm unified assembly language,
so it easy to make it works for ARM and thumb ISA.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2022-03-09 16:34:04 +08:00 committed by Petro Karashchenko
parent 8cead9ec25
commit 69cfe8d626
5 changed files with 3 additions and 19 deletions

View File

@ -15,6 +15,7 @@ config ARCH_ARM
select ARCH_HAVE_STACKCHECK
select ARCH_HAVE_CUSTOMOPT
select ARCH_HAVE_STDARG_H
select ARCH_HAVE_SETJMP if !ARCH_TOOLCHAIN_IAR
select ARCH_HAVE_SYSCALL_HOOKS
select ARCH_HAVE_RDWR_MEM_CPU_RUN
select ARCH_HAVE_THREAD_LOCAL

View File

@ -82,7 +82,6 @@ config ARCH_CHIP_IMX6
select ARCH_CORTEXA9
select ARM_THUMB
select ARMV7A_HAVE_L2CC_PL310
select ARCH_HAVE_SETJMP if ARCH_TOOLCHAIN_GNU
select ARCH_HAVE_FPU
select ARCH_HAVE_TRUSTZONE
select ARCH_HAVE_LOWVECTORS
@ -598,7 +597,6 @@ config ARCH_CORTEXM0
config ARCH_ARMV7M
bool
default n
select ARCH_HAVE_SETJMP if ARCH_TOOLCHAIN_GNU
config ARCH_CORTEXM3
bool
@ -731,7 +729,6 @@ config ARCH_CORTEXR7
config ARCH_ARMV8M
bool
default n
select ARCH_HAVE_SETJMP
config ARCH_CORTEXM23
bool

View File

@ -32,7 +32,6 @@
* Public Types
****************************************************************************/
#if defined(CONFIG_ARM_THUMB)
struct setjmp_buf_s
{
/* Note: core registers r0-r3 are caller-saved */
@ -76,10 +75,6 @@ struct setjmp_buf_s
typedef struct setjmp_buf_s jmp_buf[1];
#else
# error "setjmp() not compiled!"
#endif /* CONFIG_ARM_THUMB */
/****************************************************************************
* Public Function Prototypes
****************************************************************************/

View File

@ -52,9 +52,7 @@ CSRCS += gnu_unwind_find_exidx.c
endif
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
ifeq ($(CONFIG_ARM_THUMB),y)
ASRCS += arch_setjmp_thumb.S
endif
ASRCS += arch_setjmp.S
endif
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)

View File

@ -1,5 +1,5 @@
/****************************************************************************
* libs/libc/machine/arm/gnu/arm_setjmp_thumb.S
* libs/libc/machine/arm/gnu/arm_setjmp.S
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -24,10 +24,6 @@
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Symbols
****************************************************************************/
@ -36,7 +32,6 @@
.globl longjmp
.syntax unified
.thumb
.file "setjmp.S"
/****************************************************************************
@ -64,7 +59,6 @@
*
****************************************************************************/
.thumb_func
.type setjmp, function
setjmp:
@ -114,7 +108,6 @@ setjmp:
*
****************************************************************************/
.thumb_func
.type longjmp, function
longjmp: