From patchwork Mon Oct 27 07:59:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 39572 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7BEE52118A for ; Mon, 27 Oct 2014 08:01:44 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id r20sf1587069wiv.10 for ; Mon, 27 Oct 2014 01:01:43 -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=fTozjA1NeWfeFyFuVlXvY4SRvnVKAoWKY3ce3Rn+pCc=; b=U0Nh0+YlQycfQqpD/t7bsLPecez2QXVeOUCb/7lrm2agnLlDNPt1mVHS3yL5t2N1vM B6Uk+kZZejZ7mWSsVPvmhVN7kHrl6CM9px+RrTlGzHYJ3zcm25skdZL2IEXYV1NiR7A4 U2Fl6NCU00NFFuROlNFYsBqc7VmthVc7bEOKK5/nP6OdqMitva9B0BXopPgEn35H36NQ nhRgFVrNItAPVFKk/wlCTgfADc3HrC3cT4IASoW6htUZmqWEHLo7DOvz39RG4al1N2YW NKb3yCelusrleh8nzYmF/kYcFQetp6tWfUnNnCATxYhYdeJUL0TMlyDcRpPGA/DLYK2X 2i0A== X-Gm-Message-State: ALoCoQneaHo0gWSi4PQ6B9nwHglgvyYDT95p13pqBRdElkpCIzipOegXiALdhhq8vS937a8k/z/Q X-Received: by 10.180.186.142 with SMTP id fk14mr3585488wic.4.1414396903713; Mon, 27 Oct 2014 01:01:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.5 with SMTP id ca5ls60130lad.68.gmail; Mon, 27 Oct 2014 01:01:43 -0700 (PDT) X-Received: by 10.152.28.101 with SMTP id a5mr22107262lah.52.1414396903375; Mon, 27 Oct 2014 01:01:43 -0700 (PDT) Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com. [2a00:1450:4010:c04::22e]) by mx.google.com with ESMTPS id tj1si18662149lbb.73.2014.10.27.01.01.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 01:01:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22e as permitted sender) client-ip=2a00:1450:4010:c04::22e; Received: by mail-lb0-f174.google.com with SMTP id p9so5158345lbv.5 for ; Mon, 27 Oct 2014 01:01:43 -0700 (PDT) X-Received: by 10.152.87.98 with SMTP id w2mr21369958laz.27.1414396903281; Mon, 27 Oct 2014 01:01:43 -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 c5csp247357lbz; Mon, 27 Oct 2014 01:01:42 -0700 (PDT) X-Received: by 10.70.90.37 with SMTP id bt5mr752381pdb.142.1414396901650; Mon, 27 Oct 2014 01:01:41 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id h1si2201131pdg.44.2014.10.27.01.01.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Oct 2014 01:01:41 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-53804-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 15657 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 15283 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-f179.google.com X-Received: by 10.43.132.131 with SMTP id hu3mr6426301icc.25.1414396797792; Mon, 27 Oct 2014 00:59:57 -0700 (PDT) From: Andrew Pinski To: libc-alpha@sourceware.org Cc: Andrew Pinski Subject: [PATCH 06/29] Allow some fields of siginfo to be different from the generic one Date: Mon, 27 Oct 2014 00:59:30 -0700 Message-Id: <1414396793-9005-7-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::22e as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 In AARCH64:ILP32, we want to use the layout for siginfo as AARCH64:LP64, so we need to add a few hooks into siginfo.h to support this. * sysdeps/unix/sysv/linux/bits/siginfo.h (__SIGINFO_VOIDPTR): New define. (__SIGINFO_BAND): New define. (union sigval): Use __SIGINFO_VOIDPTR for the pointer. (__SI_PAD_SIZE): Don't define if it is already defined. (struct siginfo): Use __SIGINFO_VOIDPTR for the pointer types. Use __SIGINFO_BAND for the si_band field. (struct sigevent): Add a comment on why the remaining fields don't need special handling. --- sysdeps/unix/sysv/linux/bits/siginfo.h | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/sysdeps/unix/sysv/linux/bits/siginfo.h b/sysdeps/unix/sysv/linux/bits/siginfo.h index ae603e8..f319d44 100644 --- a/sysdeps/unix/sysv/linux/bits/siginfo.h +++ b/sysdeps/unix/sysv/linux/bits/siginfo.h @@ -23,6 +23,14 @@ #include +#ifndef __SIGINFO_VOIDPTR +#define __SIGINFO_VOIDPTR(field) void *field +#endif + +#ifndef __SIGINFO_BAND +#define __SIGINFO_BAND(field) long field +#endif + #if (!defined __have_sigval_t \ && (defined _SIGNAL_H || defined __need_siginfo_t \ || defined __need_sigevent_t)) @@ -32,7 +40,7 @@ typedef union sigval { int sival_int; - void *sival_ptr; + __SIGINFO_VOIDPTR (sival_ptr); } sigval_t; #endif @@ -41,10 +49,13 @@ typedef union sigval # define __have_siginfo_t 1 # define __SI_MAX_SIZE 128 -# if __WORDSIZE == 64 -# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) + +# ifndef __SI_PAD_SIZE +# if __WORDSIZE == 64 +# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) # else -# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) +# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) +# endif # endif typedef struct @@ -94,21 +105,21 @@ typedef struct /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */ struct { - void *si_addr; /* Faulting insn/memory ref. */ + __SIGINFO_VOIDPTR (si_addr); /* Faulting insn/memory ref. */ short int si_addr_lsb; /* Valid LSB of the reported address. */ } _sigfault; /* SIGPOLL. */ struct { - long int si_band; /* Band event for SIGPOLL. */ + __SIGINFO_BAND (si_band); /* Band event for SIGPOLL. */ int si_fd; } _sigpoll; /* SIGSYS. */ struct { - void *_call_addr; /* Calling user insn. */ + __SIGINFO_VOIDPTR (_call_addr); /* Calling user insn. */ int _syscall; /* Triggering system call number. */ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */ } _sigsys; @@ -312,6 +323,7 @@ typedef struct sigevent thread to receive the signal. */ __pid_t _tid; + /* Note these two are handled only in userspace. */ struct { void (*_function) (sigval_t); /* Function to start. */