From patchwork Mon Apr 13 19:44:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 6211171 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8322A9F1C4 for ; Mon, 13 Apr 2015 19:50:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B049E2021F for ; Mon, 13 Apr 2015 19:50:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (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 C883D20212 for ; Mon, 13 Apr 2015 19:50:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YhkKH-0007po-Un; Mon, 13 Apr 2015 19:47:21 +0000 Received: from vegas.theobroma-systems.com ([144.76.126.164] helo=mail.theobroma-systems.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YhkIh-00075X-GH for linux-arm-kernel@lists.infradead.org; Mon, 13 Apr 2015 19:45:48 +0000 Received: from [86.59.122.178] (port=55147 helo=android.com) by mail.theobroma-systems.com with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YhkII-0001rr-77; Mon, 13 Apr 2015 21:45:18 +0200 From: Philipp Tomsich To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 05/24] arm64:ilp32: expose 'kernel_long' as 'long long' for ILP32 Date: Mon, 13 Apr 2015 21:44:15 +0200 Message-Id: <0e9c7a8542dbd411cbf5af432f9c96c399bd8c3a.1428953303.git.philipp.tomsich@theobroma-systems.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150413_124543_784050_C62686ED X-CRM114-Status: UNSURE ( 9.25 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) Cc: Andreas Kraschitzer , Philipp Tomsich , Catalin Marinas , Andrew Pinski , Kumar Sankaran , Benedikt Huber , Christoph Muellner X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 From: Andrew Pinski Since we want time_t and some other userland types to be the same between ILP32 and LP64, we define __kernel_long_t to be long long. To reuse the bulk of LP64 system calls (and data structures), the LP64 kernel data types ('kernel_long', 'kernel_ulong') are exposed as their ILP32 'long long' and 'unsigned long long' equivalents to allow glibc to correctly interpret most data-structures used in the kernel ABI (i.el with the exception of those, that include pointers). Signed-off-by: Philipp Tomsich Signed-off-by: Christoph Muellner --- arch/arm64/include/uapi/asm/posix_types.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/uapi/asm/posix_types.h b/arch/arm64/include/uapi/asm/posix_types.h index 7985ff6..d6a7cb5 100644 --- a/arch/arm64/include/uapi/asm/posix_types.h +++ b/arch/arm64/include/uapi/asm/posix_types.h @@ -5,6 +5,16 @@ typedef unsigned short __kernel_old_uid_t; typedef unsigned short __kernel_old_gid_t; #define __kernel_old_uid_t __kernel_old_uid_t +#if defined(__ILP32__) +/* The ILP32 kernel ABI reuses LP64 system calls where possible; to + this end, the equivalent ILP32 type definitions are used (a 64bit + 'long'-type in LP64 corresponds to a 'long long' in LP64). */ + +typedef long long __kernel_long_t; +typedef unsigned long long __kernel_ulong_t; +#define __kernel_long_t __kernel_long_t +#endif /* defined(__ILP32__) */ + #include -#endif /* __ASM_POSIX_TYPES_H */ +#endif /* __ASM_POSIX_TYPES_H */