From cdfebe7629971fc671a10c9b419f33f9ff928cbd Mon Sep 17 00:00:00 2001 From: mirabilos Date: Sat, 25 Jul 2015 00:37:44 +0200 Subject: fix MIPS N32 ABI Big Endian setjmp/longjmp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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… --- libc/sysdeps/linux/mips/__longjmp.c | 6 +++--- 1 file 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) -- cgit v1.2.3