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: 3407 Received: (qmail 15657 invoked by alias); 27 Oct 2014 08:00:04 -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 15283 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-ie0-f179.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=fTozjA1NeWfeFyFuVlXvY4SRvnVKAoWKY3ce3Rn+pCc=; b=Mz93G/XjvsuxvTg7KSemOZtx1XH0sNw7U7oz2+clVrwR2ahZI6685S96dO6+QXls1b h8I7/8fOtclGL2q0p87K2FAIuKFR7DxqdR3a9lQKqZO9hsnxMxS/Loca8+1cbuD2gv9j fjREoeNxUI0q9qIOF7IFGebbSX/sIDLP/B+RPvPlM5WMJ5BirjUVfW2xTKGSay+4rPgb EVD6VWEXajR0MpDHsYZsglBxfcopNRfeDsJazTE7tUH4sJgHI3R/sCFkXLDrO2Lsyitd jfL1ZVLp0phXpqfZAoGsnW21hCmc+f3vR9RO8oafBD4GUg/JzGVxgjeiUxuS3XqSPWij DaUA== X-Gm-Message-State: ALoCoQl5wDPTr1jYOA23e9oCFHrMOcKgYnLYM/Wqxw7ybj6UWmBPLINbNBHqaHZetkkqmkNU4fEG 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> 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. */