make fat.handler build again with debug enabled
[tangerine.git] / arch / x86_64-all / clib / vfork.s
blob4b2ccccb62a783ec9b1111a7a579610ccc09f5a2
1 /*
2 Copyright © 2008, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: POSIX function vfork()
6 Lang: english
7 */
9 /******************************************************************************
11 NAME
12 #include <unistd.h>
14 pid_t vfork ();
16 FUNCTION
18 INPUTS
20 RESULT
22 NOTES
24 EXAMPLE
26 BUGS
28 SEE ALSO
30 INTERNALS
32 HISTORY
34 ******************************************************************************/
36 #include "aros/x86_64/asm.h"
38 .text
39 _ALIGNMENT
40 .globl AROS_CDEFNAME(vfork)
41 _FUNCTION(AROS_CDEFNAME(vfork))
42 .set bufsize, 16*8
43 .set retaddr, 0*8
44 .set stack, 15*8
46 AROS_CDEFNAME(vfork):
47 lea (-bufsize)(%rsp), %rsp /* _JMPLEN + 1 longs on the stack
48 it's our temporary jmp_buf */
49 mov %rsp, %rdi
50 call setjmp /* fill jmp_buf on the stack with
51 current register values */
52 mov bufsize(%rsp), %rax /* set return address in jmp_buf */
53 mov %rax, 0(%rdi) /* to this function call return
54 address */
55 lea bufsize(%rsp), %rax /* set stack value in jmp_buf */
56 mov %rax, 120(%rdi) /* this function call */
57 call __vfork /* __vfork call won't return */