summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2016-06-13 14:01:07 +0200
committerTom Rini <trini@konsulko.com>2016-06-17 09:51:06 -0400
commite677724884c175e978b463cf941ecb9310d3b900 (patch)
treee424c5aa2fbaa5cfe800c0f102fd196b265b7150 /arch
parent71423435fb02c2ed9e7aa14c1208d3cccbff2519 (diff)
downloadtalos-obmc-uboot-e677724884c175e978b463cf941ecb9310d3b900.tar.gz
talos-obmc-uboot-e677724884c175e978b463cf941ecb9310d3b900.zip
arm: Fix setjmp
The setjmp/longjmp implementation did not work on thumb1 implementations because it used instruction encodings that don't exist on thumb1 yet. This patch limits itself to thumb1 instruction set for 32bit arm and removes a superfluous printf along the way. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/setjmp.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/arm/include/asm/setjmp.h b/arch/arm/include/asm/setjmp.h
index b8b85b79dd..ae738b2457 100644
--- a/arch/arm/include/asm/setjmp.h
+++ b/arch/arm/include/asm/setjmp.h
@@ -43,13 +43,14 @@ static inline int setjmp(jmp_buf jmp)
#else
asm volatile(
#ifdef CONFIG_SYS_THUMB_BUILD
- "adr r0, jmp_target + 1\n"
+ "adr r0, jmp_target\n"
+ "add r0, r0, $1\n"
#else
"adr r0, jmp_target\n"
#endif
"mov r1, %1\n"
"mov r2, sp\n"
- "stm r1, {r0, r2, r4, r5, r6, r7}\n"
+ "stm r1!, {r0, r2, r4, r5, r6, r7}\n"
"b 2f\n"
"jmp_target: "
"mov %0, #1\n"
@@ -61,8 +62,6 @@ static inline int setjmp(jmp_buf jmp)
"cc", "memory");
#endif
-printf("%s:%d target=%#lx\n", __func__, __LINE__, jmp->target);
-
return r;
}
@@ -84,7 +83,7 @@ static inline __noreturn void longjmp(jmp_buf jmp)
#else
asm volatile(
"mov r1, %0\n"
- "ldm r1, {r0, r2, r4, r5, r6, r7}\n"
+ "ldm r1!, {r0, r2, r4, r5, r6, r7}\n"
"mov sp, r2\n"
"bx r0\n"
:
OpenPOWER on IntegriCloud