2 Copyright © 2008-2011, The AROS Development Team. All rights reserved.
5 Desc: POSIX function vfork(), PowerPC version
9 #include "aros/ppc/asm.h"
13 .globl AROS_CDEFNAME(vfork)
14 _FUNCTION
(AROS_CDEFNAME
(vfork
))
21 mtctr 1 /* save current stack pointer */
22 stwu 1, -bufsize
(1) /* _JMPLEN + 2 longs on the stack
23 it's our temporary jmp_buf
26 mflr 12 /* save return address */
28 addi 3, 1, 8 /* prepare argument for setjmp */
29 lis 11, setjmp@ha
/* get address of setjmp */
32 blrl /* fill jmp_buf on the stack with
33 current register values */
35 stw 12, ret_addr+
8(1) /* set return address in jmp_buf */
37 stw 12, stack+
8(1) /* set stack value in jmp_buf */
39 addi 3, 1, 8 /* prepare argument for __vfork */
40 lis 11, __vfork@ha
/* get address of __vfork */
43 bctr /* __vfork call won't return */