2 * Copyright 2012, Alex Smith, alex@alex-smith.me.uk.
3 * Distributed under the terms of the MIT License.
6 #include "setjmp_internal.h"
9 /* int __siglongjmp(jmp_buf buffer, int value) */
13 // Restore new callee-save registers.
14 movq JMP_REGS_R15(%rdi), %r15
15 movq JMP_REGS_R14(%rdi), %r14
16 movq JMP_REGS_R13(%rdi), %r13
17 movq JMP_REGS_R12(%rdi), %r12
18 movq JMP_REGS_BX(%rdi), %rbx
19 movq JMP_REGS_BP(%rdi), %rbp
21 // Restore new stack pointer and push return address.
22 movq JMP_REGS_SP(%rdi), %rsp
23 movq JMP_REGS_IP(%rdi), %rax
26 // __longjmp_return restores the signal mask and sets the return value.
27 call __longjmp_return@PLT
29 FUNCTION_END(siglongjmp)
32 #pragma weak longjmp=siglongjmp