This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.23-178-g071af47


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  071af4769fcdfe2cd349157b01f27c9571478ace (commit)
       via  77a4fbd53611720cd6ae845de560df5dd332b28e (commit)
       via  eeddfa91cbb1a619af135c7a9ac14251ec094b7a (commit)
       via  482b2f87a88d30fd5bc0277e6a3f75efeb1aff7f (commit)
      from  d29fb41f4431ca35ea360498ef9d37558ce90d76 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=071af4769fcdfe2cd349157b01f27c9571478ace

commit 071af4769fcdfe2cd349157b01f27c9571478ace
Author: Adhemerval Zanella <adhemerval.zanella@linaro.com>
Date:   Fri Oct 23 10:59:32 2015 -0200

    Consolidate pwrite/pwrite64 implementations
    
    This patch consolidates all the pwrite/pwrite64 implementation for Linux
    in only one (sysdeps/unix/sysv/linux/pwrite{64}.c).  It also removes the
    syscall from the auto-generation using assembly macros.
    
    For pwrite{64} offset argument placement the new SYSCALL_LL{64} macro
    is used.  For pwrite ports that do not define __NR_pwrite will use
    __NR_pwrite64 and for pwrite64 ports that dot define __NR_pwrite64 will
    use __NR_pwrite for the syscall.
    
    Checked on x86_64, x32, i386, aarch64, and ppc64le.
    
    	* sysdeps/unix/sysv/linux/arm/pwrite.c: Remove file.
    	* sysdeps/unix/sysv/linux/arm/pwrite64.c: Likewise.
    	* sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c: Likewise.
    	* sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c: Likewise.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c: Likewise.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c: Likewise.
    	* sysdeps/unix/sysv/linux/wordsize-64/pwrite64.c: Likewise.
    	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (prite): Remove
    	syscalls generation.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
    	[__NR_pwrite64] (__NR_write): Remove define.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
    	[__NR_pwrite64] (__NR_write): Remove define.
    	* sysdeps/unix/sysv/linux/pwrite.c [__NR_pwrite64] (__NR_pwrite):
    	Remove define.
    	(__libc_pwrite): Use SYSCALL_LL macro on offset argument.
    	* sysdeps/unix/sysv/linux/pwrite64.c [__NR_pwrite64] (__NR_pwrite):
    	Remove define.
    	(__libc_pwrite64): Use SYSCALL_LL64 macro on offset argument.
    	* sysdeps/unix/sysv/linux/sh/pwrite.c: Rewrite using default
    	Linux implementation as base.
    	* sysdeps/unix/sysv/linux/sh/pwrite64.c: Likewise.
    	* sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise.
    	* sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise.

diff --git a/ChangeLog b/ChangeLog
index 090bd74..ac90d09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,30 @@
 2016-04-11  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+	* sysdeps/unix/sysv/linux/arm/pwrite.c: Remove file.
+	* sysdeps/unix/sysv/linux/arm/pwrite64.c: Likewise.
+	* sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c: Likewise.
+	* sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c: Likewise.
+	* sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise.
+	* sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c: Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c: Likewise.
+	* sysdeps/unix/sysv/linux/wordsize-64/pwrite64.c: Likewise.
+	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (prite): Remove
+	syscalls generation.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
+	[__NR_pwrite64] (__NR_write): Remove define.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
+	[__NR_pwrite64] (__NR_write): Remove define.
+	* sysdeps/unix/sysv/linux/pwrite.c [__NR_pwrite64] (__NR_pwrite):
+	Remove define.
+	(__libc_pwrite): Use SYSCALL_LL macro on offset argument.
+	* sysdeps/unix/sysv/linux/pwrite64.c [__NR_pwrite64] (__NR_pwrite):
+	Remove define.
+	(__libc_pwrite64): Use SYSCALL_LL64 macro on offset argument.
+	* sysdeps/unix/sysv/linux/sh/pwrite.c: Rewrite using default
+	Linux implementation as base.
+	* sysdeps/unix/sysv/linux/sh/pwrite64.c: Likewise.
+
 	* sysdeps/unix/sysv/linux/arm/pread.c: Remove file.
 	* sysdeps/unix/sysv/linux/arm/pread64.c: Likewise.
 	* sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c: Likewise.
