diff options
author | Eric Andersen <andersen@codepoet.org> | 2004-07-16 11:09:34 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2004-07-16 11:09:34 +0000 |
commit | c3d50a69839f8d80fc7244fde6e4a57e5e39dd36 (patch) | |
tree | c9e27baac7541384b806cce0845f28c1f59b5a2e /libc/sysdeps/linux/nios/vfork.S | |
parent | 3cf731bf40f153a73373798085d1f45a80b972d6 (diff) |
Pete Popov writes:
Hi Erik,
I'm not sure why the NIOS support is not in uClibc -- perhaps the patch
was rejected or never submitted? In any case, I'm playing with some NIOS
stuff and created this patch against 0.9.26. The work was done by
Microtronix. I'm not sure who else contributed to it. It would be great
to have the NIOS support available in uClibc so developers don't have to
go searching for these bits.
Pete
Diffstat (limited to 'libc/sysdeps/linux/nios/vfork.S')
-rw-r--r-- | libc/sysdeps/linux/nios/vfork.S | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/nios/vfork.S b/libc/sysdeps/linux/nios/vfork.S new file mode 100644 index 000000000..22b3c30cd --- /dev/null +++ b/libc/sysdeps/linux/nios/vfork.S @@ -0,0 +1,58 @@ +/* + * libc/sysdeps/linux/nios/vfork.S -- `vfork' syscall for linux/nios + * + * Copyright (C) 2004 Microtronix Datacom Ltd + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License. See the file COPYING.LIB in the main + * directory of this archive for more details. + * + * Written by Wentao Xu <wentao@microtronix.com> + */ +#include <asm/unistd.h> +#include "NM_Macros.S" + +#ifndef __NR_vfork +#define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */ +#endif + + .text + .align 2 + .globl errno + .globl vfork + .globl __libc_vfork +#if defined __HAVE_ELF__ + .type vfork,@function + .type __libc_vfork,@function +#endif +vfork: +__libc_vfork: + MOVIP %g1, __NR_vfork + trap 63 + + bgen %g1, 12 + not %g1 /* (unsigned long) -4096 */ + cmp %o0, %g1 + skps cc_hi + jmp %o7 + nop + +fix_errno: + neg %o0 + save %sp, -16 + MOVIA %g1, __errno_location@h + call %g1 + nop + st [%o0], %i0 /* store errno */ + + xor %i0, %i0 + subi %i0, 1 /* retval=-1 */ + ret + restore + + + + + + + |