2002-08-26 19:37:38 +08:00
|
|
|
/* Copyright (C) 1991,92,94,95,97,2002 Free Software Foundation, Inc.
|
1997-06-27 06:16:52 +08:00
|
|
|
This file is part of the GNU C Library.
|
1997-05-21 09:39:40 +08:00
|
|
|
|
1997-06-27 06:16:52 +08:00
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 12:56:23 +08:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
1997-05-21 09:39:40 +08:00
|
|
|
|
1997-06-27 06:16:52 +08:00
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 12:56:23 +08:00
|
|
|
Lesser General Public License for more details.
|
1997-05-21 09:39:40 +08:00
|
|
|
|
2001-07-06 12:56:23 +08:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-03-10 07:56:38 +08:00
|
|
|
License along with the GNU C Library. If not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
1997-05-21 09:39:40 +08:00
|
|
|
|
|
|
|
#include <sysdep.h>
|
|
|
|
|
|
|
|
/* ARM version. */
|
|
|
|
|
|
|
|
SYSCALL__ (fork, 0)
|
|
|
|
/* R1 is now 0 for the parent and 1 for the child. Decrement it to
|
|
|
|
make it -1 (all bits set) for the parent, and 0 (no bits set)
|
|
|
|
for the child. Then AND it with R0, so the parent gets
|
|
|
|
R0&-1==R0, and the child gets R0&0==0. */
|
|
|
|
sub r1, r1, $1
|
|
|
|
and r0, r0, r1
|
2004-12-05 05:20:17 +08:00
|
|
|
DO_RET (r14)
|
2002-08-26 19:37:38 +08:00
|
|
|
PSEUDO_END (__fork)
|
2003-01-01 04:37:32 +08:00
|
|
|
libc_hidden_def (__fork)
|
1997-05-21 09:39:40 +08:00
|
|
|
|
|
|
|
weak_alias (__fork, fork)
|