diff --git a/sysdeps/unix/sysv/linux/arm/pwrite.c b/sysdeps/unix/sysv/linux/arm/pwrite.c
deleted file mode 100644
index d4132f1..0000000
--- a/sysdeps/unix/sysv/linux/arm/pwrite.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
-{
-  /* In the ARM EABI, 64-bit values are aligned to even/odd register
-     pairs for syscalls.  */
-  return SYSCALL_CANCEL (pwrite64, fd, buf, count, 0,
-			 __LONG_LONG_PAIR (offset >> 31, offset));
-}
-
-strong_alias (__libc_pwrite, __pwrite)
-weak_alias (__libc_pwrite, pwrite)
diff --git a/sysdeps/unix/sysv/linux/arm/pwrite64.c b/sysdeps/unix/sysv/linux/arm/pwrite64.c
deleted file mode 100644
index 1b70560..0000000
--- a/sysdeps/unix/sysv/linux/arm/pwrite64.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
-{
-  /* In the ARM EABI, 64-bit values are aligned to even/odd register
-     pairs for syscalls.  */
-  return SYSCALL_CANCEL (pwrite64, fd, buf, count, 0,
-			 __LONG_LONG_PAIR ((off_t) (offset >> 32),
-					   (off_t) (offset & 0xffffffff)));
-}
-
-weak_alias (__libc_pwrite64, __pwrite64)
-libc_hidden_weak (__pwrite64)
-weak_alias (__libc_pwrite64, pwrite64)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c
deleted file mode 100644
index f9f1e0d..0000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
-   Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <assert.h>
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
-{
-  assert (sizeof (offset) == 4);
-  return SYSCALL_CANCEL (pwrite64, fd, buf, count, __ALIGNMENT_ARG
-                         __LONG_LONG_PAIR (offset >> 31, offset));
-}
-strong_alias (__libc_pwrite, __pwrite)
-weak_alias (__libc_pwrite, pwrite)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c
deleted file mode 100644
index 53aaa47..0000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
-   Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
-{
-  return SYSCALL_CANCEL (pwrite64, fd, buf, count, __ALIGNMENT_ARG
-                         __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                           (off_t) (offset & 0xffffffff)));
-}
-weak_alias (__libc_pwrite64, __pwrite64)
-libc_hidden_weak (__pwrite64) weak_alias (__libc_pwrite64, pwrite64)
diff --git a/sysdeps/unix/sysv/linux/mips/pwrite.c b/sysdeps/unix/sysv/linux/mips/pwrite.c
deleted file mode 100644
index 31dea3a..0000000
--- a/sysdeps/unix/sysv/linux/mips/pwrite.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <assert.h>
-#include <errno.h>
-#ifndef NO_SGIDEFS_H
-#include <sgidefs.h>
-#endif
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pwrite64            /* Newer kernels renamed but it's the same.  */
-# ifdef __NR_pwrite
-#  error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
-
-
-ssize_t
-__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
-{
-#if _MIPS_SIM != _ABI64
-  assert (sizeof (offset) == 4);
-#endif
-
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-  return SYSCALL_CANCEL (pwrite, fd, buf, count, offset);
-#else
-  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
-			 __LONG_LONG_PAIR (offset >> 31, offset));
-#endif
-}
-
-strong_alias (__libc_pwrite, __pwrite)
-weak_alias (__libc_pwrite, pwrite)
diff --git a/sysdeps/unix/sysv/linux/mips/pwrite64.c b/sysdeps/unix/sysv/linux/mips/pwrite64.c
deleted file mode 100644
index 1905c57..0000000
--- a/sysdeps/unix/sysv/linux/mips/pwrite64.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ralf Baechle <ralf@gnu.org>, 1998.
-
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#ifndef NO_SGIDEFS_H
-#include <sgidefs.h>
-#endif
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pwrite64            /* Newer kernels renamed but it's the same.  */
-# ifdef __NR_pwrite
-#  error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
-
-
-ssize_t
-__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
-{
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-  return SYSCALL_CANCEL (pwrite, fd, buf, count, offset);
-#else
-  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
-			 __LONG_LONG_PAIR ((off_t) (offset >> 32),
-					   (off_t) (offset & 0xffffffff)));
-#endif
-}
-
-weak_alias (__libc_pwrite64, __pwrite64)
-libc_hidden_weak (__pwrite64)
-weak_alias (__libc_pwrite64, pwrite64)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
deleted file mode 100644
index 4001b47..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <assert.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-
-ssize_t
-__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
-{
-  /* On PPC32 64bit values are aligned in odd/even register pairs.  */
-  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0, offset >> 31, offset);
-}
-
-strong_alias (__libc_pwrite, __pwrite)
-weak_alias (__libc_pwrite, pwrite)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
deleted file mode 100644
index 8a513fa..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-
-ssize_t
-__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
-{
-  /* On PPC32 64bit values are aligned in odd/even register pairs.  */
-  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0, (long) (offset >> 32),
-			 (long) offset);
-}
-
-weak_alias (__libc_pwrite64, __pwrite64)
-libc_hidden_weak (__pwrite64)
-weak_alias (__libc_pwrite64, pwrite64)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
index 0dc18da..273d78b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
@@ -22,17 +22,6 @@
 #include <sysdeps/unix/powerpc/sysdep.h>
 #include <tls.h>
 
-/* Some systen calls got renamed over time, but retained the same semantics.
-   Handle them here so they can be catched by both C and assembler stubs in
-   glibc.  */
-
-#ifdef __NR_pwrite64
-# ifdef __NR_pwrite
-#  error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
-
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
index 6e27223..0b034cd 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
@@ -29,17 +29,6 @@
 #include <errno.h>
 #endif
 
-/* Some systen calls got renamed over time, but retained the same semantics.
-   Handle them here so they can be catched by both C and assembler stubs in
-   glibc.  */
-
-#ifdef __NR_pwrite64
-# ifdef __NR_pwrite
-#  error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
-
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax
diff --git a/sysdeps/unix/sysv/linux/pwrite.c b/sysdeps/unix/sysv/linux/pwrite.c
index d02862a..ca3014f 100644
--- a/sysdeps/unix/sysv/linux/pwrite.c
+++ b/sysdeps/unix/sysv/linux/pwrite.c
@@ -16,33 +16,22 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <assert.h>
-#include <errno.h>
-#include <endian.h>
 #include <unistd.h>
-
 #include <sysdep-cancel.h>
-#include <sys/syscall.h>
 
-#ifdef __NR_pwrite64		/* Newer kernels renamed but it's the same.  */
-# ifdef __NR_pwrite
-#  error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
+#if __WORDSIZE != 64 || defined (__ASSUME_OFF_DIFF_OFF64)
 
+# ifndef __NR_pwrite
+#  define __NR_pwrite __NR_pwrite64
+# endif
 
 ssize_t
 __libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
 {
-  ssize_t result;
-
-  assert (sizeof (offset) == 4);
-  result = SYSCALL_CANCEL (pwrite, fd, buf, count,
-			   __LONG_LONG_PAIR (offset >> 31, offset));
-
-  return result;
+  return SYSCALL_CANCEL (pwrite, fd, buf, count,
+			 __ALIGNMENT_ARG SYSCALL_LL (offset));
 }
 
 strong_alias (__libc_pwrite, __pwrite)
 weak_alias (__libc_pwrite, pwrite)
