about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/sparc/Dist3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/Makefile5
-rw-r--r--sysdeps/unix/sysv/linux/sparc/fork.S33
-rw-r--r--sysdeps/unix/sysv/linux/sparc/pipe.S37
-rw-r--r--sysdeps/unix/sysv/linux/sparc/syscalls.list3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sysdep.h12
6 files changed, 86 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/sparc/Dist b/sysdeps/unix/sysv/linux/sparc/Dist
index 6134c6056d..b50a46fb68 100644
--- a/sysdeps/unix/sysv/linux/sparc/Dist
+++ b/sysdeps/unix/sysv/linux/sparc/Dist
@@ -1,2 +1,5 @@
 __sigtrampoline.S
 clone.S
+start.c
+pipe.S
+fork.S
diff --git a/sysdeps/unix/sysv/linux/sparc/Makefile b/sysdeps/unix/sysv/linux/sparc/Makefile
index 30ef946c19..4cbd3bd004 100644
--- a/sysdeps/unix/sysv/linux/sparc/Makefile
+++ b/sysdeps/unix/sysv/linux/sparc/Makefile
@@ -2,10 +2,11 @@ ifeq ($(subdir),signal)
 sysdep_routines += __sigtrampoline
 endif
 
+asm-CPPFLAGS=-D__ASSEMBLY__
+as-FLAGS-.so=-fPIC
+
 # When I get this to work, this is the right thing
 ifeq ($(subdir),elf)
 CFLAGS-rtld.c += -mv8
 #rtld-routines += dl-sysdepsparc
 endif   # elf
-
-asm-CPPFLAGS = -fPIC
diff --git a/sysdeps/unix/sysv/linux/sparc/fork.S b/sysdeps/unix/sysv/linux/sparc/fork.S
new file mode 100644
index 0000000000..55633f2cde
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/fork.S
@@ -0,0 +1,33 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+   Cambridge, MA 02139, USA.  */
+
+#include <sysdep.h>
+
+PSEUDO (__libc_fork, fork, 0)
+	tst %o1
+	be,a parent
+	nop
+	/* child: return 0 */
+	clr %o0
+parent:
+	ret
+
+PSEUDO_END (__libc_fork)
+weak_alias (__libc_fork, __fork)
+weak_alias (__libc_fork, fork)
diff --git a/sysdeps/unix/sysv/linux/sparc/pipe.S b/sysdeps/unix/sysv/linux/sparc/pipe.S
new file mode 100644
index 0000000000..4c50656d6c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/pipe.S
@@ -0,0 +1,37 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, 1997.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <sysdep.h>
+	.globl __libc_pipe
+ENTRY (__libc_pipe)
+        mov %o0, %o2            /* Save PIPEDES. */
+	mov SYS_ify(pipe),%g1
+	ta 0x10
+	bcc,a 2f
+	nop
+	SYSCALL_ERROR_HANDLER
+2:
+	st %o0, [%o2]           /* PIPEDES[0] = %o0; */
+        st %o1, [%o2 + 4]       /* PIPEDES[1] = %o1; */
+	retl
+	clr %o0
+
+PSEUDO_END (__libc_pipe)
+weak_alias (__libc_pipe, __pipe)
+weak_alias (__libc_pipe, pipe)
diff --git a/sysdeps/unix/sysv/linux/sparc/syscalls.list b/sysdeps/unix/sysv/linux/sparc/syscalls.list
index 7883d70719..3d59984f1b 100644
--- a/sysdeps/unix/sysv/linux/sparc/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/syscalls.list
@@ -1,3 +1,6 @@
 # File name	Caller	Syscall name	# args	Strong name	Weak names
 
+fork		-	fork		0	__fork		fork
+pipe		-	pipe		1	__pipe		pipe
 s_llseek	llseek	_llseek		5	__sys_llseek
+syscall		-	syscall		0	__syscall	syscall
diff --git a/sysdeps/unix/sysv/linux/sparc/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sysdep.h
index 5ae440152b..0e5a8cd218 100644
--- a/sysdeps/unix/sysv/linux/sparc/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sysdep.h
@@ -20,11 +20,6 @@
 #ifndef _LINUX_SPARC_SYSDEP_H
 #define _LINUX_SPARC_SYSDEP_H 1
 
-/* Kernel headers use __ASSEMBLY__ */
-#ifdef ASSEMBLER
-#define __ASSEMBLY__
-#endif
-
 #include <sysdeps/unix/sparc/sysdep.h>
 
 #undef SYS_ify
@@ -40,6 +35,13 @@
 
 /* Linux/SPARC uses a different trap number */
 #undef PSEUDO
+#undef ENTRY
+
+#define ENTRY(name) \
+	.global C_SYMBOL_NAME(name); \
+	.align 2;\
+	C_LABEL(name);\
+	.type name,@function;
 
 #ifdef PIC
 #define SYSCALL_ERROR_HANDLER \