From patchwork Mon Jul 11 19:26:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lu, Hongjiu" X-Patchwork-Id: 13734 Received: (qmail 108779 invoked by alias); 11 Jul 2016 19:27:04 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 108769 invoked by uid 89); 11 Jul 2016 19:27:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*R:D*gmail.com X-HELO: mga04.intel.com X-ExtLoop1: 1 Date: Mon, 11 Jul 2016 12:26:53 -0700 From: "H.J. Lu" To: GNU C Library Subject: [PATCH] Use SYSCALL_LL[64] to pass 64-bit value [BZ #20349] Message-ID: <20160711192653.GA4457@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.1 (2016-04-27) SYSCALL_LL/SYSCALL_LL64 should be used to pass 64-bit value to system calls. Tested on x86-64 and i686. OK for master? H.J. --- [BZ #20349] * sysdeps/unix/sysv/linux/preadv.c (preadv): Replace LO_HI_LONG with __ALIGNMENT_ARG SYSCALL_LL. * sysdeps/unix/sysv/linux/pwritev.c (pwritev): Likewise. * sysdeps/unix/sysv/linux/preadv64.c (preadv64): Replace LO_HI_LONG with __ALIGNMENT_ARG SYSCALL_LL64. * sysdeps/unix/sysv/linux/pwritev64.c (pwritev64): Likewise. * sysdeps/unix/sysv/linux/sysdep.h (LO_HI_LONG): Removed. --- sysdeps/unix/sysv/linux/preadv.c | 5 +++-- sysdeps/unix/sysv/linux/preadv64.c | 5 +++-- sysdeps/unix/sysv/linux/pwritev.c | 5 +++-- sysdeps/unix/sysv/linux/pwritev64.c | 5 +++-- sysdeps/unix/sysv/linux/sysdep.h | 5 ----- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/sysdeps/unix/sysv/linux/preadv.c b/sysdeps/unix/sysv/linux/preadv.c index 107cb81..3db6912 100644 --- a/sysdeps/unix/sysv/linux/preadv.c +++ b/sysdeps/unix/sysv/linux/preadv.c @@ -29,7 +29,8 @@ ssize_t preadv (int fd, const struct iovec *vector, int count, off_t offset) { - return SYSCALL_CANCEL (preadv, fd, vector, count, LO_HI_LONG (offset)); + return SYSCALL_CANCEL (preadv, fd, vector, count, + __ALIGNMENT_ARG SYSCALL_LL (offset)); } # else static ssize_t __atomic_preadv_replacement (int, const struct iovec *, @@ -39,7 +40,7 @@ preadv (int fd, const struct iovec *vector, int count, off_t offset) { # ifdef __NR_preadv ssize_t result = SYSCALL_CANCEL (preadv, fd, vector, count, - LO_HI_LONG (offset)); + __ALIGNMENT_ARG SYSCALL_LL (offset)); if (result >= 0 || errno != ENOSYS) return result; # endif diff --git a/sysdeps/unix/sysv/linux/preadv64.c b/sysdeps/unix/sysv/linux/preadv64.c index 66afd4c..27cd04f 100644 --- a/sysdeps/unix/sysv/linux/preadv64.c +++ b/sysdeps/unix/sysv/linux/preadv64.c @@ -27,7 +27,8 @@ ssize_t preadv64 (int fd, const struct iovec *vector, int count, off64_t offset) { - return SYSCALL_CANCEL (preadv64, fd, vector, count, LO_HI_LONG (offset)); + return SYSCALL_CANCEL (preadv64, fd, vector, count, + __ALIGNMENT_ARG SYSCALL_LL64 (offset)); } #else static ssize_t __atomic_preadv64_replacement (int, const struct iovec *, @@ -37,7 +38,7 @@ preadv64 (int fd, const struct iovec *vector, int count, off64_t offset) { #ifdef __NR_preadv64 ssize_t result = SYSCALL_CANCEL (preadv64, fd, vector, count, - LO_HI_LONG (offset)); + __ALIGNMENT_ARG SYSCALL_LL64 (offset)); if (result >= 0 || errno != ENOSYS) return result; #endif diff --git a/sysdeps/unix/sysv/linux/pwritev.c b/sysdeps/unix/sysv/linux/pwritev.c index 6747f42..7c98bfd 100644 --- a/sysdeps/unix/sysv/linux/pwritev.c +++ b/sysdeps/unix/sysv/linux/pwritev.c @@ -29,7 +29,8 @@ ssize_t pwritev (int fd, const struct iovec *vector, int count, off_t offset) { - return SYSCALL_CANCEL (pwritev, fd, vector, count, LO_HI_LONG (offset)); + return SYSCALL_CANCEL (pwritev, fd, vector, count, + __ALIGNMENT_ARG SYSCALL_LL (offset)); } # else static ssize_t __atomic_pwritev_replacement (int, const struct iovec *, @@ -39,7 +40,7 @@ pwritev (int fd, const struct iovec *vector, int count, off_t offset) { # ifdef __NR_pwritev ssize_t result = SYSCALL_CANCEL (pwritev, fd, vector, count, - LO_HI_LONG (offset)); + __ALIGNMENT_ARG SYSCALL_LL (offset)); if (result >= 0 || errno != ENOSYS) return result; # endif diff --git a/sysdeps/unix/sysv/linux/pwritev64.c b/sysdeps/unix/sysv/linux/pwritev64.c index e162948..5d5d43f 100644 --- a/sysdeps/unix/sysv/linux/pwritev64.c +++ b/sysdeps/unix/sysv/linux/pwritev64.c @@ -27,7 +27,8 @@ ssize_t pwritev64 (int fd, const struct iovec *vector, int count, off64_t offset) { - return SYSCALL_CANCEL (pwritev64, fd, vector, count, LO_HI_LONG (offset)); + return SYSCALL_CANCEL (pwritev64, fd, vector, count, + __ALIGNMENT_ARG SYSCALL_LL64 (offset)); } #else static ssize_t __atomic_pwritev64_replacement (int, const struct iovec *, @@ -37,7 +38,7 @@ pwritev64 (int fd, const struct iovec *vector, int count, off64_t offset) { #ifdef __NR_pwritev64 ssize_t result = SYSCALL_CANCEL (pwritev64, fd, vector, count, - LO_HI_LONG (offset)); + __ALIGNMENT_ARG SYSCALL_LL64 (offset)); if (result >= 0 || errno != ENOSYS) return result; #endif diff --git a/sysdeps/unix/sysv/linux/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h index a469f57..f2d7e05 100644 --- a/sysdeps/unix/sysv/linux/sysdep.h +++ b/sysdeps/unix/sysv/linux/sysdep.h @@ -47,8 +47,3 @@ #define SYSCALL_LL64(val) \ __LONG_LONG_PAIR ((long) ((val) >> 32), (long) ((val) & 0xffffffff)) #endif - -/* Provide a macro to pass the off{64}_t argument on p{readv,writev}{64}. */ -#define LO_HI_LONG(val) \ - (long) (val), \ - (long) (((uint64_t) (val)) >> 32)