+#endif
diff --git a/sysdeps/unix/sysv/linux/pwrite64.c b/sysdeps/unix/sysv/linux/pwrite64.c
index d28e9b9..5a37701 100644
--- a/sysdeps/unix/sysv/linux/pwrite64.c
+++ b/sysdeps/unix/sysv/linux/pwrite64.c
@@ -16,28 +16,25 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <endian.h>
 #include <unistd.h>
-
 #include <sysdep-cancel.h>
-#include <sys/syscall.h>
 
-#ifdef __NR_pwrite64		/* Newer kernels renamed but it's the same.  */
-# ifdef __NR_pwrite
-#  error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
+#ifndef __NR_pwrite64
+# define __NR_pwrite64 __NR_pwrite
 #endif
 
-
 ssize_t
 __libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
 {
-  return SYSCALL_CANCEL (pwrite, fd, buf, count,
-			 __LONG_LONG_PAIR ((off_t) (offset >> 32),
-					   (off_t) (offset & 0xffffffff)));
+  return SYSCALL_CANCEL (pwrite64, fd, buf, count,
+			 __ALIGNMENT_ARG SYSCALL_LL64 (offset));
 }
 weak_alias (__libc_pwrite64, __pwrite64)
 libc_hidden_weak (__pwrite64)
 weak_alias (__libc_pwrite64, pwrite64)
+
+#if __WORDSIZE == 64 && !defined (__ASSUME_OFF_DIFF_OFF64)
+strong_alias (__libc_pwrite64, __libc_pwrite)
+weak_alias (__libc_pwrite64, __pwrite)
+weak_alias (__libc_pwrite64, pwrite)
+#endif
diff --git a/sysdeps/unix/sysv/linux/sh/pwrite.c b/sysdeps/unix/sysv/linux/sh/pwrite.c
index c27d356..391ed5e 100644
--- a/sysdeps/unix/sysv/linux/sh/pwrite.c
+++ b/sysdeps/unix/sysv/linux/sh/pwrite.c
@@ -16,28 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <assert.h>
-#include <errno.h>
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pwrite64            /* Newer kernels renamed but it's the same.  */
-# ifdef __NR_pwrite
-#  error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
-
-
-ssize_t
-__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
-{
-  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
-			 __LONG_LONG_PAIR (offset >> 31, offset));
-}
-
-strong_alias (__libc_pwrite, __pwrite)
-weak_alias (__libc_pwrite, pwrite)
+/* SH4 ABI does not really require argument alignment for 64-bits, but
+   the kernel interface for pwrite adds a dummy long argument before the
+   offset.  */
+#define __ALIGNMENT_ARG
+#include <sysdeps/unix/sysv/linux/pwrite.c>
diff --git a/sysdeps/unix/sysv/linux/sh/pwrite64.c b/sysdeps/unix/sysv/linux/sh/pwrite64.c
index 7948cef..683a5d9 100644
--- a/sysdeps/unix/sysv/linux/sh/pwrite64.c
+++ b/sysdeps/unix/sysv/linux/sh/pwrite64.c
@@ -16,29 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pwrite64            /* Newer kernels renamed but it's the same.  */
-# ifdef __NR_pwrite
-#  error "__NR_pwrite and __NR_pwrite64 both defined???"
-# endif
-# define __NR_pwrite __NR_pwrite64
-#endif
-
-
-ssize_t
-__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
-{
-  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
-			 __LONG_LONG_PAIR ((off_t) (offset >> 32),
-					   (off_t) (offset & 0xffffffff)));
-}
-
-weak_alias (__libc_pwrite64, __pwrite64)
-libc_hidden_weak (__pwrite64)
-weak_alias (__libc_pwrite64, pwrite64)
+/* SH4 ABI does not really require argument alignment for 64-bits, but
+   the kernel interface for pread adds a dummy long argument before the
+   offset.  */
+#define __ALIGNMENT_ARG
+#include <sysdeps/unix/sysv/linux/pwrite64.c>
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/pwrite64.c b/sysdeps/unix/sysv/linux/wordsize-64/pwrite64.c
deleted file mode 100644
index b7f298d..0000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/pwrite64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty since the pread syscall is equivalent.  */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
index 7d5f6a5..2eb9419 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
@@ -3,7 +3,6 @@
 # Whee! 64-bit systems naturally implement llseek.
 llseek		EXTRA	lseek		i:iii	__libc_lseek	__lseek lseek __libc_lseek64 __llseek llseek __lseek64 lseek64
 lseek		llseek	-
-pwrite		-	pwrite		Ci:ibni	__libc_pwrite	__libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64
 fstatfs		-	fstatfs		i:ip	__fstatfs	fstatfs fstatfs64 __fstatfs64
 statfs		-	statfs		i:sp	__statfs	statfs statfs64
 mmap		-	mmap		b:aniiii __mmap		mmap __mmap64 mmap64

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=77a4fbd53611720cd6ae845de560df5dd332b28e

