summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arm/setjmp.S
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-03-26 13:40:36 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-03-26 13:40:36 +0000
commitefce79f09ae6daa77cd322df0d532beec3f445f5 (patch)
treeae936850c5671b8bea0abf0d33bf2196f7abc796 /libc/sysdeps/linux/arm/setjmp.S
parent17e961d9c708ab202760ce830f8efe73e91bb129 (diff)
Paul Brook writes:
The attached patch adds support for compiling arm uClibc as pure Thumb code. This is needed because some recent ARM codes do not implement traditional ARM mode. Specifically: * Cortex-M1 - An extremely minimal FPGA based core that only implements Thumb-1 (aka ARMv6-M). * Cortex-M3 - A Thumb-2 only ARMv7-M core. Most of uClibc already builds in Thumb mode, all that is left are a handful of assembly bits. Tested on arm-uclinuxeabi.
Diffstat (limited to 'libc/sysdeps/linux/arm/setjmp.S')
-rw-r--r--libc/sysdeps/linux/arm/setjmp.S27
1 files changed, 27 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/arm/setjmp.S b/libc/sysdeps/linux/arm/setjmp.S
index 8d15b8324..2df7d551a 100644
--- a/libc/sysdeps/linux/arm/setjmp.S
+++ b/libc/sysdeps/linux/arm/setjmp.S
@@ -18,15 +18,41 @@
02111-1307 USA. */
#include <features.h>
+#include <bits/arm_asm.h>
.global __sigsetjmp
.type __sigsetjmp,%function
.align 2
+#if defined(THUMB1_ONLY)
+.thumb_func
__sigsetjmp:
+ push {r3, r4, r5, r6, r7, lr}
mov ip, r0
+ stmia r0!, {r4, r5, r6, r7}
+ mov r2, r8
+ mov r3, r9
+ mov r4, sl
+ mov r5, fp
+ add r6, sp, #(6 * 4)
+ mov r7, lr
+ stmia r0!, {r2, r3, r4, r5, r6, r7}
+ mov r0, ip
+ bl __sigjmp_save
+ pop {r3, r4, r5, r6, r7, pc}
+
+#else
+__sigsetjmp:
+ /* Save registers */
+ mov ip, r0
+#if defined(__thumb2__)
+ stmia ip!, {v1-v6, sl, fp}
+ movs r2, sp
+ stmia ip!, {r2, lr}
+#else
/* Save registers */
stmia ip!, {v1-v6, sl, fp, sp, lr}
+#endif
#if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
# ifdef __VFP_FP__
/* Store the VFP registers. */
@@ -70,5 +96,6 @@ __sigsetjmp:
#else
B __sigjmp_save
#endif
+#endif
.size __sigsetjmp,.-__sigsetjmp