[uClibc-cvs] uClibc/libc/sysdeps/linux/sparc Makefile,1.11,1.12 __longjmp.S,1.3,1.4 fork.S,1.1,1.2 rem.S,1.1,1.2 sdiv.S,1.1,1.2 setjmp.S,1.4,1.5 udiv.S,1.1,1.2 umul.S,1.1,1.2 urem.S,1.1,1.2 vfork.S,1.3,1.4 sysdep.h,1.2,NONE

Erik Andersen andersen at codepoet.org
Thu Jan 2 16:49:16 UTC 2003


Update of /var/cvs/uClibc/libc/sysdeps/linux/sparc
In directory winder:/tmp/cvs-serv29546/libc/sysdeps/linux/sparc

Modified Files:
	Makefile __longjmp.S fork.S rem.S sdiv.S setjmp.S udiv.S 
	umul.S urem.S vfork.S 
Removed Files:
	sysdep.h 
Log Message:
Rework sparc architecture support so it will compile
and run.  Seems to be working...
 -Erik


Index: Makefile
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/sparc/Makefile,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- Makefile	5 Sep 2002 05:29:19 -0000	1.11
+++ Makefile	2 Jan 2003 16:48:39 -0000	1.12
@@ -25,8 +25,8 @@
 include $(TOPDIR)Rules.mak
 ASFLAGS=$(CFLAGS)
 
-CRT0=crt0.c
-CRT0_OBJ=$(patsubst %.c,%.o, $(CRT0))
+CRT0_SRC = crt0.c
+CRT0_OBJ = crt0.o crt1.o
 
 SSRC=__longjmp.S fork.S vfork.S clone.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
 	urem.S udiv.S umul.S sdiv.S rem.S
@@ -45,10 +45,10 @@
 
 ar-target: $(OBJS) $(CRT0_OBJ)
 	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
-	cp $(CRT0_OBJ) $(TOPDIR)lib/$(CRT0_OBJ)
+	cp $(CRT0_OBJ) $(TOPDIR)lib/
 
-$(CRT0_OBJ): %.o : %.c
-	$(CC) $(CFLAGS) -c $< -o $@
+$(CRT0_OBJ): $(CRT0_SRC)
+	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
 	$(STRIPTOOL) -x -R .note -R .comment $*.o
 
 $(SOBJS): %.o : %.S

Index: __longjmp.S
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/sparc/__longjmp.S,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- __longjmp.S	4 Feb 2002 10:07:50 -0000	1.3
+++ __longjmp.S	2 Jan 2003 16:48:39 -0000	1.4
@@ -16,7 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <sysdep.h>
+#include <sys/syscall.h>
 
 #define _ASM 1
 #define _SETJMP_H

Index: fork.S
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/sparc/fork.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fork.S	4 Feb 2002 10:07:50 -0000	1.1
+++ fork.S	2 Jan 2003 16:48:39 -0000	1.2
@@ -1,5 +1,6 @@
-/* Copyright (C) 1991, 92, 94, 95, 97, 99 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
+   Contributed by Miguel de Icaza <miguel at 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 Lesser General Public
@@ -16,31 +17,31 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <sysdep.h>
+/* Code taken from glibc2.2.2/sysdeps/unix/sysv/linux/sparc/vfork.S */
+
+#include <sys/syscall.h>
 
 .text;  
-.global    fork;
-.align 4;      
-fork: ;
-.type   fork  , at function; ;      
+.global	fork;
+.align 4;
+.type	fork, at function;
 
-	mov	2, %g1 ; 
-	ta	0x10;
-	bcc,a 9000f;
-	nop;
-	save    %sp,-96,%sp;
-	call __errno_location;
-	nop;    
-	st	%i0,[%o0];
-	jmpl    %i7+8,%g0;
-	restore %g0,-1,%o0; ;
-	9000:;
+fork:
+	mov __NR_fork, %g1
+	ta	0x10
+	bcc,a	9000f
+	nop
+	save    %sp,-96,%sp
+	call __errno_location
+	nop
+	st	%i0,[%o0]
+	jmpl	%i7+8,%g0
+	restore	%g0,-1,%o0
 
-	/* %o1 is now 0 for the parent and 1 for the child.  Decrement it to
-	   make it -1 (all bits set) for the parent, and 0 (no bits set)
-	   for the child.  Then AND it with %o0, so the parent gets
-	   %o0&-1==pid, and the child gets %o0&0==0.  */
-	sub %o1, 1, %o1
+9000:
+	sub	%o1, 1, %o1
 	retl
-	and %o0, %o1, %o0
+	and	%o0, %o1, %o0
+
+.size fork,.-fork;
 

Index: rem.S
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/sparc/rem.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- rem.S	4 Feb 2002 10:07:50 -0000	1.1
+++ rem.S	2 Jan 2003 16:48:39 -0000	1.2
@@ -37,7 +37,7 @@
 
 
 
-#include <sysdep.h>
+#include <sys/syscall.h>
 
 
 .global   .rem;
@@ -364,4 +364,4 @@
 	retl
 	mov %o3, %o0
 