commit 77a4fbd53611720cd6ae845de560df5dd332b28e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.com>
Date:   Wed Oct 21 10:03:31 2015 -0200

    Consolidate pread/pread64 implementations
    
    This patch consolidates all the pread/pread64 implementation for Linux
    in only one (sysdeps/unix/sysv/linux/pread.c).  It also removes the
    syscall from the auto-generation using assembly macros.
    
    For pread{64} offset argument placement the new SYSCALL_LL{64} macro
    is used.  For pread ports that do not define __NR_pread will use
    __NR_pread64 and for pread64 ports that dot define __NR_pread64 will
    use __NR_pread for the syscall.
    
    Checked on x86_64, x32, i386, aarch64, and ppc64le.
    
    	* sysdeps/unix/sysv/linux/arm/pread.c: Remove file.
    	* sysdeps/unix/sysv/linux/arm/pread64.c: Likewise.
    	* sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c: Likewise.
    	* sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c: Likewise.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c: Likewise,
    	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c: Likewise.
    	* sysdeps/unix/sysv/linux/wordsize-64/pread64.c: Likewise.
    	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (pread): Remove
    	syscall generation.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
    	[__NR_pread64] (__NR_pread): Remove define.
    	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h:
    	[__NR_pread64] (__NR_pread): Likewise.
    	* sysdeps/unix/sysv/linux/pread.c [__NR_pread64] (__NR_pread): Remove
    	define.
    	(__libc_pread): Use SYSCALL_LL macro on offset argument.
    	* sysdeps/unix/sysv/linux/pread64.c [__NR_pread64] (__NR_pread):
    	Remove define.
    	(__libc_pread64): Use SYSCALL_LL64 macro on offset argument.
    	* sysdeps/unix/sysv/linux/sh/pread.c: Rewrite using default
    	Linux implementation as base.
    	* sysdeps/unix/sysv/linux/sh/pread64.c: Likewise.
    	* sysdeps/unix/sysv/linux/mips/pread.c: Likewise.
    	* sysdeps/unix/sysv/linux/mips/pread64.c: Likewise.

diff --git a/ChangeLog b/ChangeLog
index ca24f1c..090bd74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,30 @@
 2016-04-11  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+	* sysdeps/unix/sysv/linux/arm/pread.c: Remove file.
+	* sysdeps/unix/sysv/linux/arm/pread64.c: Likewise.
+	* sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c: Likewise.
+	* sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c: Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c: Likewise,
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c: Likewise.
+	* sysdeps/unix/sysv/linux/wordsize-64/pread64.c: Likewise.
+	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (pread): Remove
+	syscall generation.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
+	[__NR_pread64] (__NR_pread): Remove define.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h:
+	[__NR_pread64] (__NR_pread): Likewise.
+	* sysdeps/unix/sysv/linux/pread.c [__NR_pread64] (__NR_pread): Remove
+	define.
+	(__libc_pread): Use SYSCALL_LL macro on offset argument.
+	* sysdeps/unix/sysv/linux/pread64.c [__NR_pread64] (__NR_pread):
+	Remove define.
+	(__libc_pread64): Use SYSCALL_LL64 macro on offset argument.
+	* sysdeps/unix/sysv/linux/sh/pread.c: Rewrite using default
+	Linux implementation as base.
+	* sysdeps/unix/sysv/linux/sh/pread64.c: Likewise.
+	* sysdeps/unix/sysv/linux/mips/pread.c: Likewise.
+	* sysdeps/unix/sysv/linux/mips/pread64.c: Likewise.
+
 	* sysdeps/unix/sysv/linux/generic/sysdep.h (__ALIGNMENT_ARG): Move
 	definition.
 	(__ALIGNMENT_COUNT): Likewise.
diff --git a/sysdeps/unix/sysv/linux/arm/pread.c b/sysdeps/unix/sysv/linux/arm/pread.c
deleted file mode 100644
index 8c9b878..0000000
--- a/sysdeps/unix/sysv/linux/arm/pread.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pread (int fd, void *buf, size_t count, off_t offset)
-{
-  /* In the ARM EABI, 64-bit values are aligned to even/odd register
-     pairs for syscalls.  */
-  return SYSCALL_CANCEL (pread64, fd, buf, count, 0,
-			 __LONG_LONG_PAIR (offset >> 31, offset));
-}
-
-strong_alias (__libc_pread, __pread)
-weak_alias (__libc_pread, pread)
diff --git a/sysdeps/unix/sysv/linux/arm/pread64.c b/sysdeps/unix/sysv/linux/arm/pread64.c
deleted file mode 100644
index 3364b6a..0000000
--- a/sysdeps/unix/sysv/linux/arm/pread64.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
-{
-  /* In the ARM EABI, 64-bit values are aligned to even/odd register
-     pairs for syscalls.  */
-  return SYSCALL_CANCEL (pread64, fd, buf, count, 0,
-			 __LONG_LONG_PAIR ((off_t) (offset >> 32),
-					   (off_t) (offset & 0xffffffff)));
-}
-
-weak_alias (__libc_pread64, __pread64)
-weak_alias (__libc_pread64, pread64)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c
deleted file mode 100644
index 0dff648..0000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
-   Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <assert.h>
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pread (int fd, void *buf, size_t count, off_t offset)
-{
-  assert (sizeof (offset) == 4);
-  return SYSCALL_CANCEL (pread64, fd,
-                         buf, count, __ALIGNMENT_ARG
-                         __LONG_LONG_PAIR (offset >> 31, offset));
-}
-strong_alias (__libc_pread, __pread)
-weak_alias (__libc_pread, pread)
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c
deleted file mode 100644
index 8931900..0000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
-   Based on work contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <endian.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
-{
-  return SYSCALL_CANCEL (pread64, fd, buf, count, __ALIGNMENT_ARG
-                         __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                           (off_t) (offset & 0xffffffff)));
-}
-weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, pread64)
diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h
index 1fc8959..e831645 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h
@@ -39,4 +39,5 @@
    pass 64-bits values through syscalls.  */
 #if _MIPS_SIM == _ABIN32
 # define __ASSUME_WORDSIZE64_ILP32	1
+# define __ASSUME_OFF_DIFF_OFF64        1
 #endif
