summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/mips
diff options
context:
space:
mode:
authormirabilos <tg@mirbsd.org>2015-07-25 00:37:44 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2015-08-02 10:44:13 +0200
commitcdfebe7629971fc671a10c9b419f33f9ff928cbd (patch)
tree8b6458a78c69df3f1c1238364f152c22cfebd762 /libc/sysdeps/linux/mips
parentfb1802d9b238ecb7066ab0867d8c4c3c3acefaea (diff)
fix MIPS N32 ABI Big Endian setjmp/longjmp
access to the jmp_buf structure occasionally happens asymmetrically: fields defined in pointer size width (64 on N32) can be accessed as 32-bit words, but in that case, a̲l̲l̲ involved code must agree on that…
Diffstat (limited to 'libc/sysdeps/linux/mips')
-rw-r--r--libc/sysdeps/linux/mips/__longjmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libc/sysdeps/linux/mips/__longjmp.c b/libc/sysdeps/linux/mips/__longjmp.c
index 5b5997113..aa94f76fa 100644
--- a/libc/sysdeps/linux/mips/__longjmp.c
+++ b/libc/sysdeps/linux/mips/__longjmp.c
@@ -101,13 +101,13 @@ void __longjmp (__jmp_buf env, int val_arg)
/* Restore the stack pointer and the FP. They have to be restored
last and in a single asm as gcc, depending on options used, may
use either of them to access env. */
-#if _MIPS_SIM == _MIPS_SIM_ABI64
+#if _MIPS_SIM != _MIPS_SIM_ABI32
__asm__ __volatile__ ("ld $29, %0\n\t"
"ld $30, %1\n\t" : : "m" (env[0].__sp), "m" (env[0].__fp));
-#else /* O32 || N32 */
+#else /* O32 */
__asm__ __volatile__ ("lw $29, %0\n\t"
"lw $30, %1\n\t" : : "m" (env[0].__sp), "m" (env[0].__fp));
-#endif /* O32 || N32 */
+#endif /* O32 */
/* Give setjmp 1 if given a 0, or what they gave us if non-zero. */
if (val == 0)