OSDN Git Service

hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing...
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / m68k / vfork.S
1 #include <features.h>
2
3 #include <asm/unistd.h>
4
5 #ifndef __NR_vfork
6 #define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
7 #endif
8
9 #define IMM #
10
11         .text
12         .align 2
13         .globl errno
14         .globl  vfork
15 #ifdef __HAVE_ELF__
16         .type   vfork,@function
17 #endif
18
19 vfork:
20         movl    %sp@+, %a1               /* save the return address for later */
21         movl    IMM __NR_vfork,%d0
22         trap    #0
23         movl    IMM -4097, %d1
24         cmpl    %d0, %d1
25         bcs     fix_errno
26         jmp             %a1@                     /* don't return,  just jmp directly */
27 fix_errno:
28         negl    %d0
29 #ifndef __PIC__                                 /* needs handling as the other archs */
30         movl    errno, %a0
31 #else
32         movl    errno@GOT(%a5), %a0
33 #endif
34         movl    %d0, %a0@
35         movl    IMM -1, %d0
36         jmp             %a1@                     /* don't return,  just jmp directly */
37
38 .size vfork,.-vfork
39 libc_hidden_def(vfork)