Indentation fix, cleanup.
[AROS.git] / arch / ppc-all / posixc / vfork.s
blob98780dab66a2e63d48d9befc93ec5d0268cf3c1c
1 /*
2 Copyright © 2008-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: POSIX function vfork(), PowerPC version
6 Lang: english
7 */
9 #include "aros/ppc/asm.h"
11 .text
12 _ALIGNMENT
13 .globl AROS_CDEFNAME(vfork)
14 _FUNCTION(AROS_CDEFNAME(vfork))
15 .set bufsize, 60*4
16 .set ret_addr, 2*4
17 .set stack, 0*4
19 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
24 aligned on 16 byte */
26 mflr 12 /* save return address */
28 addi 3, 1, 8 /* prepare argument for setjmp */
29 lis 11, setjmp@ha /* get address of setjmp */
30 la 11, setjmp@l(11)
31 mtlr 11
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 */
36 mfctr 12
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 */
41 la 11, __vfork@l(11)
42 mtctr 11
43 bctr /* __vfork call won't return */