From: Tomasz Wozniak Date: Tue, 19 Sep 2017 13:21:48 +0000 (+0200) Subject: Fix setjmp/longjmp implementation for thumb mode (i.e.: tiva, which is Cortex M3... X-Git-Tag: 1.1_Public_Release~171^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6959f4f4f4b2d71d09ecee9f3c1c1846d29bd05a;p=rtos%2Ftinyara.git Fix setjmp/longjmp implementation for thumb mode (i.e.: tiva, which is Cortex M3, based on armv7-m architecture). Compiles for armv7-a/r in both arm and thumb modes and for armv7-m. --- diff --git a/os/arch/arm/src/common/setjmp.S b/os/arch/arm/src/common/setjmp.S index bdac7d2..3acd669 100644 --- a/os/arch/arm/src/common/setjmp.S +++ b/os/arch/arm/src/common/setjmp.S @@ -151,12 +151,19 @@ longjmp: ldr r14, [r0, #((_JB_REG_R14 - _JB_REG_R4) * 4)] #endif +#ifndef __thumb__ /* Validate sp and r14 */ teq sp, #0 it ne teqne r14, #0 it eq beq botch +#else + cmp sp, #0 + beq botch + cmp lr, #0 + beq botch +#endif /* Set return value */ movs r0, r1