From patchwork Wed Sep 3 21:19:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 36651 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f72.google.com (mail-oi0-f72.google.com [209.85.218.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F10C8202E4 for ; Wed, 3 Sep 2014 21:22:47 +0000 (UTC) Received: by mail-oi0-f72.google.com with SMTP id e131sf42647910oig.3 for ; Wed, 03 Sep 2014 14:22:47 -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:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=VD47dI6z91zvOytfUgpr59P6ccnLn03Bk3tkZXGhh8c=; b=JhrzByKMqsg8pOQx/yZZG7wd1RG0OcZNa/7ujbd1ErtFbyoe76bfPHgKZhYvIN95gn zXDgP5HLUoxD0GLd8kxxt3JpIVYy+X/eGIwQUQplGXz4tEa7pPO/YMXKW2FXawxzQRUx wWwJEBzpr4YWbfESSam7AVFdUDsS2/EU4UcmCA3O7aOsrQqjINLZveK6REyy02yekjLZ rej3TWbe1rjAPxzXYjc2I+I+MhVZvs2Da1VBdvJA49HPszD5zBHSBqLcIgbkf54b4nHD ZVX2Bd77OfbopIxMGbTBoQfEUW6SbqIcN4sKGxKm4uhElQUgVH4pNjinEWaIgNKA0xBn o9wA== X-Gm-Message-State: ALoCoQlVX7cy7fUri+JGp8bm95BnqZc1t4ymzCTaVwVuoFs79tFNOJuVQwx8fprltR8EGq1EF5XB X-Received: by 10.50.66.236 with SMTP id i12mr169028igt.5.1409779367516; Wed, 03 Sep 2014 14:22:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.143 with SMTP id w15ls23512qge.38.gmail; Wed, 03 Sep 2014 14:22:47 -0700 (PDT) X-Received: by 10.220.5.1 with SMTP id 1mr139242vct.73.1409779367386; Wed, 03 Sep 2014 14:22:47 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id c7si1729257vds.9.2014.09.03.14.22.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 14:22:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ik5so9619135vcb.35 for ; Wed, 03 Sep 2014 14:22:47 -0700 (PDT) X-Received: by 10.221.5.137 with SMTP id og9mr100721vcb.18.1409779367325; Wed, 03 Sep 2014 14:22:47 -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.221.45.67 with SMTP id uj3csp740355vcb; Wed, 3 Sep 2014 14:22:46 -0700 (PDT) X-Received: by 10.66.152.109 with SMTP id ux13mr149544pab.122.1409779366462; Wed, 03 Sep 2014 14:22:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rn15si13471747pab.76.2014.09.03.14.22.45 for ; Wed, 03 Sep 2014 14:22:46 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932357AbaICVU3 (ORCPT + 26 others); Wed, 3 Sep 2014 17:20:29 -0400 Received: from mail-ie0-f182.google.com ([209.85.223.182]:57865 "EHLO mail-ie0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753677AbaICVT3 (ORCPT ); Wed, 3 Sep 2014 17:19:29 -0400 Received: by mail-ie0-f182.google.com with SMTP id rd18so10615451iec.13 for ; Wed, 03 Sep 2014 14:19:28 -0700 (PDT) X-Received: by 10.50.80.76 with SMTP id p12mr153687igx.34.1409779168579; Wed, 03 Sep 2014 14:19:28 -0700 (PDT) Received: from localhost.localdomain (64.2.3.195.ptr.us.xo.net. [64.2.3.195]) by mx.google.com with ESMTPSA id l4sm6469636igt.22.2014.09.03.14.19.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Sep 2014 14:19:26 -0700 (PDT) Received: from localhost.localdomain (apinskidesktop [127.0.0.1]) by localhost.localdomain (8.14.3/8.14.3/Debian-9.4) with ESMTP id s83LJOtK031039 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Wed, 3 Sep 2014 14:19:24 -0700 Received: (from apinski@localhost) by localhost.localdomain (8.14.3/8.14.3/Submit) id s83LJOgD031038; Wed, 3 Sep 2014 14:19:24 -0700 From: Andrew Pinski To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pinskia@gmail.com Cc: Andrew Pinski Subject: [PATCH 07/24] ARM64:ILP32: Use the same size and layout of the signal structures for ILP32 as for LP64 Date: Wed, 3 Sep 2014 14:19:01 -0700 Message-Id: <1409779158-30963-8-git-send-email-apinski@cavium.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1409779158-30963-1-git-send-email-apinski@cavium.com> References: <1409779158-30963-1-git-send-email-apinski@cavium.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. 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 209.85.220.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Defines the macros which allow the signal structures to be the same between ILP32 and LP64. Signed-off-by: Andrew Pinski --- arch/arm64/include/uapi/asm/siginfo.h | 33 ++++++++++++++++++++++++++++++++ arch/arm64/include/uapi/asm/signal.h | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 0 deletions(-) diff --git a/arch/arm64/include/uapi/asm/siginfo.h b/arch/arm64/include/uapi/asm/siginfo.h index 5a74a08..c80c612 100644 --- a/arch/arm64/include/uapi/asm/siginfo.h +++ b/arch/arm64/include/uapi/asm/siginfo.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2012 ARM Ltd. + * Copyright (C) 2014 Cavium Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -18,6 +19,38 @@ #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) +#ifdef __ILP32__ + +/* + * For ILP32, the siginfo structures should share the same layout and + * alignement requirements as LP64 ABI. + * To do this, use an extra pad field and add aligned attribute + * to the structure. + */ + +# ifdef __AARCH64EB__ +# define __SIGINFO_INNER(type, field) \ + int __pad#field; \ + type field +# else +# define __SIGINFO_INNER(type, field) \ + type field; \ + int __pad#field +# endif + +# undef __SIGINFO_VOIDPTR +# define __SIGINFO_VOIDPTR(field) \ + __SIGINFO_INNER(void __user*, field) +# undef __SIGINFO_BAND + +# define __SIGINFO_BAND(field) \ + __SIGINFO_INNER(long, field) + +/* Make the alignment of siginfo always 8 byte aligned. */ +#define __ARCH_SI_ATTRIBUTES __attribute__((aligned(8))) + +#endif + #include #endif diff --git a/arch/arm64/include/uapi/asm/signal.h b/arch/arm64/include/uapi/asm/signal.h index 8d1e723..d33a5f7 100644 --- a/arch/arm64/include/uapi/asm/signal.h +++ b/arch/arm64/include/uapi/asm/signal.h @@ -16,9 +16,43 @@ #ifndef __ASM_SIGNAL_H #define __ASM_SIGNAL_H +#include + /* Required for AArch32 compatibility. */ #define SA_RESTORER 0x04000000 +/* + * Since sigset is a bitmask, we need the same size fields for ILP32 + * and LP64. With big-endian, 32bit bitmask does not match up to + * 64bit bitmask (unlike with little-endian). + */ +#ifdef __ILP32__ + +#define __SIGSET_INNER_TYPE __kernel_ulong_t +#define _NSIG_BPW 64 + +# ifdef __AARCH64EB__ +# define __SIGNAL_INNER(type, field) \ + int __pad_##field; \ + type field; +# else +# define __SIGNAL_INNER(type, field) \ + type field; \ + int __pad_##field; +# endif + +# define __SIGACTION_HANDLER(field) \ + __SIGNAL_INNER(__sighandler_t, field) + + +#define __SIGACTION_FLAGS(field) \ + __kernel_ulong_t field + +#define __SIGACTION_RESTORER(field) \ + __SIGNAL_INNER(__sigrestore_t, field) + +#endif + #include #endif