# Translate to the kernel calling convention and swap the 'tls' and 'child_tid' arguments.
# They're flipped for x86-64 compared to all our other architectures and __bionic_clone.
movq %r8, %r10
movq %rcx, %r8
# Make the system call.
movl $__NR_clone, %eax
syscall
# Are we the child?
testq %rax, %rax
jz L(bc_child)
# We're either the parent or the syscall failed.
DO_SYSCALL_RETURN
L(bc_child):
# We don't want anyone to unwind past this point.
.cfi_undefined %rip
.cfi_undefined %rbp
xorl %ebp, %ebp
# We're in the child now, so call __start_thread
# with the arguments from the child stack moved into
# the appropriate registers.
popq %rdi # fn
popq %rsi # arg
call __start_thread
hlt
END(__bionic_clone)
// pid_t __bionic_clone3(struct clone_args* cl_args, size_t size, int (*fn)(void*), void* arg);
ENTRY_PRIVATE(__bionic_clone3)
# Save the arg pointer to %r8, because %rcx is clobbered by the system
# call.
movq %rcx, %r8
# Make the system call.
movl $__NR_clone3, %eax
syscall
# Check result.
testq %rax, %rax
jz L(bc3_child)
# We're either the parent or the syscall failed.
DO_SYSCALL_RETURN
L(bc3_child):
# We don't want anyone to unwind past this point.
.cfi_undefined %rip
.cfi_undefined %rbp
xorl %ebp, %ebp
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.