revert lto configure changes - it is now unused unless explicitly asked for.
[AROS.git] / arch / x86_64-all / posixc / vfork.s
blobace6886d296a3f93aa9847f23be1a24c38b209eb
1 /*
2 Copyright © 2008-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: POSIX function vfork()
6 Lang: english
7 */
9 #include "aros/x86_64/asm.h"
11 .text
12 _ALIGNMENT
13 .globl AROS_CDEFNAME(vfork)
14 _FUNCTION(AROS_CDEFNAME(vfork))
15 .set bufsize, 16*8
16 .set stack, 15*8
18 AROS_CDEFNAME(vfork):
19 lea (-bufsize)(%rsp), %rsp /* _JMPLEN + 1 longs on the stack
20 it's our temporary jmp_buf */
21 mov %rsp, %rdi
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
26 address */
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 */