From 975ce6359486ec3d2905e57d11ef22088b04b85f Mon Sep 17 00:00:00 2001 From: "Steven J. Magnani" Date: Wed, 10 Nov 2010 19:30:02 +0100 Subject: microblaze: vfork/clone interface Fix the microblaze vfork() and clone() implementations. Add support for clone2(). Signed-off-by: Steven J. Magnani Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/microblaze/vfork.S | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'libc/sysdeps/linux/microblaze/vfork.S') diff --git a/libc/sysdeps/linux/microblaze/vfork.S b/libc/sysdeps/linux/microblaze/vfork.S index 42458308a..c4b4dbf2f 100644 --- a/libc/sysdeps/linux/microblaze/vfork.S +++ b/libc/sysdeps/linux/microblaze/vfork.S @@ -1,14 +1,14 @@ /* * libc/sysdeps/linux/microblaze/vfork.S -- `vfork' syscall for linux/microblaze * + * Copyright (C) 2003 John Williams * Copyright (C) 2001 NEC Corporation * Copyright (C) 2001 Miles Bader - * Copyright (C) 2003 John Williams - * Copyright (C) 2000-2006 Erik Andersen * - * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - */ -/* + * 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 * Microblaze port by John Williams */ @@ -18,7 +18,7 @@ #define _SYSCALL_H #include -#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 @@ -27,18 +27,20 @@ .global C_SYMBOL_NAME(errno) -C_ENTRY (__vfork): + .globl __vfork + .align 4 +__vfork: addi r12, r0, SYS_vfork - bralid r17, 0x08; - nop + brki r14, 0x08; addi r4, r3, 125 /* minimum err value */ blti r4, 1f /* is r3 < -125? */ - rtsd r15, 8 /* normal return */ - nop -1: sub r3, r3, r0 /* r3 = -r3 */ + bri 2f /* normal return */ +1: sub r3, r3, r0 /* r3 = -r3 */ swi r3, r0, C_SYMBOL_NAME(errno); - rtsd r15, 8 /* error return */ + /* state restore etc */ +2: rtsd r15, 8 /* error return */ nop -C_END(__vfork) + .size __vfork, .-__vfork + weak_alias(__vfork,vfork) libc_hidden_weak(vfork) -- cgit v1.2.3