[git commit prelink] cris: add provide arch-specific vfork implementation

Thorsten Glaser tg at mirbsd.org
Wed Apr 6 13:20:12 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=9b5df2295b4a3cfc63a15b6490f2b61dcf7c1be9
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/prelink

vfork must be called with nothing at all on the stack,
so implementing it via syscall() does not work.

Signed-off-by: Thorsten Glaser <tg at mirbsd.org>
Signed-off-by: Waldemar Brodkorb <wbx at openadk.org>
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 libc/sysdeps/linux/cris/Makefile.arch |    2 +-
 libc/sysdeps/linux/cris/vfork.S       |   30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletions(-)
 create mode 100644 libc/sysdeps/linux/cris/vfork.S

diff --git a/libc/sysdeps/linux/cris/Makefile.arch b/libc/sysdeps/linux/cris/Makefile.arch
index 43e1912..8a682b0 100644
--- a/libc/sysdeps/linux/cris/Makefile.arch
+++ b/libc/sysdeps/linux/cris/Makefile.arch
@@ -7,7 +7,7 @@
 
 CSRC := __init_brk.c brk.c sbrk.c
 
-SSRC := setjmp.S __longjmp.S clone.S sysdep.S syscall.S
+SSRC := setjmp.S __longjmp.S clone.S sysdep.S syscall.S vfork.S
 ifeq ($(UNIFIED_SYSCALL),y)
 SSRC += __uClibc_syscall.S
 endif
diff --git a/libc/sysdeps/linux/cris/vfork.S b/libc/sysdeps/linux/cris/vfork.S
new file mode 100644
index 0000000..ea8a81d
--- /dev/null
+++ b/libc/sysdeps/linux/cris/vfork.S
@@ -0,0 +1,30 @@
+/*-
+ * Copyright (c) 2011
+ *	Thorsten Glaser <tg at freewrt.org>
+ *
+ * This file is available either under the terms and conditions of
+ * the MirOS Licence, or the same terms as klibc or uClibc.
+ */
+
+#include "sysdep.h"
+
+	.syntax no_register_prefix
+
+/*
+ * vfork is special, but PSEUDO() would probably work were it not broken;
+ * there must be nothing at all on the stack above the stack frame of the
+ * enclosing function
+ */
+
+ENTRY(__vfork)
+	movu.w	__NR_vfork,$r9
+	break	13
+	cmps.w	-4096,$r10
+	bhs	0f
+	 nop
+	Ret
+	 nop
+PSEUDO_END(__vfork)
+
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)
-- 
1.7.3.4



More information about the uClibc-cvs mailing list