This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 69cfe8d arch/arm: Support setjmp/longjmp for all socs
69cfe8d is described below
commit 69cfe8d626c35859bec346ba3750f601f08b268a
Author: Huang Qi <[email protected]>
AuthorDate: Wed Mar 9 16:34:04 2022 +0800
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 <[email protected]>
---
arch/Kconfig | 1 +
arch/arm/Kconfig | 3 ---
arch/arm/include/setjmp.h | 5 -----
libs/libc/machine/arm/Make.defs | 4 +---
libs/libc/machine/arm/gnu/{arch_setjmp_thumb.S => arch_setjmp.S} | 9 +--------
5 files changed, 3 insertions(+), 19 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index d597d38..1c8903a 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -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
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c5c1f7b..3e0ed6a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -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
diff --git a/arch/arm/include/setjmp.h b/arch/arm/include/setjmp.h
index 1bb746b..4da7be7 100644
--- a/arch/arm/include/setjmp.h
+++ b/arch/arm/include/setjmp.h
@@ -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
****************************************************************************/
diff --git a/libs/libc/machine/arm/Make.defs b/libs/libc/machine/arm/Make.defs
index d934504..a847f74 100644
--- a/libs/libc/machine/arm/Make.defs
+++ b/libs/libc/machine/arm/Make.defs
@@ -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)
diff --git a/libs/libc/machine/arm/gnu/arch_setjmp_thumb.S
b/libs/libc/machine/arm/gnu/arch_setjmp.S
similarity index 94%
rename from libs/libc/machine/arm/gnu/arch_setjmp_thumb.S
rename to libs/libc/machine/arm/gnu/arch_setjmp.S
index 4bf2986..e110dc2 100644
--- a/libs/libc/machine/arm/gnu/arch_setjmp_thumb.S
+++ b/libs/libc/machine/arm/gnu/arch_setjmp.S
@@ -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
@@ -25,10 +25,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: