.section .text .extern arch_terminate_thread .global arch_begin_thread arch_begin_thread: movq %rdi, %rax movq %rsi, %rdi pushq %rdx pushq %rbp movq %rsp, %rbp andq $-16, %rsp callq *%rax movq %rax, %rdi movq 8(%rbp), %rsi callq arch_terminate_thread .global arch_swap_thread_stack arch_swap_thread_stack: pushq %rsp pushq %rbp pushq %rax pushq %rbx pushq %rcx pushq %rdx pushq %rdi pushq %rsi pushq %r8 pushq %r9 pushq %r10 pushq %r11 pushq %r12 pushq %r13 pushq %r14 pushq %r15 movq %rsp, (%rdi) .Lenter_thread: movq %rsi, %rsp popq %r15 popq %r14 popq %r13 popq %r12 popq %r11 popq %r10 popq %r9 popq %r8 popq %rsi popq %rdi popq %rdx popq %rcx popq %rbx popq %rax popq %rbp popq %rsp retq