2.9
[glibc/nacl-glibc.git] / sysdeps / s390 / s390-64 / setjmp.S
bloba962db46ce9319199a93ba5d2b30ab33e1ff54bf
1 /* Copyright (C) 2001, 2005 Free Software Foundation, Inc.
2    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
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 #ifndef _ASM
21 #define _ASM
22 #endif
24 #include <sysdep.h>
25 #include <bits/setjmp.h>
27 /* Save the current program position in ENV and return 0.  */
28 /* R2 = pointer to jmp_buf, R3 = savemask.  */
30 ENTRY(__sigsetjmp)
31 #ifdef PTR_MANGLE
32         stmg   %r6,%r13,0(%r2)      /* Store registers in jmp_buf.  */
33         lgr    %r4,%r14
34         lgr    %r5,%r15
35         PTR_MANGLE (%r4, %r1)
36         PTR_MANGLE2 (%r5, %r1)
37         stmg   %r4,%r5,64(%r2)
38 #else
39         stmg   %r6,%r15,0(%r2)      /* Store registers in jmp_buf.  */
40 #endif
41         std    %f1,80(%r2)
42         std    %f3,88(%r2)
43         std    %f5,96(%r2)
44         std    %f7,104(%r2)
45 #if defined NOT_IN_libc && defined IS_IN_rtld
46         /* In ld.so we never save the signal mask.  */
47         lghi   %r2,0
48         br     %r14
49 #elif defined PIC
50         jg     __sigjmp_save@PLT    /* Tail-call __sigjmp_save.  */
51 #else
52         jg     __sigjmp_save        /* Tail-call __sigjmp_save.  */
53 #endif
54 END (__sigsetjmp)