Test for stack alignment.
[glibc.git] / sysdeps / mips / mips64 / setjmp.S
blobbdfd9cd51c8b50e9d8668e6b4b52667c072182c7
1 /* Copyright (C) 1996, 1997, 2000, 2002, 2003, 2004
2         Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
5    The GNU C Library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
10    The GNU C Library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, write to the Free
17    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18    02111-1307 USA.  */
20 #include <sgidefs.h>
21 #include <sysdep.h>
22 #include <sys/asm.h>
24 /* The function __sigsetjmp_aux saves all the registers, but it can't
25    reliably access the stack or frame pointers, so we pass them in as
26    extra arguments.  */
27 #ifdef __PIC__
28         .option pic2
29 #endif
30 ENTRY (__sigsetjmp)
31 #ifdef __PIC__
32         SETUP_GP
33 #endif
34         SETUP_GP64 (v0, C_SYMBOL_NAME (__sigsetjmp))
35         move a2, sp
36         move a3, fp
37         PTR_LA t9, __sigsetjmp_aux
38 #if _MIPS_SIM == _ABIO32
39         nop
40 #endif  
41         RESTORE_GP64
42 #if _MIPS_SIM != _ABIO32
43         move a4, gp
44 #endif
45         jr t9
46         .end __sigsetjmp