From patchwork Mon Oct 27 07:59:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 3411 Received: (qmail 15917 invoked by alias); 27 Oct 2014 08:00:17 -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 15273 invoked by uid 89); 27 Oct 2014 08:00:00 -0000 Authentication-Results: sourceware.org; auth=none 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-ig0-f176.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:cc:subject:date:message-id:in-reply-to :references; bh=JaNkkO6ENnDXaGa4nVChc3UfsXOnYUkE+T716yx8xJo=; b=CzyYttuwxiNDK4LgQigilfkXCPooaKbvPnXkyov5zifOIWDD0/Ip8EH64EiUjGWCqz AaiVNqJM2fwMTtaEtlUS74YjYkyiz+Vfp5k5S1vUa5tFj4MWnSwgRAf6uISu/YSXvjY/ 1aK7XZHSi5YfDffylFmofZqgpDJQbx9McbhdG40Bo+OZGcDfPWritSRzmUctA2NFvDf0 Nj4cuf/WocdA7qwZJcp31T6jaFldDyVdjUIsZPWe2kGNn4M0tVCfunKkF7Yf4JICv4PQ Nwht/S1Fs2dK2bh5P2Xf0sYupapxChhrw9CNFbf66jkfGLHMtnxZcy5TUtB6JOoyzS/T Rqmg== X-Gm-Message-State: ALoCoQnmv2qBjlKYMFQNXMBT9tfWajgR39Q1ZOTrOQNzebVbEtSiEiF1E+C+5b0J3JckyO+bL2vo X-Received: by 10.50.3.97 with SMTP id b1mr20300825igb.12.1414396797582; Mon, 27 Oct 2014 00:59:57 -0700 (PDT) From: Andrew Pinski To: libc-alpha@sourceware.org Cc: Andrew Pinski Subject: [PATCH 02/29] Allow sigset be an array of a different type Date: Mon, 27 Oct 2014 00:59:26 -0700 Message-Id: <1414396793-9005-3-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> For AARCH64 ILP32, sigset needs to be an array of unsigned long long as it needs to be 64bit to match AARCH64 lP64. * sysdeps/unix/sysv/linux/bits/sigset.h: Include bits/types.h. (__sigset_inner_t): New typedef. (_SIGSET_NWORDS): Use __sigset_inner_t instead of unsigned long. (__sigset_t): Likewise. (__sigmask): Likewise. (__sigword): Likewise. (__SIGSETFN): Likewise. --- sysdeps/unix/sysv/linux/bits/sigset.h | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/sysdeps/unix/sysv/linux/bits/sigset.h b/sysdeps/unix/sysv/linux/bits/sigset.h index af4ae83..4648e7b 100644 --- a/sysdeps/unix/sysv/linux/bits/sigset.h +++ b/sysdeps/unix/sysv/linux/bits/sigset.h @@ -19,14 +19,22 @@ #ifndef _SIGSET_H_types # define _SIGSET_H_types 1 +#include + typedef int __sig_atomic_t; +#ifndef __SIGSET_INNER_T +typedef unsigned long __sigset_inner_t; +#else +typedef __SIGSET_INNER_T __sigset_inner_t; +#endif + /* A `sigset_t' has a bit for each signal. */ -# define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) +# define _SIGSET_NWORDS (1024 / (8 * sizeof (__sigset_inner_t))) typedef struct { - unsigned long int __val[_SIGSET_NWORDS]; + __sigset_inner_t __val[_SIGSET_NWORDS]; } __sigset_t; #endif @@ -47,10 +55,10 @@ typedef struct /* Return a mask that includes the bit for SIG only. */ # define __sigmask(sig) \ - (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int)))) + (((__sigset_inner_t) 1) << (((sig) - 1) % (8 * sizeof (__sigset_inner_t)))) /* Return the word index for SIG. */ -# define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int))) +# define __sigword(sig) (((sig) - 1) / (8 * sizeof (__sigset_inner_t))) # if defined __GNUC__ && __GNUC__ >= 2 # define __sigemptyset(set) \ @@ -108,8 +116,8 @@ extern int __sigdelset (__sigset_t *, int); _EXTERN_INLINE int \ NAME (CONST __sigset_t *__set, int __sig) \ { \ - unsigned long int __mask = __sigmask (__sig); \ - unsigned long int __word = __sigword (__sig); \ + __sigset_inner_t __mask = __sigmask (__sig); \ + __sigset_inner_t __word = __sigword (__sig); \ return BODY; \ }