1 /* Copyright 2011 Nicholas J. Kain, licensed GNU LGPL 2.1 or later */
4 .type _longjmp,%function
5 .type longjmp,%function
8 mov %rsi,%rax /* val will be longjmp return */
11 inc %rax /* if val==0, val=1 per longjmp semantics */
13 movq (%rdi),%rbx /* rdi is the jmp_buf, restore regs from it */
19 movq 48(%rdi),%rdx /* this ends up being the stack pointer */
21 movq 56(%rdi),%rdx /* this is the instruction pointer */
22 jmp *%rdx /* goto saved address without altering rsp */
23 .size _longjmp,.-_longjmp
24 .size longjmp,.-longjmp