diff --git a/sysdeps/unix/sysv/linux/mips/pread.c b/sysdeps/unix/sysv/linux/mips/pread.c
deleted file mode 100644
index 02755cb..0000000
--- a/sysdeps/unix/sysv/linux/mips/pread.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <assert.h>
-#include <errno.h>
-#ifndef NO_SGIDEFS_H
-#include <sgidefs.h>
-#endif
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pread64             /* Newer kernels renamed but it's the same.  */
-# ifdef __NR_pread
-#  error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
-
-
-ssize_t
-__libc_pread (int fd, void *buf, size_t count, off_t offset)
-{
-#if _MIPS_SIM != _ABI64
-  assert (sizeof (offset) == 4);
-#endif
-
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-  return SYSCALL_CANCEL (pread, fd, buf, count, offset);
-#else
-  return SYSCALL_CANCEL (pread, fd, buf, count, 0,
-			 __LONG_LONG_PAIR (offset >> 31, offset));
-#endif
-}
-
-strong_alias (__libc_pread, __pread)
-weak_alias (__libc_pread, pread)
diff --git a/sysdeps/unix/sysv/linux/mips/pread64.c b/sysdeps/unix/sysv/linux/mips/pread64.c
deleted file mode 100644
index ed0e91c..0000000
--- a/sysdeps/unix/sysv/linux/mips/pread64.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#ifndef NO_SGIDEFS_H
-#include <sgidefs.h>
-#endif
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pread64             /* Newer kernels renamed but it's the same.  */
-# ifdef __NR_pread
-#  error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
-
-
-ssize_t
-__libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
-{
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-  return SYSCALL_CANCEL (pread, fd, buf, count, offset);
-#else
-  return SYSCALL_CANCEL (pread, fd, buf, count, 0,
-			 __LONG_LONG_PAIR ((off_t) (offset >> 32),
-					   (off_t) (offset & 0xffffffff)));
-#endif
-}
-
-weak_alias (__libc_pread64, __pread64)
-weak_alias (__libc_pread64, pread64)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
deleted file mode 100644
index 2d67013..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <assert.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-ssize_t
-__libc_pread (int fd, void *buf, size_t count, off_t offset)
-{
-  /* On PPC32 64bit values are aligned in odd/even register pairs.  */
-  return SYSCALL_CANCEL (pread, fd, buf, count, 0, offset >> 31, offset);
-}
-
-strong_alias (__libc_pread, __pread)
-weak_alias (__libc_pread, pread)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
deleted file mode 100644
index 712ab72..0000000
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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
-   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, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <unistd.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-
-ssize_t
-__libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
-{
-  /* On PPC32 64bit values are aligned in odd/even register pairs.  */
-  return SYSCALL_CANCEL (pread, fd, buf, count, 0, (long) (offset >> 32),
-			 (long) offset);
-}
-
-weak_alias (__libc_pread64, __pread64)
-weak_alias (__libc_pread64, pread64)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
index 6d8990c..0dc18da 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
@@ -26,13 +26,6 @@
    Handle them here so they can be catched by both C and assembler stubs in
    glibc.  */
 
-#ifdef __NR_pread64
-# ifdef __NR_pread
-#  error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
-
 #ifdef __NR_pwrite64
 # ifdef __NR_pwrite
 #  error "__NR_pwrite and __NR_pwrite64 both defined???"
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
index 91fd096..6e27223 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
@@ -33,13 +33,6 @@
    Handle them here so they can be catched by both C and assembler stubs in
    glibc.  */
 
-#ifdef __NR_pread64
-# ifdef __NR_pread
-#  error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
-
 #ifdef __NR_pwrite64
 # ifdef __NR_pwrite
 #  error "__NR_pwrite and __NR_pwrite64 both defined???"
diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c
index 4aa3c67..5663092 100644
--- a/sysdeps/unix/sysv/linux/pread.c
+++ b/sysdeps/unix/sysv/linux/pread.c
@@ -16,33 +16,22 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <assert.h>
-#include <errno.h>
-#include <endian.h>
 #include <unistd.h>
-
 #include <sysdep-cancel.h>
-#include <sys/syscall.h>
 
-#ifdef __NR_pread64		/* Newer kernels renamed but it's the same.  */
-# ifdef __NR_pread
-#  error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
+#if __WORDSIZE != 64 || defined (__ASSUME_OFF_DIFF_OFF64)
 
+# ifndef __NR_pread
+#  define __NR_pread __NR_pread64
+# endif
 
 ssize_t
 __libc_pread (int fd, void *buf, size_t count, off_t offset)
 {
-  ssize_t result;
-
-  assert (sizeof (offset) == 4);
-  result = SYSCALL_CANCEL (pread, fd, buf, count,
-			   __LONG_LONG_PAIR (offset >> 31, offset));
-
-  return result;
+  return SYSCALL_CANCEL (pread, fd, buf, count,
+			 __ALIGNMENT_ARG SYSCALL_LL (offset));
 }
 
 strong_alias (__libc_pread, __pread)
 weak_alias (__libc_pread, pread)
+#endif
diff --git a/sysdeps/unix/sysv/linux/pread64.c b/sysdeps/unix/sysv/linux/pread64.c
index 7b5019a..c599f76 100644
--- a/sysdeps/unix/sysv/linux/pread64.c
+++ b/sysdeps/unix/sysv/linux/pread64.c
@@ -16,28 +16,25 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <endian.h>
 #include <unistd.h>
-
 #include <sysdep-cancel.h>
-#include <sys/syscall.h>
 
-#ifdef __NR_pread64		/* Newer kernels renamed but it's the same.  */
-# ifdef __NR_pread
-#  error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
+#ifndef __NR_pread64
+# define __NR_pread64 __NR_pread
 #endif
 
-
 ssize_t
 __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
 {
-  return SYSCALL_CANCEL (pread, fd, buf, count,
-			 __LONG_LONG_PAIR ((off_t) (offset >> 32),
-					   (off_t) (offset & 0xffffffff)));
+  return SYSCALL_CANCEL (pread64, fd, buf, count,
+			 __ALIGNMENT_ARG SYSCALL_LL64 (offset));
 }
 
 weak_alias (__libc_pread64, __pread64)
 weak_alias (__libc_pread64, pread64)
