From patchwork Wed Feb 24 20:48:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 62831 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2633288lbl; Wed, 24 Feb 2016 12:49:06 -0800 (PST) X-Received: by 10.66.253.68 with SMTP id zy4mr57642161pac.81.1456346946503; Wed, 24 Feb 2016 12:49:06 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id py15si7071269pab.168.2016.02.24.12.49.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Feb 2016 12:49:06 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-67595-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libc-alpha-return-67595-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-67595-patch=linaro.org@sourceware.org; dkim=pass header.i=@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=aXHgbUFe5ZcD1q3DtmCGp6V/z0Fj9HC utwbsi1pszMEkXD7uB0tuJKqd6RQ7tWQ1eLCdcRV79zgYbwnygIriJU22wdI4LoT 28/LZpB1ZIbMPS14YU1sv+H9wEGFh6ybiIBZe4Fg4CFr/1aXYkTk4t7L6F9ryrRw c9p5ZP92z5Rs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=BvQm8xQnKHdW1eI7Q2HhiqjG450=; b=J9uUk 25fOLjuN8rQetwE4AmAGQW+6aJUkZJLkR0fy/uze4orstATt1rxR7a1eCrYCgI6m JwclVtX5MnthW0mt2DU0DW6BZE6QKnizlH55ZjM+Riml0SXQQup7izrwDDU1N952 7SaXGXsPDMm6rck71mAt6cMA8oWVeLMglB+slg= Received: (qmail 5551 invoked by alias); 24 Feb 2016 20:48:28 -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 5374 invoked by uid 89); 24 Feb 2016 20:48:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS, UNSUBSCRIBE_BODY autolearn=no version=3.3.2 spammy=__NR_pread64, __nr_write, __nr_pread, __NR_write X-HELO: mail-yw0-f177.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=10+3G7uTAHScjpgphnVsC7TZv7yQU7iwlztU+0+CQrM=; b=JJ5ENnArdXB7xpc9qLF+GnA2SLcB8eDehEtS3E/phBARmXsBJb6stW0BpXPDRrckB3 sprE9eUtAkRjEwJ0TBloDITBgzOrbYquwrKOsBVgCfambhwMXlgdj2NSfpcQcWrDvVV1 Y3+MrIsR3zOFuxWAWLPSl/b7qrjD/jPMSJ3pC35Er1MJ/jVhlYOoq+ZDeUOufCCZ3LVq EZm8iAgEEr660OBGXGR7Xw5utYrU9NE3SoY/Irzr5ih+BRw5pS+boVjPWI10MDBNeSsN ECBcIWTyzsa3c7zjs1Y9YvI3YtgJaHIfktftt/yceyHQ0YdPauhpNita++ceseqI6bhi akfA== X-Gm-Message-State: AG10YOTrrm5ZkOlZQjrwdrrPJerWauxkxtk0a0/EzCdappAtUP18JK4BpY219zT3OM2BFvXw X-Received: by 10.13.212.204 with SMTP id w195mr23175641ywd.225.1456346901526; Wed, 24 Feb 2016 12:48:21 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/5] Include generic Linux sysdep.h for all architectures Date: Wed, 24 Feb 2016 17:48:06 -0300 Message-Id: <1456346889-9862-3-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1456346889-9862-1-git-send-email-adhemerval.zanella@linaro.org> References: <1456346889-9862-1-git-send-email-adhemerval.zanella@linaro.org> This adds the Linux generic sysdep.h for all architectures. The generic sysdep.h defines basically two things: 1. Define __NR_pread and __NR_write to __NR_pread64 and __NR_write64 respectively for 64-bits architectures 2. Define the __ALIGNMENT_ARG and __ALIGNMENT_COUNT macros to use for 64-bit argument passing on syscalls. The p{read,write} definition is safe since for 64-bits the p{read,write} will aliased to p{read,write}64. The __ALIGNMENT_{ARG,COUNT} should be safe if all the ABI correctly defines __ASSUME_ALIGNED_REGISTER_PAIRS. This lead to the correct definition on the missing ABIs, mips64-n32 and x32. Checked on x86_64, i386, aarch64, armhf, and ppc64le. * sysdeps/unix/sysv/linux/alpha/sysdep.h: Include generic sysdep.h. * sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/hppa/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/microblaze/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/kernel-features.h [__ILP32] (__ASSUME_WORDSIZE64_ILP32): Define. * sysdeps/unix/sysv/linux/mips/kernel-features.h [_MIPS_SIM == _ABIN32] (__ASSUME_WORDSIZE64_ILP32): Likewise. --- sysdeps/unix/sysv/linux/alpha/sysdep.h | 1 + sysdeps/unix/sysv/linux/arm/sysdep.h | 2 ++ sysdeps/unix/sysv/linux/hppa/sysdep.h | 1 + sysdeps/unix/sysv/linux/i386/sysdep.h | 1 + sysdeps/unix/sysv/linux/ia64/sysdep.h | 1 + sysdeps/unix/sysv/linux/m68k/sysdep.h | 1 + sysdeps/unix/sysv/linux/microblaze/sysdep.h | 1 + sysdeps/unix/sysv/linux/mips/kernel-features.h | 6 ++++++ sysdeps/unix/sysv/linux/mips/mips32/sysdep.h | 1 + sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h | 1 + sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h | 1 + sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h | 1 + sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h | 1 + sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h | 1 + sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h | 1 + sysdeps/unix/sysv/linux/sh/sysdep.h | 1 + sysdeps/unix/sysv/linux/sparc/sysdep.h | 1 + sysdeps/unix/sysv/linux/x86_64/kernel-features.h | 6 ++++++ sysdeps/unix/sysv/linux/x86_64/sysdep.h | 1 + 20 files changed, 52 insertions(+) -- 1.9.1 diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep.h b/sysdeps/unix/sysv/linux/alpha/sysdep.h index b6efc66..d6a1ac9 100644 --- a/sysdeps/unix/sysv/linux/alpha/sysdep.h +++ b/sysdeps/unix/sysv/linux/alpha/sysdep.h @@ -27,6 +27,7 @@ /* There is some commonality. */ #include #include +#include #include diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h index 3986547..a71b418 100644 --- a/sysdeps/unix/sysv/linux/arm/sysdep.h +++ b/sysdeps/unix/sysv/linux/arm/sysdep.h @@ -21,8 +21,10 @@ #define _LINUX_ARM_SYSDEP_H 1 /* There is some commonality. */ +#include #include #include +#include /* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */ #include diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.h b/sysdeps/unix/sysv/linux/hppa/sysdep.h index b459f0a..7b43695 100644 --- a/sysdeps/unix/sysv/linux/hppa/sysdep.h +++ b/sysdeps/unix/sysv/linux/hppa/sysdep.h @@ -24,6 +24,7 @@ #include #include #include +#include /* Defines RTLD_PRIVATE_ERRNO. */ #include diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index 5fcb175..8776d8e 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -22,6 +22,7 @@ /* There is some commonality. */ #include #include +#include /* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */ #include #include diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.h b/sysdeps/unix/sysv/linux/ia64/sysdep.h index 8dfc582..9b95454 100644 --- a/sysdeps/unix/sysv/linux/ia64/sysdep.h +++ b/sysdeps/unix/sysv/linux/ia64/sysdep.h @@ -22,6 +22,7 @@ #include #include +#include #include #include #include diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h index ce48496..ff4dea0 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.h +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h @@ -18,6 +18,7 @@ . */ #include +#include #include /* Defines RTLD_PRIVATE_ERRNO. */ diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep.h b/sysdeps/unix/sysv/linux/microblaze/sysdep.h index abc13c2..f06aa1b 100644 --- a/sysdeps/unix/sysv/linux/microblaze/sysdep.h +++ b/sysdeps/unix/sysv/linux/microblaze/sysdep.h @@ -22,6 +22,7 @@ #include #include #include +#include /* Defines RTLD_PRIVATE_ERRNO. */ #include diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h index ea6a914..17ab696 100644 --- a/sysdeps/unix/sysv/linux/mips/kernel-features.h +++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h @@ -53,3 +53,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/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h index 2160df7..6551794 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h +++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h @@ -21,6 +21,7 @@ /* There is some commonality. */ #include #include +#include #include diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h index 466dcde..88efe74 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h @@ -21,6 +21,7 @@ /* There is some commonality. */ #include #include +#include #include diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h index db8b237..09ea9fa 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h @@ -21,6 +21,7 @@ /* There is some commonality. */ #include #include +#include #include diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h index 6d8990c..390ce24 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h @@ -20,6 +20,7 @@ #include #include +#include #include /* Some systen calls got renamed over time, but retained the same semantics. diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h index 91fd096..761f3ea 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h @@ -22,6 +22,7 @@ #include #include +#include #include /* Define __set_errno() for INLINE_SYSCALL macro below. */ diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h index 3540416..672b326 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h @@ -22,6 +22,7 @@ #include #include #include +#include #include /* For RTLD_PRIVATE_ERRNO. */ #include diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h index 6f390ff..980f202 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h @@ -23,6 +23,7 @@ #include #include #include +#include #include /* For RTLD_PRIVATE_ERRNO. */ #include diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.h b/sysdeps/unix/sysv/linux/sh/sysdep.h index 8618d12..b8cafcc 100644 --- a/sysdeps/unix/sysv/linux/sh/sysdep.h +++ b/sysdeps/unix/sysv/linux/sh/sysdep.h @@ -23,6 +23,7 @@ /* There is some commonality. */ #include #include +#include #include /* For Linux we can use the system call table in the header file diff --git a/sysdeps/unix/sysv/linux/sparc/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sysdep.h index cb197b6..615a0cb 100644 --- a/sysdeps/unix/sysv/linux/sparc/sysdep.h +++ b/sysdeps/unix/sysv/linux/sparc/sysdep.h @@ -22,6 +22,7 @@ #include #include #include +#include #ifdef __ASSEMBLER__ diff --git a/sysdeps/unix/sysv/linux/x86_64/kernel-features.h b/sysdeps/unix/sysv/linux/x86_64/kernel-features.h index 0b84f11..569e8f8 100644 --- a/sysdeps/unix/sysv/linux/x86_64/kernel-features.h +++ b/sysdeps/unix/sysv/linux/x86_64/kernel-features.h @@ -35,4 +35,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 diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h index d023d68..723ebf2 100644 --- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h +++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h @@ -21,6 +21,7 @@ /* There is some commonality. */ #include #include +#include #include #if IS_IN (rtld)