Last of the EDs and TDs in pool should also be initialized.
[cake.git] / arch / i386-all / clib / vfork.s
blobfb47f4224f14b29bd660f2f19c1e3683a46869a4
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/i386/asm.h"
38 .text
39 _ALIGNMENT
40 .globl AROS_CDEFNAME(vfork)
41 _FUNCTION(AROS_CDEFNAME(vfork))
42 .set bufsize, 8*4
43 .set retaddr, 0*4
44 .set stack, 7*4
46 AROS_CDEFNAME(vfork):
47 lea (-bufsize)(%esp), %esp /* _JMPLEN + 1 longs on the stack
48 it's our temporary jmp_buf */
49 push %esp
50 call setjmp /* fill jmp_buf on the stack with
51 current register values */
52 pop %esp
53 mov bufsize(%esp), %eax /* set return address in jmp_buf */
54 mov %eax, retaddr(%esp) /* to this function call return
55 address */
56 lea bufsize(%esp), %eax /* set stack value in jmp_buf */
57 /* to stack value from before */
58 mov %eax, stack(%esp) /* this function call */
60 mov %esp, %eax
61 push %ebp
62 mov %esp, %ebp
63 push %eax
64 call __vfork /* __vfork call won't return */