Added missing properties.
[tangerine.git] / arch / ppc-all / clib / vfork.s
blob61a49d9e34fb5d9b1a75b16a4abdb9d020b65358
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/ppc/asm.h"
38 .text
39 _ALIGNMENT
40 .globl AROS_CDEFNAME(vfork)
41 _FUNCTION(AROS_CDEFNAME(vfork))
42 .set bufsize, 60*4
43 .set retaddr, 2*4
44 .set stack, 0*4
46 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
51 aligned on 16 byte */
53 mflr 12 /* save return address */
55 addi 3, 1, 8 /* prepare argument for setjmp */
56 lis 11, setjmp@ha /* get address of setjmp */
57 la 11, setjmp@l(11)
58 mtlr 11
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 */
63 mfctr 12
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 */
68 la 11, __vfork@l(11)
69 mtctr 11
70 bctr /* __vfork call won't return */