OSDN Git Service

hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing...
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / h8300 / vfork.S
1
2 #include <asm/unistd.h>
3
4 #ifndef __NR_vfork
5 #define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
6 #endif
7
8 #ifdef __H8300S__
9         .h8300s
10 #else
11         .h8300h
12 #endif
13         .text
14         .align 2
15         .globl _errno
16         .globl _vfork
17 #if defined __HAVE_ELF__
18         .type    vfork,@function
19 #endif
20 _vfork:
21         mov.l   @sp+, er1
22         sub.l   er0,er0
23         mov.b   #__NR_vfork,r0l
24         trapa   #0
25         mov.l   #-4096, er2
26         cmp.l   er0,er2
27         bcs     fix_errno
28         jmp     @er1                     /* don't return,  just jmp directly */
29 fix_errno:
30         neg.l   er0
31 #if !defined(__PIC__)
32         mov.l   er0,@_errno
33 #else
34         mov.l   @(_errno@GOTOFF,er5),er2
35         mov.l   er0,@er2
36 #endif
37         sub.l   er0,er0
38         dec.l   #1,er0
39         jmp     @er1                     /* don't return,  just jmp directly */
40
41 libc_hidden_def(_vork)