diff options
Diffstat (limited to 'ports/sysdeps/mips')
-rw-r--r-- | ports/sysdeps/mips/include/sys/asm.h | 53 | ||||
-rw-r--r-- | ports/sysdeps/mips/mips64/bsd-_setjmp.S | 4 | ||||
-rw-r--r-- | ports/sysdeps/mips/mips64/bsd-setjmp.S | 4 | ||||
-rw-r--r-- | ports/sysdeps/mips/mips64/setjmp.S | 4 | ||||
-rw-r--r-- | ports/sysdeps/mips/sys/asm.h | 13 |
5 files changed, 69 insertions, 9 deletions
diff --git a/ports/sysdeps/mips/include/sys/asm.h b/ports/sysdeps/mips/include/sys/asm.h new file mode 100644 index 0000000000..7b356e12e0 --- /dev/null +++ b/ports/sysdeps/mips/include/sys/asm.h @@ -0,0 +1,53 @@ +/* Copyright (C) 2013 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_ASM_H + +# include_next <sys/asm.h> + +# undef __mips_cfi_startproc +# define __mips_cfi_startproc cfi_startproc +# undef __mips_cfi_endproc +# define __mips_cfi_endproc cfi_endproc + +# if _MIPS_SIM == _ABIO32 +# define SETUP_GP64_REG_CFI(a) +# define SETUP_GP64_REG(a, b) +# define SETUP_GP64_STACK_CFI(a) +# define SETUP_GP64_STACK(a, b) +# define RESTORE_GP64_REG +# define RESTORE_GP64_STACK +# else +# define SETUP_GP64_REG_CFI(gpsavereg) \ + cfi_register (gp, gpsavereg) +# define SETUP_GP64_REG(gpsavereg, proc) \ + SETUP_GP64 (gpsavereg, proc); \ + SETUP_GP64_REG_CFI (gpsavereg) +# define SETUP_GP64_STACK_CFI(gpoffset) \ + cfi_rel_offset (gp, gpoffset) +# define SETUP_GP64_STACK(gpoffset, proc) \ + SETUP_GP64 (gpoffset, proc); \ + SETUP_GP64_STACK_CFI (gpoffset) +# define RESTORE_GP64_REG \ + RESTORE_GP64; \ + cfi_restore (gp) +# define RESTORE_GP64_STACK \ + RESTORE_GP64; \ + cfi_restore (gp) +# endif + +#endif diff --git a/ports/sysdeps/mips/mips64/bsd-_setjmp.S b/ports/sysdeps/mips/mips64/bsd-_setjmp.S index 83b1264925..5d0f76c13c 100644 --- a/ports/sysdeps/mips/mips64/bsd-_setjmp.S +++ b/ports/sysdeps/mips/mips64/bsd-_setjmp.S @@ -31,12 +31,12 @@ ENTRY (_setjmp) #ifdef __PIC__ SETUP_GP #endif - SETUP_GP64 (v0, C_SYMBOL_NAME (_setjmp)) + SETUP_GP64_REG (v0, C_SYMBOL_NAME (_setjmp)) PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp) #if _MIPS_SIM == _ABIO32 nop #endif - RESTORE_GP64 + RESTORE_GP64_REG move a1, zero /* Pass a second argument of zero. */ #ifdef __PIC__ jr t9 diff --git a/ports/sysdeps/mips/mips64/bsd-setjmp.S b/ports/sysdeps/mips/mips64/bsd-setjmp.S index 15af26a82d..784e16e33f 100644 --- a/ports/sysdeps/mips/mips64/bsd-setjmp.S +++ b/ports/sysdeps/mips/mips64/bsd-setjmp.S @@ -31,12 +31,12 @@ ENTRY (setjmp) #ifdef __PIC__ SETUP_GP #endif - SETUP_GP64 (v0, C_SYMBOL_NAME (setjmp)) + SETUP_GP64_REG (v0, C_SYMBOL_NAME (setjmp)) PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp) #if _MIPS_SIM == _ABIO32 nop #endif - RESTORE_GP64 + RESTORE_GP64_REG dli a1, 1 /* Pass a second argument of one. */ #ifdef __PIC__ jr t9 diff --git a/ports/sysdeps/mips/mips64/setjmp.S b/ports/sysdeps/mips/mips64/setjmp.S index 621e390fd0..5afbbe7562 100644 --- a/ports/sysdeps/mips/mips64/setjmp.S +++ b/ports/sysdeps/mips/mips64/setjmp.S @@ -29,14 +29,14 @@ ENTRY (__sigsetjmp) #ifdef __PIC__ SETUP_GP #endif - SETUP_GP64 (v0, C_SYMBOL_NAME (__sigsetjmp)) + SETUP_GP64_REG (v0, C_SYMBOL_NAME (__sigsetjmp)) move a2, sp move a3, fp PTR_LA t9, __sigsetjmp_aux #if _MIPS_SIM == _ABIO32 nop #endif - RESTORE_GP64 + RESTORE_GP64_REG #if _MIPS_SIM != _ABIO32 move a4, gp #endif diff --git a/ports/sysdeps/mips/sys/asm.h b/ports/sysdeps/mips/sys/asm.h index 605451a884..293cf364e0 100644 --- a/ports/sysdeps/mips/sys/asm.h +++ b/ports/sysdeps/mips/sys/asm.h @@ -26,6 +26,10 @@ # define CAT(str1,str2) __CAT(str1,str2) #endif +/* Redefined as nonempty in the internal header. */ +#define __mips_cfi_startproc /* Empty. */ +#define __mips_cfi_endproc /* Empty. */ + /* * Macros to handle different pointer/register sizes for 32/64-bit code * @@ -147,7 +151,8 @@ l: \ .align 2; \ .type symbol,@function; \ .ent symbol,0; \ -symbol: .frame sp,0,ra +symbol: .frame sp,0,ra; \ + __mips_cfi_startproc /* * NESTED - declare nested routine entry point @@ -157,13 +162,15 @@ symbol: .frame sp,0,ra .align 2; \ .type symbol,@function; \ .ent symbol,0; \ -symbol: .frame sp, framesize, rpc +symbol: .frame sp, framesize, rpc; \ + __mips_cfi_startproc /* * END - mark end of function */ #ifndef END # define END(function) \ + __mips_cfi_endproc; \ .end function; \ .size function,.-function #endif @@ -173,7 +180,7 @@ symbol: .frame sp, framesize, rpc */ #define EXPORT(symbol) \ .globl symbol; \ -symbol: +symbol: __mips_cfi_startproc /* * ABS - export absolute symbol |