mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-15 23:25:41 +00:00
36 lines
555 B
ArmAsm
36 lines
555 B
ArmAsm
# NOTE: Keep this consistent with `alternative_stack.rs`.
|
|
|
|
.globl _run_on_alternative_stack
|
|
_run_on_alternative_stack:
|
|
# (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)
|
|
|
|
leaq _run_on_alternative_stack.returning(%rip), %rax
|
|
movq %rax, -24(%rdi)
|
|
|
|
movq %rsi, %rsp
|
|
popq %rbp
|
|
popq %rbx
|
|
popq %r12
|
|
popq %r13
|
|
popq %r14
|
|
popq %r15
|
|
retq
|
|
|
|
_run_on_alternative_stack.returning:
|
|
movq (%rsp), %rsp
|
|
popq %rbp
|
|
popq %rbx
|
|
popq %r12
|
|
popq %r13
|
|
popq %r14
|
|
popq %r15
|
|
retq
|