2019-07-03 17:27:19 +00:00
|
|
|
# NOTE: Keep this consistent with `fault.rs`.
|
2019-06-26 16:41:07 +00:00
|
|
|
|
2019-06-26 12:44:51 +00:00
|
|
|
.globl _run_on_alternative_stack
|
|
|
|
_run_on_alternative_stack:
|
2019-06-25 12:01:56 +00:00
|
|
|
# (stack_end, stack_begin)
|
|
|
|
# We need to ensure 16-byte alignment here.
|
|
|
|
pushq %r15
|
|
|
|
pushq %r14
|
|
|
|
pushq %r13
|
|
|
|
pushq %r12
|
|
|
|
pushq %rbx
|
|
|
|
pushq %rbp
|
|
|
|
movq %rsp, -16(%rdi)
|
|
|
|
|
2019-06-26 12:44:51 +00:00
|
|
|
leaq _run_on_alternative_stack.returning(%rip), %rax
|
2019-06-25 12:01:56 +00:00
|
|
|
movq %rax, -24(%rdi)
|
|
|
|
|
|
|
|
movq %rsi, %rsp
|
2019-06-27 07:49:43 +00:00
|
|
|
|
|
|
|
movq (%rsp), %xmm0
|
|
|
|
add $8, %rsp
|
|
|
|
|
|
|
|
movq (%rsp), %xmm1
|
|
|
|
add $8, %rsp
|
|
|
|
|
|
|
|
movq (%rsp), %xmm2
|
|
|
|
add $8, %rsp
|
|
|
|
|
|
|
|
movq (%rsp), %xmm3
|
|
|
|
add $8, %rsp
|
|
|
|
|
|
|
|
movq (%rsp), %xmm4
|
|
|
|
add $8, %rsp
|
|
|
|
|
|
|
|
movq (%rsp), %xmm5
|
|
|
|
add $8, %rsp
|
|
|
|
|
|
|
|
movq (%rsp), %xmm6
|
|
|
|
add $8, %rsp
|
|
|
|
|
|
|
|
movq (%rsp), %xmm7
|
|
|
|
add $8, %rsp
|
|
|
|
|
2019-06-25 12:01:56 +00:00
|
|
|
popq %rbp
|
2019-06-27 07:49:43 +00:00
|
|
|
popq %rax
|
2019-06-25 12:01:56 +00:00
|
|
|
popq %rbx
|
2019-06-27 07:49:43 +00:00
|
|
|
popq %rcx
|
|
|
|
popq %rdx
|
|
|
|
popq %rdi
|
|
|
|
popq %rsi
|
|
|
|
popq %r8
|
|
|
|
popq %r9
|
|
|
|
popq %r10
|
|
|
|
popq %r11
|
2019-06-25 12:01:56 +00:00
|
|
|
popq %r12
|
|
|
|
popq %r13
|
|
|
|
popq %r14
|
|
|
|
popq %r15
|
|
|
|
retq
|
|
|
|
|
2019-06-26 12:44:51 +00:00
|
|
|
_run_on_alternative_stack.returning:
|
2019-06-25 12:01:56 +00:00
|
|
|
movq (%rsp), %rsp
|
|
|
|
popq %rbp
|
|
|
|
popq %rbx
|
|
|
|
popq %r12
|
|
|
|
popq %r13
|
|
|
|
popq %r14
|
|
|
|
popq %r15
|
|
|
|
retq
|