+
+#if __WORDSIZE == 64 && !defined (__ASSUME_OFF_DIFF_OFF64)
+strong_alias (__libc_pread64, __libc_pread)
+weak_alias (__libc_pread64, __pread)
+weak_alias (__libc_pread64, pread)
+#endif
diff --git a/sysdeps/unix/sysv/linux/sh/pread.c b/sysdeps/unix/sysv/linux/sh/pread.c
index 8afada5..d3f99f3 100644
--- a/sysdeps/unix/sysv/linux/sh/pread.c
+++ b/sysdeps/unix/sysv/linux/sh/pread.c
@@ -16,28 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <assert.h>
-#include <errno.h>
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pread64             /* Newer kernels renamed but it's the same.  */
-# ifdef __NR_pread
-#  error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
-
-
-ssize_t
-__libc_pread (int fd, void *buf, size_t count, off_t offset)
-{
-  return SYSCALL_CANCEL (pread, fd, buf, count, 0,
-			 __LONG_LONG_PAIR (offset >> 31, offset));
-}
-
-strong_alias (__libc_pread, __pread)
-weak_alias (__libc_pread, pread)
+/* SH4 ABI does not really require argument alignment for 64-bits, but
+   the kernel interface for pread adds a dummy long argument before the
+   offset.  */
+#define __ALIGNMENT_ARG
+#include <sysdeps/unix/sysv/linux/pread.c>
diff --git a/sysdeps/unix/sysv/linux/sh/pread64.c b/sysdeps/unix/sysv/linux/sh/pread64.c
index cfc751d..b2e8a25 100644
--- a/sysdeps/unix/sysv/linux/sh/pread64.c
+++ b/sysdeps/unix/sysv/linux/sh/pread64.c
@@ -16,28 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <unistd.h>
-#include <endian.h>
-
-#include <sysdep-cancel.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_pread64             /* Newer kernels renamed but it's the same.  */
-# ifdef __NR_pread
-#  error "__NR_pread and __NR_pread64 both defined???"
-# endif
-# define __NR_pread __NR_pread64
-#endif
-
-
-ssize_t
-__libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
-{
-  return SYSCALL_CANCEL (pread, fd, buf, count, 0,
-			 __LONG_LONG_PAIR ((off_t) (offset >> 32),
-					   (off_t) (offset & 0xffffffff)));
-}
-
-weak_alias (__libc_pread64, __pread64)
-weak_alias (__libc_pread64, pread64)
+/* SH4 ABI does not really require argument alignment for 64-bits, but
+   the kernel interface for pread adds a dummy long argument before the
+   offset.  */
+#define __ALIGNMENT_ARG
+#include <sysdeps/unix/sysv/linux/pread64.c>
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/pread64.c b/sysdeps/unix/sysv/linux/wordsize-64/pread64.c
deleted file mode 100644
index b7f298d..0000000
--- a/sysdeps/unix/sysv/linux/wordsize-64/pread64.c
+++ /dev/null
@@ -1 +0,0 @@
-/* Empty since the pread syscall is equivalent.  */
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
index 19cc6d9..7d5f6a5 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list
@@ -3,7 +3,6 @@
 # Whee! 64-bit systems naturally implement llseek.
 llseek		EXTRA	lseek		i:iii	__libc_lseek	__lseek lseek __libc_lseek64 __llseek llseek __lseek64 lseek64
 lseek		llseek	-
-pread		-	pread		Ci:ibni	__libc_pread	__libc_pread64 __pread pread __pread64 pread64
 pwrite		-	pwrite		Ci:ibni	__libc_pwrite	__libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64
 fstatfs		-	fstatfs		i:ip	__fstatfs	fstatfs fstatfs64 __fstatfs64
 statfs		-	statfs		i:sp	__statfs	statfs statfs64

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=eeddfa91cbb1a619af135c7a9ac14251ec094b7a

commit eeddfa91cbb1a619af135c7a9ac14251ec094b7a
Author: Adhemerval Zanella <adhemerval.zanella@linaro.com>
Date:   Wed Oct 21 10:04:07 2015 -0200

    Consolidate off_t/off64_t syscall argument passing
    
    This patch add three new macros (SYSCALL_LL, SYSCALL_LL64, and
    __ASSUME_WORDSIZE64_ILP32) to use along with off_t and off64_t argument
    syscalls.  The rationale for this change is:
    
    1. Remove multiple implementations for the same syscall for different
       architectures (for instance, pread have 6 different implementations).
    
    2. Also remove the requirement to use syscall wrappers for cancellable
       entrypoints.
    
    The macro usage should be used along __ALIGNMENT_ARG to follow ABI constrains
    for architecture where it applies.  For instance, pread can be rewritten as:
    
      return SYSCALL_CANCEL (pread, fd, buf, count,
                             __ALIGNMENT_ARG SYSCALL_LL (offset));
    
    Another macro, SYSCALL_LL64, is provided for off64_t.  The macro
    __ASSUME_WORDSIZE64_ILP32 is used by the ABI to define is uses 64-bit register
    even if ABI is ILP32 (for instance x32 and mips64-n32).
    
    The changes itself are not currently used in any implementation, so no
    code change is expected.
    
    	* sysdeps/unix/sysv/linux/generic/sysdep.h (__ALIGNMENT_ARG): Move
    	definition.
    	(__ALIGNMENT_COUNT): Likewise.
    	* sysdeps/unix/sysv/linux/sysdep.h (__ALIGNMENT_ARG): To here.
    	(__ALIGNMENT_COUNT): Likewise.
    	(SYSCALL_LL): New define.
    	(SYSCALL_LL64): Likewise.
    	* sysdeps/unix/sysv/linux/mips/kernel-features.h:
    	[_MIPS_SIM == _ABIO32] (__ASSUME_WORDSIZE64_ILP32): Define.
    	* sysdeps/unix/sysv/linux/x86_64/kernel-features.h:
    	[ILP32] (__ASUME_WORDSIZE64_ILP32): Likewise.

