From 5c12c8eecd5f2e06c200651e90befe85efcf166f Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 11 Oct 2001 08:29:22 +0000 Subject: Patch from Miles Bader to support the v850. He sent this patch to me a month ago, but I forgot to apply it... --- libc/sysdeps/linux/v850/vfork.S | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 libc/sysdeps/linux/v850/vfork.S (limited to 'libc/sysdeps/linux/v850/vfork.S') diff --git a/libc/sysdeps/linux/v850/vfork.S b/libc/sysdeps/linux/v850/vfork.S new file mode 100644 index 000000000..52c341c06 --- /dev/null +++ b/libc/sysdeps/linux/v850/vfork.S @@ -0,0 +1,42 @@ +/* + * libc/sysdeps/linux/v850/vfork.S -- `vfork' syscall for linux/v850 + * + * Copyright (C) 2001 NEC Corporation + * Copyright (C) 2001 Miles Bader + * + * 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 Miles Bader + */ + +#define _ERRNO_H 1 +#include +#define _SYSCALL_H +#include + +#include + +/* Clone the calling process, but without copying the whole address space. + The calling process is suspended until the new process exits or is + replaced by a call to `execve'. Return -1 for errors, 0 to the new process, + and the process ID of the new process to the old process. */ + +.global C_SYMBOL_NAME(errno) + +C_ENTRY (__vfork): + addi SYS_vfork, r0, r12 + trap 0 + addi -125, r0, r11 // minimum err value + cmp r11, r10 + bh 1f + jmp [lp] // normal return +1: mov hilo(C_SYMBOL_NAME(errno)), r11 + subr r0, r10 + st.w r10, 0[r11] + jmp [lp] // error return +C_END(__vfork) + +.weak C_SYMBOL_NAME(vfork) +C_SYMBOL_NAME(vfork) = C_SYMBOL_NAME(__vfork) -- cgit v1.2.3