From patchwork Mon Oct 27 07:59:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 39571 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 855192118A for ; Mon, 27 Oct 2014 08:01:32 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id k14sf357231wgh.11 for ; Mon, 27 Oct 2014 01:01:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-subscribe:list-archive :list-post:list-help:sender:delivered-to:from:to:cc:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results; bh=lr30JcIw9u+JTlU1u8Ak/StbufHi70CUlGJzV9rQl8I=; b=UNMfkiHficV0QI+agu0pEwuna9M+0VFE+7+YhpepjPOg/lowcBIT/+B1LEEBIQ6MDN CyWsVDqvutIQzt1VWUr9CBBskJ1wYvp4AT/usGlBYZ60FYK009OPL83N76rDiWVzF5KH J9Y2XCVZpzPQ0vlFOFX9AwurEIMsmwvwWYO1v/+EDKlpmBQAJ/5Bc705mEIzPYQw2jW2 ey7Tc//LQdwENtFMvcnYRwYaLcpzyLBoiOvlxH+eMjx4vyy39lPR0mOLk05lqXUxFIsb Xei1A7F/tlYSBzP0ITxtFOPiO7HILIa/bJLGvOc32KHTi+C7jbokG6ONjOmEUi3aFUAC YAbg== X-Gm-Message-State: ALoCoQm6gMMsloLvRufixJ0RyjIzIER0p9YDxpY218Zpk0x1aB3a0pvMKzkL43r9OBEyiZZjwxpQ X-Received: by 10.152.1.133 with SMTP id 5mr13301lam.8.1414396891633; Mon, 27 Oct 2014 01:01:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.97 with SMTP id s1ls675177lag.81.gmail; Mon, 27 Oct 2014 01:01:30 -0700 (PDT) X-Received: by 10.112.11.133 with SMTP id q5mr21556167lbb.77.1414396890696; Mon, 27 Oct 2014 01:01:30 -0700 (PDT) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com. [2a00:1450:4010:c04::229]) by mx.google.com with ESMTPS id qs7si18659597lbb.76.2014.10.27.01.01.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 01:01:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::229 as permitted sender) client-ip=2a00:1450:4010:c04::229; Received: by mail-lb0-f169.google.com with SMTP id l4so180120lbv.0 for ; Mon, 27 Oct 2014 01:01:30 -0700 (PDT) X-Received: by 10.152.120.199 with SMTP id le7mr21289684lab.67.1414396890617; Mon, 27 Oct 2014 01:01:30 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp247331lbz; Mon, 27 Oct 2014 01:01:29 -0700 (PDT) X-Received: by 10.70.91.204 with SMTP id cg12mr22502445pdb.33.1414396889112; Mon, 27 Oct 2014 01:01:29 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id xn3si9872749pab.146.2014.10.27.01.01.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Oct 2014 01:01:29 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-53802-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 15562 invoked by alias); 27 Oct 2014 08:00:04 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 15269 invoked by uid 89); 27 Oct 2014 08:00:00 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-ie0-f180.google.com X-Received: by 10.42.122.208 with SMTP id o16mr623365icr.69.1414396797115; Mon, 27 Oct 2014 00:59:57 -0700 (PDT) From: Andrew Pinski To: libc-alpha@sourceware.org Cc: Andrew Pinski Subject: [PATCH 05/29] Allow fd_mask type not be an array of long. Date: Mon, 27 Oct 2014 00:59:29 -0700 Message-Id: <1414396793-9005-6-git-send-email-apinski@cavium.com> In-Reply-To: <1414396793-9005-1-git-send-email-apinski@cavium.com> References: <1414396793-9005-1-git-send-email-apinski@cavium.com> X-Original-Sender: apinski@cavium.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::229 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 Even though XPG4.2 requires fd_set member be a long, AARCH64:ILP32 needs it to be the same size as AARCH64:LP64 for big-endian so we need it to be long long. * misc/sys/select.h (__FD_MASK_TYPE): Define. (__FD_MASK_CONST): Define. (__fd_mask): Change to base on __FD_MASK_TYPE. (__FD_MASK): Use __FD_MASK_CONST. --- misc/sys/select.h | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/misc/sys/select.h b/misc/sys/select.h index 941588d..0ca660e 100644 --- a/misc/sys/select.h +++ b/misc/sys/select.h @@ -49,16 +49,20 @@ typedef __suseconds_t suseconds_t; # define __suseconds_t_defined #endif +/* The fd_set member is required to be an array of longs by XPG4.2. */ +#ifndef __FD_MASK_TYPE +#define __FD_MASK_TYPE long +#define __FD_MASK_CONST(a) a##ul +#endif -/* The fd_set member is required to be an array of longs. */ -typedef long int __fd_mask; +typedef __FD_MASK_TYPE __fd_mask; /* Some versions of define this macros. */ #undef __NFDBITS /* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ #define __NFDBITS (8 * (int) sizeof (__fd_mask)) #define __FD_ELT(d) ((d) / __NFDBITS) -#define __FD_MASK(d) ((__fd_mask) (1UL << ((d) % __NFDBITS))) +#define __FD_MASK(d) ((__fd_mask) (__FD_MASK_CONST(1) << ((d) % __NFDBITS))) /* fd_set for select and pselect. */ typedef struct