]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4re-core/uclibc/lib/contrib/uclibc/libc/sysdeps/linux/m68k/vfork.S
Update
[l4.git] / l4 / pkg / l4re-core / uclibc / lib / contrib / uclibc / libc / sysdeps / linux / m68k / vfork.S
1 /*
2  * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
3  *
4  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
5  */
6
7 #include <sys/syscall.h>
8
9 #ifndef __NR_vfork
10 #define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
11 #endif
12
13 #define IMM #
14
15         .text
16         .align 2
17         .globl  __vfork
18         .hidden __vfork
19         .type   __vfork,@function
20
21 __vfork:
22         movl    %sp@+, %a1               /* save the return address for later */
23         movl    IMM __NR_vfork,%d0
24         trap    #0
25         movl    IMM -4097, %d1
26         cmpl    %d0, %d1
27         bcs     fix_errno
28         jmp             %a1@                     /* don't return,  just jmp directly */
29 fix_errno:
30         negl    %d0
31 #ifndef __PIC__                                 /* needs handling as the other archs */
32         movl    errno, %a0
33 #else
34         movl    errno@GOT(%a5), %a0
35 #endif
36         movl    %d0, %a0@
37         movl    IMM -1, %d0
38         jmp             %a1@                     /* don't return,  just jmp directly */
39
40 .size __vfork,.-__vfork
41 weak_alias(__vfork,vfork)
42 libc_hidden_def(vfork)