-END(.rem)
+.size .rem,.-.rem;

Index: sdiv.S
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/sparc/sdiv.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- sdiv.S	4 Feb 2002 10:07:50 -0000	1.1
+++ sdiv.S	2 Jan 2003 16:48:39 -0000	1.2
@@ -37,7 +37,7 @@
 
 
 
-#include <sysdep.h>
+#include <sys/syscall.h>
 
 .global   .div;
 .align 4;
@@ -363,4 +363,4 @@
 	retl
 	mov %o2, %o0
 
-END(.div)
+.size .div,.-.div;

Index: setjmp.S
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/sparc/setjmp.S,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- setjmp.S	4 Feb 2002 10:07:51 -0000	1.4
+++ setjmp.S	2 Jan 2003 16:48:39 -0000	1.5
@@ -16,22 +16,43 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <sysdep.h>
+#include <sys/syscall.h>
 
 #define _ASM 1
 #define _SETJMP_H
 #include <bits/setjmp.h>
+#define ST_FLUSH_WINDOWS 3
 
-ENTRY(_setjmp)
+.global   _setjmp;
+.align 4;
+.type  _setjmp , at function; 
+
+_setjmp: 
 	b	1f
 	 set	0, %o1
-END(_setjmp)
+.size _setjmp,.-_setjmp;
 
-ENTRY(setjmp)
+
+
+
+
+
+.global   setjmp;
+.align 4;
+.type  setjmp , at function; 
+
+setjmp: 
 	set	1, %o1
-END(setjmp)
+.size setjmp,.-setjmp;
 
-ENTRY (__sigsetjmp)
+
+
+
+.global   __sigsetjmp;
+.align 4;
+.type  __sigsetjmp , at function; 
+
+__sigsetjmp: 
 1:
 	/* Save our PC, SP and FP.  Save the signal mask if requested with
 	   a tail-call for simplicity; it always returns zero.  */
@@ -44,7 +65,9 @@
 	mov	%o7, %g1
 	call	__sigjmp_save
 	 mov	%g1, %o7
-END(__sigsetjmp)
+.size __sigsetjmp,.-__sigsetjmp;
+
+
 
 .weak   _setjmp    
 .weak   setjmp  

Index: udiv.S
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/sparc/udiv.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- udiv.S	4 Feb 2002 10:07:51 -0000	1.1
+++ udiv.S	2 Jan 2003 16:48:39 -0000	1.2
@@ -37,7 +37,7 @@
 
 
 
-#include <sysdep.h>
+#include <sys/syscall.h>
 
 .global   .udiv;
 .align 4;
@@ -345,4 +345,4 @@
 	retl
 	mov %o2, %o0
 
-END(.udiv)
+.size .udiv,.-.udiv;

Index: umul.S
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/sparc/umul.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- umul.S	4 Feb 2002 10:07:51 -0000	1.1
+++ umul.S	2 Jan 2003 16:48:39 -0000	1.2
@@ -14,7 +14,7 @@
  *	bnz	overflow	(or tnz)
  */
 
-#include <sysdep.h>
+#include <sys/syscall.h>
 
 
 .global   .umul;

Index: urem.S
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/sparc/urem.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- urem.S	4 Feb 2002 10:07:51 -0000	1.1
+++ urem.S	2 Jan 2003 16:48:39 -0000	1.2
@@ -37,7 +37,7 @@
 
 
 
-#include <sysdep.h>
+#include <sys/syscall.h>
 
 
 .global   .urem;
@@ -347,4 +347,4 @@
 	retl
 	mov %o3, %o0
 
-END(.urem)
+.size  .urem , . -.urem

Index: vfork.S
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/sparc/vfork.S,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- vfork.S	12 Jun 2001 22:23:26 -0000	1.3
+++ vfork.S	2 Jan 2003 16:48:39 -0000	1.4
@@ -3,28 +3,50 @@
    Contributed by Jakub Jelinek <jj at ultra.linux.cz>, 1999.
 
    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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /* Code taken from glibc2.2.2/sysdeps/unix/sysv/linux/sparc/vfork.S */
 
-#include "sysdep.h"
+#include <sys/syscall.h>
 
-PSEUDO (__vfork, vfork, 0)
+#ifndef __NR_vfork
+/* uClinux-2.0 only has fork which is really vfork */
+#define __NR_vfork __NR_fork
+#endif
+
+.text;  
+.global	vfork;
+.align 4;
+.type	vfork, at function;
+
+vfork:
+	mov __NR_vfork, %g1
+	ta	0x10
+	bcc,a	9000f
+	nop
+	save    %sp,-96,%sp
+	call __errno_location
+	nop
+	st	%i0,[%o0]
+	jmpl	%i7+8,%g0
+	restore	%g0,-1,%o0
+
+9000:
 	sub	%o1, 1, %o1
 	retl
-	 and	%o0, %o1, %o0
+	and	%o0, %o1, %o0
+
+.size vfork,.-vfork;
 
-.size __vfork,.-__vfork
-.weak vfork; vfork = __vfork;

--- sysdep.h DELETED ---




More information about the uClibc-cvs mailing list