2 Copyright © 2008-2011, The AROS Development Team. All rights reserved.
5 Desc: POSIX function vfork()
9 #include "aros/x86_64/asm.h"
13 .globl AROS_CDEFNAME(vfork)
14 _FUNCTION
(AROS_CDEFNAME
(vfork
))
19 lea
(-bufsize
)(%rsp
), %rsp
/* _JMPLEN + 1 longs on the stack
20 it's our temporary jmp_buf */
22 call setjmp
/* fill jmp_buf on the stack with
23 current register values */
24 mov bufsize
(%rsp
), %rax
/* set return address in jmp_buf */
25 mov
%rax
, 0(%rdi
) /* to this function call return
27 lea bufsize
(%rsp
), %rax
/* set stack value in jmp_buf */
28 mov
%rax
, 120(%rdi
) /* this function call */
29 call __vfork
/* __vfork call won't return */