diff --git a/ChangeLog b/ChangeLog
index c0ff307..ca24f1c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2016-04-11  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+	* sysdeps/unix/sysv/linux/generic/sysdep.h (__ALIGNMENT_ARG): Move
+	definition.
+	(__ALIGNMENT_COUNT): Likewise.
+	* sysdeps/unix/sysv/linux/sysdep.h (__ALIGNMENT_ARG): To here.
+	(__ALIGNMENT_COUNT): Likewise.
+	(SYSCALL_LL): New define.
+	(SYSCALL_LL64): Likewise.
+	* sysdeps/unix/sysv/linux/mips/kernel-features.h:
+	[_MIPS_SIM == _ABIO32] (__ASSUME_WORDSIZE64_ILP32): Define.
+	* sysdeps/unix/sysv/linux/x86_64/kernel-features.h:
+	[ILP32] (__ASUME_WORDSIZE64_ILP32): Likewise.
+
 	* sysdeps/unix/sysv/linux/arm/kernel-features.h
 	(__ASSUME_ALIGNED_REGISTER_PAIRS): Define.
 	* sysdeps/unix/sysv/linux/mips/kernel-features.h
diff --git a/sysdeps/unix/sysv/linux/generic/sysdep.h b/sysdeps/unix/sysv/linux/generic/sysdep.h
index 4f2c65d..b0422ff 100644
--- a/sysdeps/unix/sysv/linux/generic/sysdep.h
+++ b/sysdeps/unix/sysv/linux/generic/sysdep.h
@@ -31,13 +31,3 @@
 #define __NR_pread __NR_pread64
 #define __NR_pwrite __NR_pwrite64
 #endif
-
-/* Provide a dummy argument that can be used to force register
-   alignment for register pairs if required by the syscall ABI.  */
-#ifdef __ASSUME_ALIGNED_REGISTER_PAIRS
-#define __ALIGNMENT_ARG 0,
-#define __ALIGNMENT_COUNT(a,b) b
-#else
-#define __ALIGNMENT_ARG
-#define __ALIGNMENT_COUNT(a,b) a
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h
index ef4b520..1fc8959 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h
@@ -34,3 +34,9 @@
 #if _MIPS_SIM == _ABIO32
 # define __ASSUME_ALIGNED_REGISTER_PAIRS	1
 #endif
+
+/* Define that mips64-n32 is a ILP32 ABI to set the correct interface to
+   pass 64-bits values through syscalls.  */
+#if _MIPS_SIM == _ABIN32
+# define __ASSUME_WORDSIZE64_ILP32	1
+#endif
diff --git a/sysdeps/unix/sysv/linux/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h
index c98fc3a..4ac4c00 100644
--- a/sysdeps/unix/sysv/linux/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sysdep.h
@@ -15,6 +15,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <bits/wordsize.h>
+
 /* Set error number and return -1.  A target may choose to return the
    internal function, __syscall_error, which sets errno and returns -1.
    We use -1l, instead of -1, so that it can be casted to (void *).  */
@@ -23,3 +25,24 @@
     __set_errno (err);				\
     -1l;					\
   })
+
+/* Provide a dummy argument that can be used to force register
+   alignment for register pairs if required by the syscall ABI.  */
+#ifdef __ASSUME_ALIGNED_REGISTER_PAIRS
+#define __ALIGNMENT_ARG 0,
+#define __ALIGNMENT_COUNT(a,b) b
+#else
+#define __ALIGNMENT_ARG
+#define __ALIGNMENT_COUNT(a,b) a
+#endif
+
+/* Provide a common macro to pass 64-bit value on syscalls.  */
+#if __WORDSIZE == 64 || defined __ASSUME_WORDSIZE64_ILP32
+# define SYSCALL_LL(val)   (val)
+# define SYSCALL_LL64(val) (val)
+#else
+#define SYSCALL_LL(val)   \
+  __LONG_LONG_PAIR ((val) >> 31, (val))
+#define SYSCALL_LL64(val) \
+  __LONG_LONG_PAIR ((long) ((val) >> 32), (long) ((val) & 0xffffffff))
+#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/kernel-features.h b/sysdeps/unix/sysv/linux/x86_64/kernel-features.h
index 9491c3e..7bf75cf 100644
--- a/sysdeps/unix/sysv/linux/x86_64/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/x86_64/kernel-features.h
@@ -22,4 +22,10 @@
 # define __ASSUME_GETCPU_SYSCALL	1
 #endif
 
+/* Define that x32 is a ILP32 ABI to set the correct interface to pass
+   64-bits values through syscalls.  */
+#ifdef __ILP32__
+# define __ASSUME_WORDSIZE64_ILP32	1
+#endif
+
 #include_next <kernel-features.h>

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=482b2f87a88d30fd5bc0277e6a3f75efeb1aff7f

commit 482b2f87a88d30fd5bc0277e6a3f75efeb1aff7f
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Nov 17 18:19:06 2015 -0200

    Define __ASSUME_ALIGNED_REGISTER_PAIRS for missing ports
    
    This patch defines __ASSUME_ALIGNED_REGISTER_PAIRS for the missing
    ports that require 64-bit value (e.g., long long) to be aligned to
    an even register pair in argument passing.
    
    No code change is expected, tested with builds for powerpc32,
    mips-o32, and armhf.
    
    	* sysdeps/unix/sysv/linux/arm/kernel-features.h
    	(__ASSUME_ALIGNED_REGISTER_PAIRS): Define.
    	* sysdeps/unix/sysv/linux/mips/kernel-features.h
    	[_MIPS_SIM == _ABIO32] (__ASSUME_ALIGNED_REGISTER_PAIRS): Likewise.
    	* sysdeps/unix/sysv/linux/powerpc/kernel-features.h
    	[!__powerpc64__] (__ASSUME_ALIGNED_REGISTER_PAIRS): Likewise.

