Blame src/setjmp/nt64/longjmp.s
|
|
716654 |
############################################################################
|
|
|
716654 |
## mmglue: midipix architecture- and target-specific bits for musl libc ##
|
|
|
716654 |
## Copyright (C) 2013--2023 SysDeer Technologies, LLC ##
|
|
|
716654 |
## Released under the Standard MIT License; see COPYING.MMGLUE. ##
|
|
|
716654 |
############################################################################
|
|
|
716654 |
|
|
|
860627 |
.text
|
|
|
860627 |
.globl __longjmp
|
|
|
860627 |
.globl _longjmp
|
|
|
860627 |
.globl longjmp
|
|
|
860627 |
|
|
|
ed42e6 |
.def __longjmp; .scl 2; .type 32; .endef
|
|
|
ed42e6 |
.def _longjmp; .scl 2; .type 32; .endef
|
|
|
ed42e6 |
.def longjmp; .scl 2; .type 32; .endef
|
|
|
ed42e6 |
|
|
|
860627 |
__longjmp:
|
|
|
860627 |
_longjmp:
|
|
|
860627 |
longjmp:
|
|
|
860627 |
test %edx, %edx # is val zero?
|
|
|
860627 |
jne 1f # no: return val
|
|
|
860627 |
xor $1, %edx # yes: return one
|
|
|
860627 |
|
|
|
860627 |
1:
|
|
|
860627 |
mov %edx, %eax # return value
|
|
|
860627 |
|
|
|
860627 |
2:
|
|
|
860627 |
mov 0x10(%rcx), %rbx # restore regs
|
|
|
860627 |
mov 0x18(%rcx), %rbp
|
|
|
860627 |
mov 0x20(%rcx), %rdi
|
|
|
860627 |
mov 0x28(%rcx), %rsi
|
|
|
860627 |
mov 0x30(%rcx), %r12
|
|
|
860627 |
mov 0x38(%rcx), %r13
|
|
|
860627 |
mov 0x40(%rcx), %r14
|
|
|
860627 |
mov 0x48(%rcx), %r15
|
|
|
860627 |
|
|
|
860627 |
mov 0x08(%rcx), %rsp # saved stack pointer
|
|
|
860627 |
mov (%rcx), %rdx # return address
|
|
|
860627 |
jmp *%rdx # return
|
|
|
c00c94 |
|
|
|
c00c94 |
.section .got$longjmp
|
|
|
c00c94 |
.global __imp_longjmp
|
|
|
c00c94 |
__imp_longjmp:
|
|
|
c00c94 |
.quad longjmp
|
|
|
c00c94 |
.linkonce discard
|