revert between 56095 -> 55830 in arch
[AROS.git] / arch / armeb-all / posixc / vfork.s
blob49c23b378c62d2a3f1c707e5ccee0ae87f90ee3a
1 /*
2 * vfork.s
4 * Created on: Aug 5, 2009
5 * Author: misc
7 * $Id$
8 */
10 #include "aros/armeb/asm.h"
12 .text
13 .align 2
14 .global AROS_CDEFNAME(vfork)
15 .type AROS_CDEFNAME(vfork),%function
17 AROS_CDEFNAME(vfork):
18 str lr, [sp, #-4]! /* Store link register */
19 sub sp, sp, jmpbuf_SIZEOF /* Create space for env structure */
20 mov r0, sp
21 bl setjmp /* Prepare setjmp */
23 ldr r0, [sp, jmpbuf_SIZEOF] /* restore link register */
24 str r0, [sp, retaddr] /* save lr as first argument of env structure */
26 add r0, sp, jmpbuf_SIZEOF + 4 /* save previous stack pointer into env structure */
27 str r0, [sp, #9*4]
29 mov r0, sp /* Argument to vfork() */
30 b __vfork /* never return... */