fstatat: add wrapper that uses statx for non-legacy arch
[uclibc-ng.git] / libc / sysdeps / linux / h8300 / vfork.S
blob1e041c6f79936eaddc1ed9ac6b2e54f1a78e391f
1 /*
2   Copyright 2002, 2015 Yoshinori Sato <ysato@users.sourceforge.jp>
3 */
5 #include <sys/syscall.h>
7 #ifdef __H8300S__
8         .h8300s
9 #else
10         .h8300h
11 #endif
12         .text
13         .align 2
14         .globl  __vfork
15         .hidden __vfork
16         .type   __vfork,@function
17 __vfork:
18         mov.l   @sp+,er2                /* er2 = return address */
19         mov.l   #vfork_args,er1
20         sub.l   er0,er0
21         mov.b   #__NR_clone,r0l
22         trapa   #0
23         mov.l   #-4096,er1
24         cmp.l   er0,er1
25         bcc     done
26         neg.l   er0
27 # if !defined(__PIC__)
28         mov.l   er0,@errno
29 # else
30         mov.l   @(errno@GOTOFF,er5),er1
31         mov.l   er0,@er1
32 # endif
33         sub.l   er0,er0
34         dec.l   #1,er0
35 done:
36         jmp     @er2
38 vfork_args:
39         .long   0x00004111      /* CLONE_VFORK | CLONE_VM | SIGCHLD */
40         .long   0
41         .long   0
42         .long   0
43         .long   0
45 weak_alias(__vfork,vfork)
46 libc_hidden_def(vfork)
47         .end