2 Copyright (C) 2001-2012 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, see
17 <http://www.gnu.org/licenses/>. */
20 #include <jmpbuf-offsets.h>
21 #include <asm-syntax.h>
22 #include <stap-probe.h>
26 movq %rbx, (JB_RBX*8)(%rdi)
29 /* Save the high bits of %rbp first, since PTR_MANGLE will
30 only handle the low bits but we cannot presume %rbp is
31 being used as a pointer and truncate it. Here we write all
32 of %rbp, but the low bits will be overwritten below. */
33 movq %rbp, (JB_RBP*8)(%rdi)
37 mov %RAX_LP, (JB_RBP*8)(%rdi)
39 movq %rbp, (JB_RBP*8)(%rdi)
41 movq %r12, (JB_R12*8)(%rdi)
42 movq %r13, (JB_R13*8)(%rdi)
43 movq %r14, (JB_R14*8)(%rdi)
44 movq %r15, (JB_R15*8)(%rdi)
45 lea 8(%rsp), %RDX_LP /* Save SP as it will be after we return. */
49 movq %rdx, (JB_RSP*8)(%rdi)
50 mov (%rsp), %RAX_LP /* Save PC we are returning to now. */
51 LIBC_PROBE (setjmp, 3, LP_SIZE@%RDI_LP, -4@%esi, LP_SIZE@%RAX_LP)
55 movq %rax, (JB_PC*8)(%rdi)
57 #if defined NOT_IN_libc && defined IS_IN_rtld
58 /* In ld.so we never save the signal mask. */
62 /* Make a tail call to __sigjmp_save; it takes the same args. */
64 jmp C_SYMBOL_NAME (BP_SYM (__sigjmp_save))@PLT
66 jmp BP_SYM (__sigjmp_save)
69 END (BP_SYM (__sigsetjmp))
70 hidden_def (__sigsetjmp)