[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r2261 - in /fsf/trunk/ports: ./ sysdeps/mips/ sysdeps/mips/mips64/n32/ sysdeps/mips/mips64/n64/ sysdeps/mips/mips64/soft-fp/...



Author: eglibc
Date: Thu May 24 00:03:40 2007
New Revision: 2261

Log:
Import glibc-ports-mainline for 2007-05-24

Added:
    fsf/trunk/ports/sysdeps/mips/mips64/soft-fp/Makefile   (with props)
    fsf/trunk/ports/sysdeps/mips/mips64/soft-fp/e_sqrtl.c
    fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c
    fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c
    fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/readahead.c
    fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
    fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c
    fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
Modified:
    fsf/trunk/ports/ChangeLog.arm
    fsf/trunk/ports/ChangeLog.mips
    fsf/trunk/ports/ChangeLog.powerpc
    fsf/trunk/ports/sysdeps/mips/dl-machine.h
    fsf/trunk/ports/sysdeps/mips/mips64/n32/Implies
    fsf/trunk/ports/sysdeps/mips/mips64/n64/Implies
    fsf/trunk/ports/sysdeps/mips/mips64/soft-fp/sfp-machine.h
    fsf/trunk/ports/sysdeps/powerpc/nofpu/feholdexcpt.c
    fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
    fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h
    fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/Versions
    fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/sigaction.c

Modified: fsf/trunk/ports/ChangeLog.arm
==============================================================================
--- fsf/trunk/ports/ChangeLog.arm (original)
+++ fsf/trunk/ports/ChangeLog.arm Thu May 24 00:03:40 2007
@@ -1,3 +1,25 @@
+2007-05-23  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/kernel-features.h
+	(__ASSUME_SIGFRAME_V2): Define for 2.6.18 and later.
+	* sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
+	(__default_sa_restorer): Rename to __default_sa_restorer_v1.
+	Don't define if __ASSUME_SIGFRAME_V2.
+	(__default_rt_sa_restorer): Rename to
+	__default_rt_sa_restorer_v1.  Don't define if
+	__ASSUME_SIGFRAME_V2.
+	(__default_sa_restorer_v2, __default_rt_sa_restorer_v2): New.
+	* sysdeps/unix/sysv/linux/arm/nptl/Versions
+	(__default_sa_restorer_v1, __default_rt_sa_restorer_v1,
+	__default_sa_restorer_v2, __default_rt_sa_restorer_v2): Add to
+	GLIBC_PRIVATE.
+	* sysdeps/unix/sysv/linux/arm/sigaction.c [__ARM_EABI__]
+	(__default_sa_restorer_v1, __default_sa_restorer_v2,
+	__default_rt_sa_restorer_v1, __default_rt_sa_restorer_v2):
+	Declare.
+	(__default_sa_restorer, __default_rt_sa_restorer): Define as
+	macros depending on kernel version.
+
 2007-01-23  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/arm/sysdep.h (PTR_MANGLE, PTR_DEMANGLE):

Modified: fsf/trunk/ports/ChangeLog.mips
==============================================================================
--- fsf/trunk/ports/ChangeLog.mips (original)
+++ fsf/trunk/ports/ChangeLog.mips Thu May 24 00:03:40 2007
@@ -1,3 +1,27 @@
+2007-05-23  Atsushi Nemoto  <anemo@xxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c: New file.
+	* sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c: New file.
+	* sysdeps/unix/sysv/linux/mips/mips32/readahead.c: New file.
+	* sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c: New file.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c: New file.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: New file.
+
+2007-05-23  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/mips/mips64/n32/Implies: Add mips/mips64/soft-fp.
+	* sysdeps/mips/mips64/n64/Implies: Likewise.
+	* sysdeps/mips/mips64/soft-fp/Makefile: New.
+	* sysdeps/mips/mips64/soft-fp/e_sqrtl.c: New.
+	* sysdeps/mips/mips64/soft-fp/sfp-machine.h: Include <fenv.h> and
+	<fpu_control.h>.  Use hardware exception and rounding mode
+	settings.
+
+2007-05-23  Richard Sandiford  <rsandifo@xxxxxxxxxxxxx>
+
+	* sysdeps/mips/dl-machine.h (elf_machine_reloc): Change type of
+	r_info argument to ElfW(Addr).
+
 2007-02-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/mips/bits/mathdef.h (float_t): Change to float.

Modified: fsf/trunk/ports/ChangeLog.powerpc
==============================================================================
--- fsf/trunk/ports/ChangeLog.powerpc (original)
+++ fsf/trunk/ports/ChangeLog.powerpc Thu May 24 00:03:40 2007
@@ -1,3 +1,9 @@
+2007-05-23  Steven Munroe  <sjmunroe@xxxxxxxxxx>
+
+	* sysdeps/powerpc/nofpu/feholdexcpt.c (feholdexcept): Disable
+	exceptions.  Use the updated env in fesetenv().
+	Add libm_hidden_def.
+
 2007-01-23  Steven Munroe  <sjmunroe@xxxxxxxxxx>
 
 	[BZ #2749]

Modified: fsf/trunk/ports/sysdeps/mips/dl-machine.h
==============================================================================
--- fsf/trunk/ports/sysdeps/mips/dl-machine.h (original)
+++ fsf/trunk/ports/sysdeps/mips/dl-machine.h Thu May 24 00:03:40 2007
@@ -304,7 +304,7 @@
 
 auto inline void
 __attribute__ ((always_inline))
-elf_machine_reloc (struct link_map *map, ElfW(Word) r_info,
+elf_machine_reloc (struct link_map *map, ElfW(Addr) r_info,
 		   const ElfW(Sym) *sym, const struct r_found_version *version,
 		   void *reloc_addr, ElfW(Addr) r_addend, int inplace_p)
 {

Modified: fsf/trunk/ports/sysdeps/mips/mips64/n32/Implies
==============================================================================
--- fsf/trunk/ports/sysdeps/mips/mips64/n32/Implies (original)
+++ fsf/trunk/ports/sysdeps/mips/mips64/n32/Implies Thu May 24 00:03:40 2007
@@ -1,4 +1,5 @@
 ieee754/ldbl-128
+mips/mips64/soft-fp
 mips/mips64
 mips
 wordsize-32

Modified: fsf/trunk/ports/sysdeps/mips/mips64/n64/Implies
==============================================================================
--- fsf/trunk/ports/sysdeps/mips/mips64/n64/Implies (original)
+++ fsf/trunk/ports/sysdeps/mips/mips64/n64/Implies Thu May 24 00:03:40 2007
@@ -1,4 +1,5 @@
 ieee754/ldbl-128
+mips/mips64/soft-fp
 mips/mips64
 mips
 wordsize-64

Added: fsf/trunk/ports/sysdeps/mips/mips64/soft-fp/Makefile
==============================================================================
Binary file - no diff available.

Propchange: fsf/trunk/ports/sysdeps/mips/mips64/soft-fp/Makefile
------------------------------------------------------------------------------
    svn:mime-type = audio/x-669-mod

Added: fsf/trunk/ports/sysdeps/mips/mips64/soft-fp/e_sqrtl.c
==============================================================================
--- fsf/trunk/ports/sysdeps/mips/mips64/soft-fp/e_sqrtl.c (added)
+++ fsf/trunk/ports/sysdeps/mips/mips64/soft-fp/e_sqrtl.c Thu May 24 00:03:40 2007
@@ -1,0 +1,39 @@
+/* long double square root in software floating-point emulation.
+   Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@xxxxxxxxxx) and
+		  Jakub Jelinek (jj@xxxxxxxxxxxxxx).
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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
+   Lesser General Public License for more details.
+
+   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.  */
+
+#include <stdlib.h>
+#include <soft-fp.h>
+#include <quad.h>
+
+long double
+__ieee754_sqrtl (const long double a)
+{
+  FP_DECL_EX;
+  FP_DECL_Q(A); FP_DECL_Q(C);
+  long double c;
+
+  FP_INIT_ROUNDMODE;
+  FP_UNPACK_Q(A, a);
+  FP_SQRT_Q(C, A);
+  FP_PACK_Q(c, C);
+  FP_HANDLE_EXCEPTIONS;
+  return c;
+}

Modified: fsf/trunk/ports/sysdeps/mips/mips64/soft-fp/sfp-machine.h
==============================================================================
--- fsf/trunk/ports/sysdeps/mips/mips64/soft-fp/sfp-machine.h (original)
+++ fsf/trunk/ports/sysdeps/mips/mips64/soft-fp/sfp-machine.h Thu May 24 00:03:40 2007
@@ -1,3 +1,6 @@
+#include <fenv.h>
+#include <fpu_control.h>
+
 #define _FP_W_TYPE_SIZE		64
 #define _FP_W_TYPE		unsigned long long
 #define _FP_WS_TYPE		signed long long
@@ -40,8 +43,32 @@
     R##_c = FP_CLS_NAN;						\
   } while (0)
 
-#define FP_EX_INVALID           (1 << 4)
-#define FP_EX_DIVZERO           (1 << 3)
-#define FP_EX_OVERFLOW          (1 << 2)
-#define FP_EX_UNDERFLOW         (1 << 1)
-#define FP_EX_INEXACT           (1 << 0)
+#define _FP_DECL_EX		fpu_control_t _fcw
+
+#define FP_ROUNDMODE		(_fcw & 0x3)
+
+#define FP_RND_NEAREST		FE_TONEAREST
+#define FP_RND_ZERO		FE_TOWARDZERO
+#define FP_RND_PINF		FE_UPWARD
+#define FP_RND_MINF		FE_DOWNWARD
+
+#define FP_EX_INVALID		FE_INVALID
+#define FP_EX_OVERFLOW		FE_OVERFLOW
+#define FP_EX_UNDERFLOW		FE_UNDERFLOW
+#define FP_EX_DIVZERO		FE_DIVBYZERO
+#define FP_EX_INEXACT		FE_INEXACT
+
+#ifdef __mips_hard_float
+#define FP_INIT_ROUNDMODE			\
+do {						\
+  _FPU_GETCW (_fcw);				\
+} while (0)
+
+#define FP_HANDLE_EXCEPTIONS			\
+do {						\
+  if (__builtin_expect (_fex, 0))		\
+    _FPU_SETCW (_fcw | _fex | (_fex << 10));	\
+} while (0)
+#else
+#define FP_INIT_ROUNDMODE	_fcw = FP_RND_NEAREST
+#endif

Modified: fsf/trunk/ports/sysdeps/powerpc/nofpu/feholdexcpt.c
==============================================================================
--- fsf/trunk/ports/sysdeps/powerpc/nofpu/feholdexcpt.c (original)
+++ fsf/trunk/ports/sysdeps/powerpc/nofpu/feholdexcpt.c Thu May 24 00:03:40 2007
@@ -1,6 +1,6 @@
 /* Store current floating-point environment and clear exceptions
    (soft-float edition).
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2007 Free Software Foundation, Inc.
    Contributed by Aldy Hernandez <aldyh@xxxxxxxxxx>, 2002.
    This file is part of the GNU C Library.
 
@@ -33,11 +33,12 @@
   u.fenv = *envp;
   /* Clear everything except the rounding mode.  */
   u.l[0] &= 0x3;
-
-  /* ?? Should we clear the disabled exceptions as well ?? */
+  /* Disable exceptions */
+  u.l[1] = FE_ALL_EXCEPT;
 
   /* Put the new state in effect.  */
-  fesetenv (envp);
+  fesetenv (&u.fenv);
 
   return 0;
 }
+libm_hidden_def (feholdexcept)

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S Thu May 24 00:03:40 2007
@@ -29,24 +29,49 @@
 
    Start the unwind tables at least one instruction before the signal
    trampoline, because the unwinder will assume we are returning after
-   a call site.  */
+   a call site.
 
+   Because the signal frame layout changed in 2.6.18, we provide two
+   copies of these functions with different unwind information.  */
+
+#ifndef __ASSUME_SIGFRAME_V2
 	.fnstart
 	.save {r0-r15}
 	.pad #12
 	nop
-ENTRY(__default_sa_restorer)
+ENTRY(__default_sa_restorer_v1)
+	mov	r7, $SYS_ify(sigreturn)
+	swi	0x0
+	.fnend
+#endif
+
+	.fnstart
+	.save {r0-r15}
+	.pad #32
+	nop
+ENTRY(__default_sa_restorer_v2)
 	mov	r7, $SYS_ify(sigreturn)
 	swi	0x0
 	.fnend
 
 #ifdef __NR_rt_sigreturn
 
+#ifndef __ASSUME_SIGFRAME_V2
 	.fnstart
 	.save {r0-r15}
 	.pad #168
 	nop
-ENTRY(__default_rt_sa_restorer)
+ENTRY(__default_rt_sa_restorer_v1)
+	mov	r7, $SYS_ify(rt_sigreturn)
+	swi	0x0
+	.fnend
+#endif
+
+	.fnstart
+	.save {r0-r15}
+	.pad #160
+	nop
+ENTRY(__default_rt_sa_restorer_v2)
 	mov	r7, $SYS_ify(rt_sigreturn)
 	swi	0x0
 	.fnend

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h Thu May 24 00:03:40 2007
@@ -46,4 +46,9 @@
 # define __ASSUME_VFORK_SYSCALL		1
 #endif
 
+/* The signal frame layout changed in 2.6.18.  */
+#if __LINUX_KERNEL_VERSION >= 132626
+# define __ASSUME_SIGFRAME_V2	1
+#endif
+
 #include_next <kernel-features.h>

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/Versions
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/Versions (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/Versions Thu May 24 00:03:40 2007
@@ -2,5 +2,7 @@
   GLIBC_PRIVATE {
     # A copy of sigaction lives in NPTL, and needs these.
     __default_sa_restorer; __default_rt_sa_restorer;
+    __default_sa_restorer_v1; __default_rt_sa_restorer_v1;
+    __default_sa_restorer_v2; __default_rt_sa_restorer_v2;
   }
 }

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/sigaction.c
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/sigaction.c (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/sigaction.c Thu May 24 00:03:40 2007
@@ -36,8 +36,27 @@
 
 #define SA_RESTORER	0x04000000
 
+#ifdef __ARM_EABI__
+extern void __default_sa_restorer_v1(void);
+extern void __default_sa_restorer_v2(void);
+extern void __default_rt_sa_restorer_v1(void);
+extern void __default_rt_sa_restorer_v2(void);
+# ifdef __ASSUME_SIGFRAME_V2
+#  define __default_sa_restorer __default_sa_restorer_v2
+#  define __default_rt_sa_restorer __default_rt_sa_restorer_v2
+# else
+#  include <ldsodefs.h>
+#  define __default_sa_restorer (GLRO(dl_osversion) >= 0x020612	\
+				 ? __default_sa_restorer_v2	\
+				 : __default_sa_restorer_v1)
+#  define __default_rt_sa_restorer (GLRO(dl_osversion) >= 0x020612	\
+				    ? __default_rt_sa_restorer_v2	\
+				    : __default_rt_sa_restorer_v1)
+# endif
+#else
 extern void __default_sa_restorer(void);
 extern void __default_rt_sa_restorer(void);
+#endif
 
 /* When RT signals are in use we need to use a different return stub.  */
 #ifdef __NR_rt_sigreturn

Added: fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c (added)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise.c Thu May 24 00:03:40 2007
@@ -1,0 +1,42 @@
+/* Copyright (C) 2007 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
+   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
+   Lesser General Public License for more details.
+
+   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.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sysdep.h>
+
+/* Advice the system about the expected behaviour of the application with
+   respect to the file associated with FD.  */
+
+int
+posix_fadvise (int fd, off_t offset, off_t len, int advise)
+{
+/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */
+#ifdef __NR_fadvise64
+  INTERNAL_SYSCALL_DECL (err);
+  int ret = INTERNAL_SYSCALL (fadvise64, err, 7, fd, 0,
+			      __LONG_LONG_PAIR (offset >> 31, offset),
+			      __LONG_LONG_PAIR (offset >> 31, len),
+			      advise);
+  if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+    return INTERNAL_SYSCALL_ERRNO (ret, err);
+  return 0;
+#else
+  return ENOSYS;
+#endif
+}

Added: fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c (added)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/posix_fadvise64.c Thu May 24 00:03:40 2007
@@ -1,0 +1,61 @@
+/* Copyright (C) 2007 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
+   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
+   Lesser General Public License for more details.
+
+   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.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sysdep.h>
+
+/* Advice the system about the expected behaviour of the application with
+   respect to the file associated with FD.  */
+
+int
+__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise)
+{
+/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */
+#ifdef __NR_fadvise64
+  INTERNAL_SYSCALL_DECL (err);
+  int ret = INTERNAL_SYSCALL (fadvise64, err, 7, fd, 0,
+			      __LONG_LONG_PAIR ((long) (offset >> 32),
+						(long) offset),
+			      __LONG_LONG_PAIR ((long) (len >> 32),
+						(long) len),
+			      advise);
+  if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+    return INTERNAL_SYSCALL_ERRNO (ret, err);
+  return 0;
+#else
+  return ENOSYS;
+#endif
+}
+
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
+
+int
+attribute_compat_text_section
+__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise)
+{
+  return __posix_fadvise64_l64 (fd, offset, len, advise);
+}
+
+versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
+compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
+#else
+strong_alias (__posix_fadvise64_l64, posix_fadvise64);
+#endif