diff --git a/ChangeLog b/ChangeLog
index c8df2c2..c0ff307 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-04-11  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+	* sysdeps/unix/sysv/linux/arm/kernel-features.h
+	(__ASSUME_ALIGNED_REGISTER_PAIRS): Define.
+	* sysdeps/unix/sysv/linux/mips/kernel-features.h
+	[_MIPS_SIM == _ABIO32] (__ASSUME_ALIGNED_REGISTER_PAIRS): Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+	[!__powerpc64__] (__ASSUME_ALIGNED_REGISTER_PAIRS): Likewise.
+
 2016-04-11  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #19865]
diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
index c04c4e2..0a9ed77 100644
--- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -27,3 +27,7 @@
 # undef __ASSUME_REQUEUE_PI
 # undef __ASSUME_SET_ROBUST_LIST
 #endif
+
+/* Define this if your 32-bit syscall API requires 64-bit register
+   pairs to start with an even-number register.  */
+#define __ASSUME_ALIGNED_REGISTER_PAIRS	1
diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h
index 7f8c98a..ef4b520 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h
@@ -28,3 +28,9 @@
 # undef __ASSUME_REQUEUE_PI
 # undef __ASSUME_SET_ROBUST_LIST
 #endif
+
+/* Define this if your 32-bit syscall API requires 64-bit register
+   pairs to start with an even-number register.  */
+#if _MIPS_SIM == _ABIO32
+# define __ASSUME_ALIGNED_REGISTER_PAIRS	1
+#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
index 171c030..38bb0bc 100644
--- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
@@ -42,4 +42,10 @@
 /* The sendmmsg syscall was added for PowerPC in 3.0.  */
 #define __ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL	1
 
+/* Define this if your 32-bit syscall API requires 64-bit register
+   pairs to start with an even-number register.  */
+#ifndef __powerpc64__
+# define __ASSUME_ALIGNED_REGISTER_PAIRS	1
+#endif
+
 #include_next <kernel-features.h>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   71 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/arm/kernel-features.h      |    4 +
 sysdeps/unix/sysv/linux/arm/pread.c                |   36 ----------
 sysdeps/unix/sysv/linux/arm/pread64.c              |   37 ----------
 sysdeps/unix/sysv/linux/arm/pwrite.c               |   36 ----------
 sysdeps/unix/sysv/linux/arm/pwrite64.c             |   38 -----------
 sysdeps/unix/sysv/linux/generic/sysdep.h           |   10 ---
 .../unix/sysv/linux/generic/wordsize-32/pread.c    |   37 ----------
 .../unix/sysv/linux/generic/wordsize-32/pread64.c  |   34 ---------
 .../unix/sysv/linux/generic/wordsize-32/pwrite.c   |   36 ----------
 .../unix/sysv/linux/generic/wordsize-32/pwrite64.c |   35 ----------
 sysdeps/unix/sysv/linux/mips/kernel-features.h     |   13 ++++
 sysdeps/unix/sysv/linux/mips/pread.c               |   54 ---------------
 sysdeps/unix/sysv/linux/mips/pread64.c             |   50 --------------
 sysdeps/unix/sysv/linux/mips/pwrite.c              |   54 ---------------
 sysdeps/unix/sysv/linux/mips/pwrite64.c            |   51 --------------
 sysdeps/unix/sysv/linux/powerpc/kernel-features.h  |    6 ++
 sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c  |   34 ---------
 .../unix/sysv/linux/powerpc/powerpc32/pread64.c    |   35 ----------
 sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c |   35 ----------
 .../unix/sysv/linux/powerpc/powerpc32/pwrite64.c   |   36 ----------
 sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h |   18 -----
 sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h |   18 -----
 sysdeps/unix/sysv/linux/pread.c                    |   25 ++-----
 sysdeps/unix/sysv/linux/pread64.c                  |   23 +++----
 sysdeps/unix/sysv/linux/pwrite.c                   |   25 ++-----
 sysdeps/unix/sysv/linux/pwrite64.c                 |   23 +++----
 sysdeps/unix/sysv/linux/sh/pread.c                 |   30 ++-------
 sysdeps/unix/sysv/linux/sh/pread64.c               |   30 ++-------
 sysdeps/unix/sysv/linux/sh/pwrite.c                |   30 ++-------
 sysdeps/unix/sysv/linux/sh/pwrite64.c              |   31 ++-------
 sysdeps/unix/sysv/linux/sysdep.h                   |   23 ++++++
 sysdeps/unix/sysv/linux/wordsize-64/pread64.c      |    1 -
 sysdeps/unix/sysv/linux/wordsize-64/pwrite64.c     |    1 -
 sysdeps/unix/sysv/linux/wordsize-64/syscalls.list  |    2 -
 sysdeps/unix/sysv/linux/x86_64/kernel-features.h   |    6 ++
 36 files changed, 177 insertions(+), 851 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/arm/pread.c
 delete mode 100644 sysdeps/unix/sysv/linux/arm/pread64.c
 delete mode 100644 sysdeps/unix/sysv/linux/arm/pwrite.c
 delete mode 100644 sysdeps/unix/sysv/linux/arm/pwrite64.c
 delete mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c
 delete mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c
 delete mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c
 delete mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c
 delete mode 100644 sysdeps/unix/sysv/linux/mips/pread.c
 delete mode 100644 sysdeps/unix/sysv/linux/mips/pread64.c
 delete mode 100644 sysdeps/unix/sysv/linux/mips/pwrite.c
 delete mode 100644 sysdeps/unix/sysv/linux/mips/pwrite64.c
 delete mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
 delete mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
 delete mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
 delete mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
 delete mode 100644 sysdeps/unix/sysv/linux/wordsize-64/pread64.c
 delete mode 100644 sysdeps/unix/sysv/linux/wordsize-64/pwrite64.c


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]