2 Copyright © 2008, The AROS Development Team. All rights reserved.
5 Desc: POSIX function vfork()
9 /******************************************************************************
34 ******************************************************************************/
36 #include "aros/ppc/asm.h"
40 .globl AROS_CDEFNAME(vfork)
41 _FUNCTION
(AROS_CDEFNAME
(vfork
))
48 mtctr 1 /* save current stack pointer */
49 stwu 1, -bufsize
(1) /* _JMPLEN + 2 longs on the stack
50 it's our temporary jmp_buf
53 mflr 12 /* save return address */
55 addi 3, 1, 8 /* prepare argument for setjmp */
56 lis 11, setjmp@ha
/* get address of setjmp */
59 blrl /* fill jmp_buf on the stack with
60 current register values */
62 stw 12, retaddr+
8(1) /* set return address in jmp_buf */
64 stw 12, stack+
8(1) /* set stack value in jmp_buf */
66 addi 3, 1, 8 /* prepare argument for __vfork */
67 lis 11, __vfork@ha
/* get address of __vfork */
70 bctr /* __vfork call won't return */