From patchwork Sun Jan 26 20:30:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 23724 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3377E20143 for ; Sun, 26 Jan 2014 20:32:07 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id 131sf25135370ykp.1 for ; Sun, 26 Jan 2014 12:32:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=O+KJOiERkXj8ld6XtZ3P5r3TDXz5fWfM9H6XE/yFj1A=; b=MohrM8zhEMwONbo2voqvsKU8v/FSnC7OBbWjpBUdnCJm6cT71OEHtWmP2WvbO4lYnv TWWQx7MW98/ST5uIA6qzhTnbq2Yv2GjLiZYCSoFV74C74b1tPeb5zqFgz5ZhQNCZj/9o EZjjWvZo81ifVttjL9Ucsr/8PZjPtcH+ncFxTEErosGHCCylBew41CB4jppvuLAWRLsc HOf3/P7gMkzT57XFEUgyJc2wumo2Bh9Tyca4zjLjet6F7pUxrIexnz0d+2PSnpGoiClE 8t2VegTy0AlueuWIw8qdLHPPSqxa/eQ3/xbCZLT4zGiGHGO34SMRo/h72j9jMwyBzomi IFjQ== X-Gm-Message-State: ALoCoQmZgj8Xdu04kqq01yBhq9oOdE7gB3S2gASMLzNGUvjhE5HjtxqZ38K4GVqQdfm3EOFc4y/2 X-Received: by 10.58.120.76 with SMTP id la12mr10110070veb.21.1390768326215; Sun, 26 Jan 2014 12:32:06 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.42.14 with SMTP id b14ls450509qga.47.gmail; Sun, 26 Jan 2014 12:32:06 -0800 (PST) X-Received: by 10.53.13.44 with SMTP id ev12mr1515128vdd.17.1390768326123; Sun, 26 Jan 2014 12:32:06 -0800 (PST) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id n8si722878vdv.55.2014.01.26.12.32.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 Jan 2014 12:32:06 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id cz12so3017257veb.40 for ; Sun, 26 Jan 2014 12:32:06 -0800 (PST) X-Received: by 10.58.100.100 with SMTP id ex4mr13754476veb.2.1390768326031; Sun, 26 Jan 2014 12:32:06 -0800 (PST) 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.220.174.196 with SMTP id u4csp84261vcz; Sun, 26 Jan 2014 12:32:05 -0800 (PST) X-Received: by 10.204.111.135 with SMTP id s7mr19518973bkp.1.1390768324983; Sun, 26 Jan 2014 12:32:04 -0800 (PST) Received: from casper.infradead.org (casper.infradead.org. [2001:770:15f::2]) by mx.google.com with ESMTPS id j5si11532997bkr.24.2014.01.26.12.32.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Jan 2014 12:32:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:770:15f::2 as permitted sender) client-ip=2001:770:15f::2; Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7WMZ-0001Pt-UR; Sun, 26 Jan 2014 20:31:28 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7WMX-0006QG-M5; Sun, 26 Jan 2014 20:31:25 +0000 Received: from mail-wg0-f42.google.com ([74.125.82.42]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7WMU-0006Pb-0h for linux-arm-kernel@lists.infradead.org; Sun, 26 Jan 2014 20:31:22 +0000 Received: by mail-wg0-f42.google.com with SMTP id l18so3532525wgh.5 for ; Sun, 26 Jan 2014 12:30:53 -0800 (PST) X-Received: by 10.194.186.204 with SMTP id fm12mr2325844wjc.27.1390768253553; Sun, 26 Jan 2014 12:30:53 -0800 (PST) Received: from ards-macbook-pro.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id fo6sm22685528wib.7.2014.01.26.12.30.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 Jan 2014 12:30:52 -0800 (PST) From: Ard Biesheuvel To: catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH] arm64: add workaround for ambiguous C99 stdint.h types Date: Sun, 26 Jan 2014 21:30:48 +0100 Message-Id: <1390768248-1688-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140126_153122_148805_EFE751ED X-CRM114-Status: GOOD ( 14.63 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.42 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: dave.martin@arm.com, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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 In a way similar to ARM commit 09096f6a0ee2 ("ARM: 7822/1: add workaround for ambiguous C99 stdint.h types"), this patch redefines the macros that are used in stdint.h so its definitions of uint64_t and int64_t are compatible with those of the kernel. In order to do so, drop types.h from generic-y and create a specific arm64 version identical to the generic one with just the #define overrides added. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/Kbuild | 1 - arch/arm64/include/asm/types.h | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/include/asm/types.h diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild index d0ff25de67ca..93e0653e8c65 100644 --- a/arch/arm64/include/asm/Kbuild +++ b/arch/arm64/include/asm/Kbuild @@ -44,7 +44,6 @@ generic-y += termbits.h generic-y += termios.h generic-y += topology.h generic-y += trace_clock.h -generic-y += types.h generic-y += unaligned.h generic-y += user.h generic-y += vga.h diff --git a/arch/arm64/include/asm/types.h b/arch/arm64/include/asm/types.h new file mode 100644 index 000000000000..6519296da003 --- /dev/null +++ b/arch/arm64/include/asm/types.h @@ -0,0 +1,26 @@ +#ifndef __ASM_TYPES_H +#define __ASM_TYPES_H + +#include + +/* + * For Aarch64, there is some ambiguity in the definition of the types below + * between the kernel and GCC itself. This is usually not a big deal, but it + * causes trouble when including GCC's version of 'stdint.h' (this is the file + * that gets included when you #include on a -ffreestanding build). + * As this file also gets included implicitly when including 'arm_neon.h' (the + * NEON intrinsics support header), we need the following to work around the + * issue if we want to use NEON intrinsics in the kernel. + */ + +#ifdef __INT64_TYPE__ +#undef __INT64_TYPE__ +#define __INT64_TYPE__ __signed__ long long +#endif + +#ifdef __UINT64_TYPE__ +#undef __UINT64_TYPE__ +#define __UINT64_TYPE__ unsigned long long +#endif + +#endif /* __ASM_TYPES_H */