OSDN Git Service

Replace FSF snail mail address with URLs
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / x86_64 / setjmp.S
1 /* setjmp for x86-64.
2    Copyright (C) 2001, 2003 Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4
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.
9
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.
14
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, see
17    <http://www.gnu.org/licenses/>.  */
18
19 #include <jmpbuf-offsets.h>
20
21 .global __sigsetjmp
22 .type   __sigsetjmp,%function
23 __sigsetjmp:
24         /* Save registers.  */
25         movq %rbx, (JB_RBX*8)(%rdi)
26         movq %rbp, (JB_RBP*8)(%rdi)
27         movq %r12, (JB_R12*8)(%rdi)
28         movq %r13, (JB_R13*8)(%rdi)
29         movq %r14, (JB_R14*8)(%rdi)
30         movq %r15, (JB_R15*8)(%rdi)
31         leaq 8(%rsp), %rdx      /* Save SP as it will be after we return.  */
32         movq %rdx, (JB_RSP*8)(%rdi)
33         movq (%rsp), %rax       /* Save PC we are returning to now.  */
34         movq %rax, (JB_PC*8)(%rdi)
35
36         /* Make a tail call to __sigjmp_save; it takes the same args.  */
37 #ifdef  __PIC__
38         jmp __sigjmp_save@PLT
39 #else
40         jmp __sigjmp_save
41 #endif
42 .size __sigsetjmp,.-__sigsetjmp
43 libc_hidden_def(__sigsetjmp)