From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9758 invoked by alias); 18 Nov 2014 11:31:29 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 9748 invoked by uid 89); 18 Nov 2014 11:31:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ie0-f182.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=272tuXZDq+wWbpP2PonBfn80BFwAdmdsTBipPNmmIJA=; b=bhrE2n2yVeeY2VZHaWpRBYO/d9dlYsBAWVUaF1Biif2szIIWURQzYkDUgky5XWxvwc KSA+vBA9iYsy4pHdwhU/GgvhG+ZtltE60hFCoHyT19DODzSkdl252yVYAXBrIzes4P/C fpniPFSbPS5dYPGHnHpBawCQN+Kb7t6m851GKacnJJgnFLdlWovjlGlFCn8Gi6UwjaZD mRppsjP0Ng7GsPPctmU15g8ECZhgb+FXC6aLeUnuHNHzZD/JkJbJqvfB15/gUSFATCFQ 6BmGcdG6w9p+qn/0UWbPV6oq8Quc4SUpYyUSxWBuxUIGdid8nWtO6TmmkvFR09nDmewJ +eZg== X-Gm-Message-State: ALoCoQmU2h3nG8hiMYbH/B93jpTcacuinRbJawAKrMQb399vSHGsZt0acmvF8UWJ4ZlZFgxJLb/8 MIME-Version: 1.0 X-Received: by 10.50.138.76 with SMTP id qo12mr2445634igb.43.1416310284985; Tue, 18 Nov 2014 03:31:24 -0800 (PST) In-Reply-To: <1414396793-9005-7-git-send-email-apinski@cavium.com> References: <1414396793-9005-1-git-send-email-apinski@cavium.com> <1414396793-9005-7-git-send-email-apinski@cavium.com> Date: Tue, 18 Nov 2014 11:31:00 -0000 Message-ID: Subject: Re: [PATCH 06/29] Allow some fields of siginfo to be different from the generic one From: Will Newton To: Andrew Pinski Cc: libc-alpha Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2014-11/txt/msg00419.txt.bz2 On 27 October 2014 07:59, Andrew Pinski wrote: > 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 > + These #defines need indenting. > #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 This #else needs indenting further too. Otherwise this looks ok to me. > -# 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. */ > -- > 1.7.2.5 > -- Will Newton Toolchain Working Group, Linaro