Blame src/process/nt64/tt_fork_v1.s
|
|
dd89bb |
##########################################################
|
|
|
dd89bb |
## ntapi: Native API core library ##
|
|
|
dd89bb |
## Copyright (C) 2013,2014,2015 Z. Gilboa ##
|
|
|
dd89bb |
## Released under GPLv2 and GPLv3; see COPYING.NTAPI. ##
|
|
|
dd89bb |
##########################################################
|
|
|
dd89bb |
|
|
|
dd89bb |
.section .text
|
|
|
dd89bb |
|
|
|
dd89bb |
.global __tt_fork_v1
|
|
|
dd89bb |
.global __tt_fork_child_entry_point
|
|
|
dd89bb |
.global __tt_fork_child_entry_point_adj
|
|
|
dd89bb |
|
|
|
dd89bb |
__tt_fork_v1:
|
|
|
dd89bb |
__tt_fork_save_regs:
|
|
|
dd89bb |
push %rbp
|
|
|
dd89bb |
push %rcx
|
|
|
dd89bb |
push %rdx
|
|
|
dd89bb |
push %rbx
|
|
|
dd89bb |
push %rsi
|
|
|
dd89bb |
push %rdi
|
|
|
dd89bb |
push %r8
|
|
|
dd89bb |
push %r9
|
|
|
dd89bb |
push %r10
|
|
|
dd89bb |
push %r11
|
|
|
dd89bb |
push %r12
|
|
|
dd89bb |
push %r13
|
|
|
dd89bb |
push %r14
|
|
|
dd89bb |
push %r15
|
|
|
dd89bb |
|
|
|
dd89bb |
sub 0x40,%rsp
|
|
|
dd89bb |
|
|
|
dd89bb |
mov %rsp, %rdx
|
|
|
dd89bb |
and $0xf, %rdx
|
|
|
dd89bb |
test %rdx, %rdx
|
|
|
dd89bb |
jne __tt_fork_impl_adj_call
|
|
|
dd89bb |
|
|
|
dd89bb |
__tt_fork_impl_call:
|
|
|
dd89bb |
mov %rsp, %rcx
|
|
|
dd89bb |
call __tt_fork_impl_v1
|
|
|
dd89bb |
|
|
|
dd89bb |
add 0x40,%rsp
|
|
|
dd89bb |
|
|
|
dd89bb |
pop %r15
|
|
|
dd89bb |
pop %r14
|
|
|
dd89bb |
pop %r13
|
|
|
dd89bb |
pop %r12
|
|
|
dd89bb |
pop %r11
|
|
|
dd89bb |
pop %r10
|
|
|
dd89bb |
pop %r9
|
|
|
dd89bb |
pop %r8
|
|
|
dd89bb |
pop %rdi
|
|
|
dd89bb |
pop %rsi
|
|
|
dd89bb |
pop %rbx
|
|
|
dd89bb |
pop %rdx
|
|
|
dd89bb |
pop %rcx
|
|
|
dd89bb |
pop %rbp
|
|
|
dd89bb |
|
|
|
dd89bb |
ret
|
|
|
dd89bb |
|
|
|
dd89bb |
__tt_fork_impl_adj_call:
|
|
|
dd89bb |
push %rdi
|
|
|
dd89bb |
|
|
|
dd89bb |
mov %rsp, %rcx
|
|
|
dd89bb |
call __tt_fork_impl_v1
|
|
|
dd89bb |
|
|
|
dd89bb |
pop %rdi
|
|
|
dd89bb |
|
|
|
dd89bb |
add 0x40,%rsp
|
|
|
dd89bb |
|
|
|
dd89bb |
pop %r15
|
|
|
dd89bb |
pop %r14
|
|
|
dd89bb |
pop %r13
|
|
|
dd89bb |
pop %r12
|
|
|
dd89bb |
pop %r11
|
|
|
dd89bb |
pop %r10
|
|
|
dd89bb |
pop %r9
|
|
|
dd89bb |
pop %r8
|
|
|
dd89bb |
pop %rdi
|
|
|
dd89bb |
pop %rsi
|
|
|
dd89bb |
pop %rbx
|
|
|
dd89bb |
pop %rdx
|
|
|
dd89bb |
pop %rcx
|
|
|
dd89bb |
pop %rbp
|
|
|
dd89bb |
|
|
|
dd89bb |
ret
|
|
|
dd89bb |
|
|
|
dd89bb |
|
|
|
dd89bb |
__tt_fork_child_entry_point:
|
|
|
dd89bb |
xor %rax, %rax
|
|
|
dd89bb |
mov %rcx, %rsp
|
|
|
dd89bb |
|
|
|
dd89bb |
add 0x40,%rsp
|
|
|
dd89bb |
|
|
|
dd89bb |
pop %r15
|
|
|
dd89bb |
pop %r14
|
|
|
dd89bb |
pop %r13
|
|
|
dd89bb |
pop %r12
|
|
|
dd89bb |
pop %r11
|
|
|
dd89bb |
pop %r10
|
|
|
dd89bb |
pop %r9
|
|
|
dd89bb |
pop %r8
|
|
|
dd89bb |
pop %rdi
|
|
|
dd89bb |
pop %rsi
|
|
|
dd89bb |
pop %rbx
|
|
|
dd89bb |
pop %rdx
|
|
|
dd89bb |
pop %rcx
|
|
|
dd89bb |
pop %rbp
|
|
|
dd89bb |
|
|
|
dd89bb |
ret
|
|
|
dd89bb |
|
|
|
dd89bb |
__tt_fork_child_entry_point_adj:
|
|
|
dd89bb |
xor %rax, %rax
|
|
|
dd89bb |
mov %rcx, %rsp
|
|
|
dd89bb |
|
|
|
dd89bb |
pop %rdi
|
|
|
dd89bb |
|
|
|
dd89bb |
add 0x40,%rsp
|
|
|
dd89bb |
|
|
|
dd89bb |
pop %r15
|
|
|
dd89bb |
pop %r14
|
|
|
dd89bb |
pop %r13
|
|
|
dd89bb |
pop %r12
|
|
|
dd89bb |
pop %r11
|
|
|
dd89bb |
pop %r10
|
|
|
dd89bb |
pop %r9
|
|
|
dd89bb |
pop %r8
|
|
|
dd89bb |
pop %rdi
|
|
|
dd89bb |
pop %rsi
|
|
|
dd89bb |
pop %rbx
|
|
|
dd89bb |
pop %rdx
|
|
|
dd89bb |
pop %rcx
|
|
|
dd89bb |
pop %rbp
|
|
|
dd89bb |
|
|
|
dd89bb |
ret
|