summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorKhem Raj <kraj@mvista.com>2006-08-31 19:49:16 +0000
committerKhem Raj <kraj@mvista.com>2006-08-31 19:49:16 +0000
commit84211be0889a59d7188645aefb5325ddfd642627 (patch)
tree0519bfa28d66c66774d5e70a05daae32f7bbe473 /libc
parent967639a59cfbcdecc1a93d6e28a77fdd88e893cf (diff)
Fix from Joseph Myers: Save and restore iWMMXt registers in ARM setjmp/longjmp
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/arm/__longjmp.S10
-rw-r--r--libc/sysdeps/linux/arm/bits/setjmp.h2
-rw-r--r--libc/sysdeps/linux/arm/setjmp.S10
3 files changed, 21 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/arm/__longjmp.S b/libc/sysdeps/linux/arm/__longjmp.S
index 27f127122..4261797f8 100644
--- a/libc/sysdeps/linux/arm/__longjmp.S
+++ b/libc/sysdeps/linux/arm/__longjmp.S
@@ -60,6 +60,16 @@ __longjmp:
lfmfd f4, 4, [ip] ! /* load the floating point regs */
# endif
#endif
+#ifdef __IWMMXT__
+ /* Restore the call-preserved iWMMXt registers. */
+ /* Following instructions are wldrd wr10, [ip], #8 (etc.) */
+ ldcl p1, cr10, [r12], #8
+ ldcl p1, cr11, [r12], #8
+ ldcl p1, cr12, [r12], #8
+ ldcl p1, cr13, [r12], #8
+ ldcl p1, cr14, [r12], #8
+ ldcl p1, cr15, [r12], #8
+#endif
#if defined(__USE_BX__)
bx lr
diff --git a/libc/sysdeps/linux/arm/bits/setjmp.h b/libc/sysdeps/linux/arm/bits/setjmp.h
index 745cdb8f7..ac52f1281 100644
--- a/libc/sysdeps/linux/arm/bits/setjmp.h
+++ b/libc/sysdeps/linux/arm/bits/setjmp.h
@@ -35,7 +35,7 @@
are occupied by v1-v6, sl, fp, sp, pc, d8-d15, and fpscr. (Note
that d8-15 require 17 words, due to the use of fstmx.) */
typedef int __jmp_buf[64] __attribute__((aligned (8)));
-#elif defined __MAVERICK__
+#elif defined __MAVERICK__ || defined __IWMMXT__
typedef int __jmp_buf[34];
#else
typedef int __jmp_buf[22];
diff --git a/libc/sysdeps/linux/arm/setjmp.S b/libc/sysdeps/linux/arm/setjmp.S
index ceea96a40..8d15b8324 100644
--- a/libc/sysdeps/linux/arm/setjmp.S
+++ b/libc/sysdeps/linux/arm/setjmp.S
@@ -53,6 +53,16 @@ __sigsetjmp:
sfmea f4, 4, [ip]!
# endif
#endif
+#ifdef __IWMMXT__
+ /* Save the call-preserved iWMMXt registers. */
+ /* Following instructions are wstrd wr10, [ip], #8 (etc.) */
+ stcl p1, cr10, [r12], #8
+ stcl p1, cr11, [r12], #8
+ stcl p1, cr12, [r12], #8
+ stcl p1, cr13, [r12], #8
+ stcl p1, cr14, [r12], #8
+ stcl p1, cr15, [r12], #8
+#endif
/* Make a tail call to __sigjmp_save; it takes the same args. */
#ifdef __PIC__