2 Copyright (C) 1995-2018 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>
27 movl 4(%esp), %eax /* User's jmp_buf in %eax. */
29 /* Save the return address now. */
30 movl (JB_PC*4)(%eax), %edx
31 /* Get the stack pointer. */
32 movl (JB_SP*4)(%eax), %ecx
35 LIBC_PROBE (longjmp, 3, 4@%eax, -4@8(%esp), 4@%edx)
37 cfi_register(%eip, %edx)
38 cfi_register(%esp, %ecx)
39 cfi_offset(%ebx, JB_BX*4)
40 cfi_offset(%esi, JB_SI*4)
41 cfi_offset(%edi, JB_DI*4)
42 cfi_offset(%ebp, JB_BP*4)
43 /* Restore registers. */
44 movl (JB_BX*4)(%eax), %ebx
45 movl (JB_SI*4)(%eax), %esi
46 movl (JB_DI*4)(%eax), %edi
47 movl (JB_BP*4)(%eax), %ebp
53 LIBC_PROBE (longjmp_target, 3, 4@%eax, -4@8(%esp), 4@%edx)
54 movl 8(%esp), %eax /* Second argument is return value. */
57 movl 4(%esp), %ecx /* User's jmp_buf in %ecx. */
58 movl 8(%esp), %eax /* Second argument is return value. */
59 /* Save the return address now. */
60 movl (JB_PC*4)(%ecx), %edx
61 LIBC_PROBE (longjmp, 3, 4@%ecx, -4@%eax, 4@%edx)
62 /* Restore registers. */
63 movl (JB_BX*4)(%ecx), %ebx
64 movl (JB_SI*4)(%ecx), %esi
65 movl (JB_DI*4)(%ecx), %edi
66 movl (JB_BP*4)(%ecx), %ebp
67 movl (JB_SP*4)(%ecx), %esp
68 LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%ecx, 4@%edx)
70 /* Jump to saved PC. */