[uClibc-cvs] uClibc/libc/sysdeps/linux/frv clone.S, 1.1, 1.2 crtreloc.c, 1.1, 1.2 sysdep.c, 1.1, 1.2 vfork.S, 1.2, 1.3

Erik Andersen andersen at uclibc.org
Fri May 14 10:59:10 UTC 2004


Update of /var/cvs/uClibc/libc/sysdeps/linux/frv
In directory nail:/tmp/cvs-serv22500/libc/sysdeps/linux/frv

Modified Files:
	clone.S crtreloc.c sysdep.c vfork.S 
Log Message:
Alexandre Oliva writes:

Here are a number of minor changes to FR-V-specific bits of the uClibc
port:

- I've adjusted the definition of _dl_mmap to cope with the fact that
  there will be a definition for an mmap2-only system.

- We don't have COPY relocs, so optimize the copy reloc-related code
  away.

- Change the page size to 16KiB, to match the ABI spec, and not a
  stale value I'd copied from a linker config file.  Oops.

- Fix error handling in clone and vfork; parts of the changes by David
  Howells <dhowells at redhat.com>

- Rearrange includes in crtreloc.c.

- Change the API of __syscall_error, to reduce code size.

- Improve __syscall_return in terms of code size, so as to enable
  tail-calling of __syscall_error, at least within libc.  Ideally,
  __syscall_error should be hidden within libc.so, but this didn't
  work because of libdl.  I haven't looked into why, and figured I'd
  leave it visible for now.

- Rename enumerators and macros in sys/ucontext.h to reduce namespace
  pollution.



Index: crtreloc.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/frv/crtreloc.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/crtreloc.c	18 Feb 2004 08:04:49 -0000	1.1
+++ b/crtreloc.c	14 May 2004 10:59:08 -0000	1.2
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
    written by Alexandre Oliva <aoliva at redhat.com>
 This file is part of the GNU C Library.
 
@@ -17,13 +17,9 @@
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#define _GNU_SOURCE
-#include <link.h>
-
+#define _GNU_SOURCE 1
 #include <sys/types.h>
-
-#include <elf.h>
-#include <bits/elf-fdpic.h>
+#include <link.h>
 
 /* This file is to be compiled into crt object files, to enable
    executables to easily self-relocate.  */

Index: vfork.S
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/frv/vfork.S,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- a/vfork.S	14 May 2004 10:39:05 -0000	1.2
+++ b/vfork.S	14 May 2004 10:59:08 -0000	1.3
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foudnation, Inc.
+/* Copyright (C) 2003, 2004 Free Software Foudnation, Inc.
    This file is part of the GNU C Library.
    Contributed by David Howells <dhowells at redhat.com>, 2003.
 
@@ -26,16 +26,17 @@
        .type vfork, at function
 /* int vfork(void) */
 vfork:
-       setlos  #__NR_vfork, gr7
-       tira    gr0, #0
+	setlos.p #__NR_vfork, gr7
+	setlos	#-4096, gr4
+	tra	gr0, gr0
 
-       cmp     gr8, gr0, icc0
-       bplr    icc0, #2
+	cmp	gr8, gr4, icc0
+	blslr	icc0, #2
 
-       sethi.p #gotofffuncdeschi(__syscall_error), gr14
-       setlo   #gotofffuncdesclo(__syscall_error), gr14
-       ldd     @(gr14, gr15), gr14
-       jmpl    @(gr14, gr0)
+	sethi.p	#gotofffuncdeschi(__syscall_error), gr14
+	setlo	#gotofffuncdesclo(__syscall_error), gr14
+	ldd	@(gr14, gr15), gr14
+	jmpl	@(gr14, gr0)
 
        .size   vfork,.-vfork
 

Index: clone.S
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/frv/clone.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/clone.S	18 Feb 2004 08:04:49 -0000	1.1
+++ b/clone.S	14 May 2004 10:59:08 -0000	1.2
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foudnation, Inc.
+/* Copyright (C) 2003, 2004 Free Software Foudnation, Inc.
    This file is part of the GNU C Library.
    Contributed by Alexandre Oliva <aoliva at redhat.com>, 2003.
 
@@ -41,9 +41,11 @@
 	setlos	#__NR_clone, gr7
 	tra	gr0,gr0
 
-	cmp	gr8, gr0, icc0
-	bgtlr	icc0, #1
+	cmp.p	gr8, gr0, icc0
+	setlos #-4096, gr6
+	cmp.p	gr8, gr6, icc1
 	beq	icc0, #0, .Lthread_start
+	blslr	icc1, #2
 
 .Lsys_error:
 	sethi.p	#gotofffuncdeschi(__syscall_error), gr14
@@ -52,7 +54,7 @@
 	jmpl	@(gr14, gr0)
 
 .Lerror:
-	setlos.p #-EINVAL, gr7
+	setlos.p #-EINVAL, gr8
 	bra	.Lsys_error
 
 ###############################################################################

Index: sysdep.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/frv/sysdep.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/sysdep.c	18 Feb 2004 08:04:49 -0000	1.1
+++ b/sysdep.c	14 May 2004 10:59:08 -0000	1.2
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,6 @@
    an error number into errno.  */
 int __syscall_error (int err_no)
 {
-  __set_errno (err_no);
+  __set_errno (-err_no);
   return -1;
 }




More information about the uClibc-cvs mailing list