From patchwork Mon Apr 13 19:44:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 6211181 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4DD4CBF4A6 for ; Mon, 13 Apr 2015 19:51:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 46D18202E9 for ; Mon, 13 Apr 2015 19:51:18 +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 42AA6202D1 for ; Mon, 13 Apr 2015 19:51:17 +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 1YhkKu-0008EV-J6; Mon, 13 Apr 2015 19:48:00 +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-00075D-An 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 1YhkIG-0001rr-Jo; Mon, 13 Apr 2015 21:45:16 +0200 From: Philipp Tomsich To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 01/24] arm64:ilp32: add documentation on the ILP32 ABI for ARM64 Date: Mon, 13 Apr 2015 21:44:11 +0200 Message-Id: <226587ecb31288d94c5c93c7df85fd1ca4ca474a.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_676294_88BB6276 X-CRM114-Status: GOOD ( 10.98 ) X-Spam-Score: -0.0 (/) Cc: Andreas Kraschitzer , Benedikt Huber , Catalin Marinas , Andrew Pinski , Kumar Sankaran , Philipp Tomsich , 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 Based on Andrew Pinski's original patch-series and adapted with changes to reduce the duplication of code-paths and resolve issue found during LTP testing. Signed-off-by: Philipp Tomsich Signed-off-by: Christoph Muellner --- Documentation/arm64/ilp32.txt | 64 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Documentation/arm64/ilp32.txt diff --git a/Documentation/arm64/ilp32.txt b/Documentation/arm64/ilp32.txt new file mode 100644 index 0000000..7524d06 --- /dev/null +++ b/Documentation/arm64/ilp32.txt @@ -0,0 +1,64 @@ +ILP32 AARCH64 SYSCALL ABI +========================= +Written by Andrew Pinski +Updated by Philipp Tomsich + + +This document describes the ILP32 syscall ABI and where it differs +from the generic linux syscall interface. + +ILP32 sets __kernel_long_t and __kernel_ulong_t both to 64bit. This +affects the following type definitions for ILP32 client programs: + * time_t unsigned long long + * clock_t unsigned long long + * fsword_t long long + * suseconds_t long long + * swblk_t long long + * fd_mask_t long long + +Some structures are changed to reduce the difference in the code path +for both ILP32 and LP64 ABIs for signal handling. + +The following structures have been changed so the layout of the +structures are the same between ILP32 and LP64 ABIs, including: + * timespec uses time_t and suseconds_t + * timeval uses time_t and suseconds_t + * stat uses timespec/time_t + * semid64_ds uses time_t. + * msqid64_ds uses time_t. + * shmid64_ds uses time_t. + * rt_sigframe uses siginfo and ucontext. + * siginfo_t uses clock_t and sigval_t + * ucontext uses stack_t and sigset_t + * sigval_t contains pointers + * sigevent Uses sigval_t which causes it to be the same. Special + handing is needed for reading; in the mq_notify syscall + * sigaction Conversion is handled in the userland (glibc), as the + userland data structures are defined in glibc anyway. + * fd_set This is done to avoid endian issues between ILP32 and + LP64. Syscalls consuming fd_set use timespec. + +A number of structures differ between ILP32 and LP64, including: + * struct msgbuf The specification of 'struct msgbuf' defines the 'mtype' + field as a 'long' (i.e. 32bit for ILP32, but 64bit for + LP64). Functions that operate on 'struct msgbuf' need + to be passed through the compat-syscalls to resolve + this. + * stack_t contains pointers (handled in the compatibility layer) + +Also the syscalls which normally would pass 64bit values as two arguments; +now pass the 64bit value as one argument. Also they have been renamed +(removing the 64 from the name) to avoid confusion. +The list of these LP64 syscalls reused by ILP32 clients is: + * fcntl + * statfs + * fstatfs + * truncate + * ftruncate + * lseek + * sendfile + * newfstatat + * fstat + * mmap + * fadvise64 +