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: 3540001 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 89B559F391 for ; Sun, 26 Jan 2014 20:31:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A26FD2011E for ; Sun, 26 Jan 2014 20:31:58 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8EDC20108 for ; Sun, 26 Jan 2014 20:31:53 +0000 (UTC) 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-0001Pv-Vj; 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-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; bh=7CE6mViHThPsNmDyOQtMvuK0JfpvvOjOExWrGB71K/E=; b=nMZIlH4ppLEgdWwl9UZb6UuYVRzLqNwwOFBvzNrCZiKgsoSliI+zU+BhUcnDfK4+PE OyZUfL7QgbIqGX2rl/SrO+exBRqxCDi0jkMslTKKb+OeFRtG1+T5jDydjPddMnpLYLx9 pMY5odSMfGodMfMv6ELZTwModeXrLr+XlMA5wMi+gKRjpBxEdx6idiTUWjybRJClKC3R 3WV+PL3sznfz23G74/oY72u/+wUJSam7ECy4npny8xchJeGVwCzWze1gv2iOWiaYPZgb b4Gvbkx6LLOFM6RuRRe/Y/kmtQHdYJ/UMxlwd6qEbQSxhGuiGLasw59L5Ab+3tOeGmIP +ucw== X-Gm-Message-State: ALoCoQm+AlikSf3bxmMj4+jec9FQcaO6hf5b+B0YydlRgZgGbbEJ/BeEbl3vgItD7K8WsRjJLMDJ 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 (--) 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 */