Added: fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/readahead.c
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/readahead.c (added)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/readahead.c Thu May 24 00:03:40 2007
@@ -1,0 +1,1 @@
+#include <sysdeps/unix/sysv/linux/arm/eabi/readahead.c>

Added: fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c (added)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c Thu May 24 00:03:40 2007
@@ -1,0 +1,47 @@
+/* Selective file content synch'ing.
+   Copyright (C) 2006, 2007 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
+   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
+   Lesser General Public License for more details.
+
+   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.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+
+#ifdef __NR_sync_file_range
+int
+sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+{
+  return INLINE_SYSCALL (sync_file_range, 7, fd, 0,
+			 __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+			 __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+			 flags);
+}
+#else
+int
+sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+stub_warning (sync_file_range)
+
+# include <stub-tag.h>
+#endif

Added: fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c (added)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise64.c Thu May 24 00:03:40 2007
@@ -1,0 +1,56 @@
+/* Copyright (C) 2007 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
+   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
+   Lesser General Public License for more details.
+
+   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.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sysdep.h>
+
+/* Advice the system about the expected behaviour of the application with
+   respect to the file associated with FD.  */
+
+int
+__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise)
+{
+/* MIPS kernel only has NR_fadvise64 which acts as NR_fadvise64_64 */
+#ifdef __NR_fadvise64
+  INTERNAL_SYSCALL_DECL (err);
+  int ret = INTERNAL_SYSCALL (fadvise64, err, 4, fd, offset, len, advise);
+  if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+    return INTERNAL_SYSCALL_ERRNO (ret, err);
+  return 0;
+#else
+  return ENOSYS;
+#endif
+}
+
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
+
+int
+attribute_compat_text_section
+__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise)
+{
+  return __posix_fadvise64_l64 (fd, offset, len, advise);
+}
+
+versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
+compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
+#else
+strong_alias (__posix_fadvise64_l64, posix_fadvise64);
+#endif

Added: fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list (added)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list Thu May 24 00:03:40 2007
@@ -1,0 +1,5 @@
+# File name	Caller	Syscall name	# args	Strong name	Weak names
+
+readahead	-	readahead	i:iii	__readahead	readahead
+sync_file_range	-	sync_file_range	i:iiii	sync_file_range
+posix_fadvise	-	fadvise64	i:iiii	posix_fadvise