From patchwork Wed May 16 08:19:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 10403049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DCB95601F9 for ; Wed, 16 May 2018 08:34:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB764287C2 for ; Wed, 16 May 2018 08:34:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFC482880F; Wed, 16 May 2018 08:34:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2DC062880D for ; Wed, 16 May 2018 08:34:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c2rxDSxH90RSLWhyCQOM4l8oMa3sRkmlnaTEsIAbiGA=; b=KwOqCgCOOxC30Y 115RO4hn4N515ZXm/Fb+67TLnqcWrsZQHLNRJ+uAk0cVMVgcIH+J7OUvb6MXG8OkG+FjPLpMnLLXC OddWTkDSg9mjx3xTlYPlvKUfwLvRXs75616zFmvOqBW7LypMkogD9jGsTf6f7X1yDdFwQ/BTMGycY xvU+AZaAVFOiFxVxjU336OYpwMsAdHt/Eok2M6rkSW9zuESUBx5oL3pqnQh5LeHJbfAL+/7/tfJaI YMlXHi1Bx+2FMdld1u7UmNAS5tQT3jYXldOoyRJrDwN371DT89cy/apkGTPYdWRKQK6Pxdq/HdxJZ AXtwQnJ5wXVj9cDg02cg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIrtA-0004lu-Ls; Wed, 16 May 2018 08:34:24 +0000 Received: from merlin.infradead.org ([205.233.59.134]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIrhi-0004un-Oi for linux-arm-kernel@bombadil.infradead.org; Wed, 16 May 2018 08:22:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MoulHWZtZ+nLTwYDIyk2ZpsgCVOqVTy2dYWsCjnisFI=; b=2hfWLiGajvdoHhlNJ2UT3Jw+7 R0EjEG92df1THcwTrGaREY0sfLLA7ybZwg1PNbCorJgigFK0+rOv3Cw53GyiPfGKjeqWrYQuSffdm EnCrT6lhpeaLbu5BKTfN00taFexq9C3DiR2zPhPqiK1d8ioBsTdoMseC7uhLHtyZOrGhfKwSQF59u NoND2dsHRhfdK3h/syjECpv4Y6GOiHLFzRL1SX6n8lwoajSVIhUxWgnTSjLNLnH8bVC5wmEu9awsl TSuPbJMUWEcEBx+jEtxLGMbsAoLcZYQElvoFwtc9Kin77n4FSLYbF+RpyJ9rShnSriyjqVMQrzKpp a8J/wtJVA==; Received: from mail-by2nam01on0083.outbound.protection.outlook.com ([104.47.34.83] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIrhf-000201-RT for linux-arm-kernel@lists.infradead.org; Wed, 16 May 2018 08:22:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MoulHWZtZ+nLTwYDIyk2ZpsgCVOqVTy2dYWsCjnisFI=; b=MermSLEpq1suGV/1tNC5mogWxcWBfLcqA9WwY2msiF5DS1bxtbOfZfEqeY1PJ9O5VUAMa2nrZElJbzUjCY7hEAZu76aNkM0qAgscid9tYtWa1tzfE4B3hSlb6Gn3x6HfjZU8ymr2kIZVHKNxcc/xf58dfz0MWyXQ7UysjMq9Qig= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Received: from localhost (176.59.36.13) by SN6PR07MB4384.namprd07.prod.outlook.com (2603:10b6:805:58::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Wed, 16 May 2018 08:22:22 +0000 From: Yury Norov To: Catalin Marinas , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org Subject: [PATCH 16/24] arm64: ilp32: share aarch32 syscall handlers Date: Wed, 16 May 2018 11:19:01 +0300 Message-Id: <20180516081910.10067-17-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516081910.10067-1-ynorov@caviumnetworks.com> References: <20180516081910.10067-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [176.59.36.13] X-ClientProxiedBy: VI1PR08CA0122.eurprd08.prod.outlook.com (2603:10a6:800:d4::24) To SN6PR07MB4384.namprd07.prod.outlook.com (2603:10b6:805:58::15) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4384; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4384; 3:yybPkNwI2boKwxXQRXjeJavru9fkYDsIE3nRQiBMtnJPjzxOfOSOnIAKy509peY+amcnEqqGQRsZVQR4cHASbS7sajaCDd7QRUyWr93dmXqZrJO5do+Y5wcRI9cZG7BuCuSSdWxRYpqWNW8gOnPHT9HMBWOyTj4NzG3j0+NNMA3zhRodOeq/88N74QghaX+kncMlIcIXk2J4Fb2BkB8y1wtYjBRULcRhmuPDP0CWaeBVzWZ0xSijaC11AN7UdIXD; 25:2xifa+2YsE+o5IoIuIn3yzGghEHt+AtGavIH/Yb3lB5Ind2KQl4Xo+hMTDVs/lhGSHgkLcmWORTLtLtOIl0mvKBO7peLo0b+RM8fV6D+hxfOeSL/24kk4Fsa3wOz0KIf3xL6zdQeS/PqE4D/sNv0LQvMlqvIFOVAE1tTSMfmoaRGCF10GIm6COksJaJ+kbLolVbJZLgm2y9KsnJM57baxcDhT9MBQc6Q9xbvmDjQ6+e4UiNLZFx47R1dklEJtF987kgV0b+JAKn9P+E1YD1v0AlxbK7DZOz7reHBZj7xkhB2C1zVvXab2XqbEXINkCllo8erR0YhwDIJJS4LZdoiyg==; 31:tcDxjN0blGHWXNN6qr/0p+4BX5dMG8kLpRghApylf3T0xl68cyscfU0JSBfRxxdkJ84tnD1RMuCDHCeBEE+qliicpS2z9vaZ/8pNIconXH5TLX+GbmRdQQwW+t34PD1GysKCm07XP1v7qZU6ROedQffnFp2jv8ZAh8n9MV7VdCTydaMefmFsOPXd+Dcb/52OgdRdOQZniatjiDMK0swqw9kWP1FTG1c/c7HNU5XCcME= X-MS-TrafficTypeDiagnostic: SN6PR07MB4384: X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4384; 20:44a9t7Cz5jvy0DPagJcT190Ll4h2SXtLH8sH0PqROcP8FeKFSqwdyxd6xgzH8h1VObon4VPV9SsmxIsHX1azIqy+3xYbiW77rZ6bWwvHpw4KP1KcgS56Ks0hwiNvOC8Bc1/YXB1p3SgI+0uxN9wL3VZdh6gqUIgYyqu5OHPVnJBdiKu5ygRUtErj6D2AuG0KffmGkMiVcq3sPjrOe4lZUrx4oHg94raTtaPwD91ACxyQ/yjasoARstIvdWZxQ13XrQi49TdpU1J5d8fcXCbJrsCU0UVxs171k3W+9r1THICsq+Itwtrn2qeGFAPb5AIrEllkOCmN2TkuCwbK9pxG+1bhBGiOfjXO44ImjBMmKILz+6tGPcZ9Y/49M5tT6R4G/kMKNhPy+WChcVlcHGquyYb3pKK7HQU9DktaEeg7hwwnWgJR01OPflEq7JeB8O9eGnBaES/hmXfO2bvGlbiZg+folAi52X9kbe4OgX1LB/RTm+4dxNSSF7sIQPeqKnifasGJDN4jxThkOSr123c/b/DK4gFUti8JWVUzNm+5J2M2PpVvDWmLoSBfejwzoDvmQsufANAavJu4FPQ1/xP/dd4QLsjv4W2c3CZAZSB8m7E=; 4:4BEk2dIr10SxNKu5doP+d8CBVgYoXpovyJBWkoY13eb+swyw2fS/+DkaCRq+44o+dkbjZcnWccjSIKifPOkUt9deM8H+JE84jyx5coJLE5Fmx04+an/vKXKcEn4edl000SgJ/qWNhyzCpUjG6s3ern086gKG0pcqEEYgT88RcqQV6dMu8rHpYYYShJQDRMUNvKUTt8iDL912uhTzvwlykJlq6YV2lcMLye9g6yWtwTm/3xaQj831B4AD67ndBEZeOxJkyKusatr96wHxYfhiK7LzFGoi8xIGEWTZkANuw5+6Wkb+ZBnawPaW+vWCxlxp X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(3231254)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:SN6PR07MB4384; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4384; X-Forefront-PRVS: 0674DC6DD3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(6069001)(376002)(346002)(39380400002)(366004)(396003)(39860400002)(199004)(189003)(478600001)(26005)(53936002)(47776003)(386003)(446003)(16586007)(42882007)(316002)(11346002)(54906003)(110136005)(956004)(39060400002)(2616005)(1076002)(97736004)(72206003)(16526019)(186003)(4326008)(5660300001)(8936002)(81166006)(81156014)(76506005)(6116002)(48376002)(8676002)(106356001)(50466002)(3846002)(50226002)(68736007)(476003)(305945005)(7736002)(105586002)(2906002)(6496006)(76176011)(7416002)(52116002)(51416003)(36756003)(7406005)(25786009)(6666003)(66066001)(6486002)(486006)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4384; H:localhost; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN6PR07MB4384; 23:Yw+vQi4V35QvzRj5wRNdmPuuz5+MatWbmU0tX1wt7?= =?us-ascii?Q?iS7B1bgcRgvj8vY3/yWu0YyKIu4nskxznqeis9rzEqL1TkprODL+XWSvj62s?= =?us-ascii?Q?KZNfByoIH0O73XPDcmEzxl8B5QZw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OlTOKmSATTF/XEVP8WxgN59q708dExwu+6OhL9A1xy42rHUrSVfwIFLt4P8PsxOZgUjqKnvwe1nzm/25r0NePvFF7xlNKEiGsFTkHlqHE/86MRvA3cPpDTg/tj4du0g8BeyOXm8N7dXScU63b/aoAPiQb/cxQy+LgYMyzesNoc0AwCReuKboqLGYw2w8g==; 5:L454j7nzkzOaEcsfjIkBabyYuHLqiN2v6KceScLOY/f0l+wueQbAh+zj3f5eFE7Lw+6Y9Z3BhDdX1SQVjWpa4lw1oMwk7HIgai7JJba6sZyxoivzvUwEGSN3bm6U5551o4e7kxbHH+nayLvrP9Ot046LrMPBlP72z3RZzH+mNSU=; 24:cpB2SFKMSWFKyQMBTt8mTBr5p2yz1z26mqBjBtQfnidaNGzu/YbBCqpmAd+JBandRyEeACbaLcbAGskTSbPg9vJNpb18kQViPMF0f+EhNMk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4384; 7:aTh+CaMiUEswPYQdSvaCFBm6RNbN0a16E0MuDOPHQx8/hSXxxb3rCykN5PYK/it8PY7vUrtt2WR1f6YNQOxpI8tJSllcNOHyQQLvHDz6wI2ENa+iT2mh4SriMFQXrZr+SSC0J7FKVZ1PHzB/Bk7uVSGf37dWhX9gANvPCFxdqLfKIaY7S2uz6x6fT+cZZpzGA4QnWIkp36Eai7OmIUW0xKt1ajnDqeydvVIopIU2T2lFdUgv4fHSPSo2WreIbtR6 X-MS-Office365-Filtering-Correlation-Id: 92d51d8a-e381-4a99-045e-08d5bb06267f X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2018 08:22:22.7068 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 92d51d8a-e381-4a99-045e-08d5bb06267f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4384 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180516_042231_993231_44844F05 X-CRM114-Status: GOOD ( 13.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Szabolcs Nagy , Heiko Carstens , Yury Norov , Philipp Tomsich , Joseph Myers , Steve Ellcey , Prasun Kapoor , Andreas Schwab , Alexander Graf , Bamvor Zhangjian , Geert Uytterhoeven , Dave Martin , Adam Borowski , Manuel Montezelo , James Hogan , Chris Metcalf , Andrew Pinski , Lin Yongting , Alexey Klimov , Mark Brown , Maxim Kuvyrkov , Florian Weimer , Nathan_Lynch , James Morse , Ramana Radhakrishnan , Martin Schwidefsky , "David S . Miller" , Christoph Muellner Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP According to userspace/kernel ABI, userspace off_t is passed in register pair just like in aarch32. In this patch corresponding aarch32 handlers are shared to ilp32 code. Signed-off-by: Yury Norov --- arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/entry32.S | 80 ------------------------ arch/arm64/kernel/entry32_common.S | 97 ++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 80 deletions(-) create mode 100644 arch/arm64/kernel/entry32_common.S diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 3114191750ae..2dde9ae508ec 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -29,6 +29,7 @@ $(obj)/%.stub.o: $(obj)/%.o FORCE arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \ sys_compat.o entry32.o binfmt_elf32.o arm64-obj-$(CONFIG_ARM64_ILP32) += binfmt_ilp32.o +arm64-obj-$(CONFIG_COMPAT) += entry32_common.o arm64-obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o arm64-obj-$(CONFIG_ARM64_MODULE_PLTS) += module-plts.o diff --git a/arch/arm64/kernel/entry32.S b/arch/arm64/kernel/entry32.S index f332d5d1f6b4..4bede0324440 100644 --- a/arch/arm64/kernel/entry32.S +++ b/arch/arm64/kernel/entry32.S @@ -39,83 +39,3 @@ ENTRY(compat_sys_rt_sigreturn_wrapper) mov x0, sp b compat_sys_rt_sigreturn ENDPROC(compat_sys_rt_sigreturn_wrapper) - -ENTRY(compat_sys_statfs64_wrapper) - mov w3, #84 - cmp w1, #88 - csel w1, w3, w1, eq - b compat_sys_statfs64 -ENDPROC(compat_sys_statfs64_wrapper) - -ENTRY(compat_sys_fstatfs64_wrapper) - mov w3, #84 - cmp w1, #88 - csel w1, w3, w1, eq - b compat_sys_fstatfs64 -ENDPROC(compat_sys_fstatfs64_wrapper) - -/* - * Note: off_4k (w5) is always in units of 4K. If we can't do the - * requested offset because it is not page-aligned, we return -EINVAL. - */ -ENTRY(compat_sys_mmap2_wrapper) -#if PAGE_SHIFT > 12 - tst w5, #~PAGE_MASK >> 12 - b.ne 1f - lsr w5, w5, #PAGE_SHIFT - 12 -#endif - b sys_mmap_pgoff -1: mov x0, #-EINVAL - ret -ENDPROC(compat_sys_mmap2_wrapper) - -/* - * Wrappers for AArch32 syscalls that either take 64-bit parameters - * in registers or that take 32-bit parameters which require sign - * extension. - */ -ENTRY(compat_sys_pread64_wrapper) - regs_to_64 x3, x4, x5 - b sys_pread64 -ENDPROC(compat_sys_pread64_wrapper) - -ENTRY(compat_sys_pwrite64_wrapper) - regs_to_64 x3, x4, x5 - b sys_pwrite64 -ENDPROC(compat_sys_pwrite64_wrapper) - -ENTRY(compat_sys_truncate64_wrapper) - regs_to_64 x1, x2, x3 - b sys_truncate -ENDPROC(compat_sys_truncate64_wrapper) - -ENTRY(compat_sys_ftruncate64_wrapper) - regs_to_64 x1, x2, x3 - b sys_ftruncate -ENDPROC(compat_sys_ftruncate64_wrapper) - -ENTRY(compat_sys_readahead_wrapper) - regs_to_64 x1, x2, x3 - mov w2, w4 - b sys_readahead -ENDPROC(compat_sys_readahead_wrapper) - -ENTRY(compat_sys_fadvise64_64_wrapper) - mov w6, w1 - regs_to_64 x1, x2, x3 - regs_to_64 x2, x4, x5 - mov w3, w6 - b sys_fadvise64_64 -ENDPROC(compat_sys_fadvise64_64_wrapper) - -ENTRY(compat_sys_sync_file_range2_wrapper) - regs_to_64 x2, x2, x3 - regs_to_64 x3, x4, x5 - b sys_sync_file_range2 -ENDPROC(compat_sys_sync_file_range2_wrapper) - -ENTRY(compat_sys_fallocate_wrapper) - regs_to_64 x2, x2, x3 - regs_to_64 x3, x4, x5 - b sys_fallocate -ENDPROC(compat_sys_fallocate_wrapper) diff --git a/arch/arm64/kernel/entry32_common.S b/arch/arm64/kernel/entry32_common.S new file mode 100644 index 000000000000..6ef4752162d0 --- /dev/null +++ b/arch/arm64/kernel/entry32_common.S @@ -0,0 +1,97 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +/* + * Compat system call wrappers + * + * Copyright (C) 2012 ARM Ltd. + * Authors: Will Deacon + * Catalin Marinas + */ + +#include +#include + +#include +#include +#include +#include + +/* + * Note: off_4k (w5) is always in units of 4K. If we can't do the + * requested offset because it is not page-aligned, we return -EINVAL. + */ +ENTRY(compat_sys_mmap2_wrapper) +#if PAGE_SHIFT > 12 + tst w5, #~PAGE_MASK >> 12 + b.ne 1f + lsr w5, w5, #PAGE_SHIFT - 12 +#endif + b sys_mmap_pgoff +1: mov x0, #-EINVAL + ret +ENDPROC(compat_sys_mmap2_wrapper) + +/* + * Wrappers for AArch32 syscalls that either take 64-bit parameters + * in registers or that take 32-bit parameters which require sign + * extension. + */ +ENTRY(compat_sys_pread64_wrapper) + regs_to_64 x3, x4, x5 + b sys_pread64 +ENDPROC(compat_sys_pread64_wrapper) + +ENTRY(compat_sys_pwrite64_wrapper) + regs_to_64 x3, x4, x5 + b sys_pwrite64 +ENDPROC(compat_sys_pwrite64_wrapper) + +ENTRY(compat_sys_truncate64_wrapper) + regs_to_64 x1, x2, x3 + b sys_truncate +ENDPROC(compat_sys_truncate64_wrapper) + +ENTRY(compat_sys_ftruncate64_wrapper) + regs_to_64 x1, x2, x3 + b sys_ftruncate +ENDPROC(compat_sys_ftruncate64_wrapper) + +ENTRY(compat_sys_readahead_wrapper) + regs_to_64 x1, x2, x3 + mov w2, w4 + b sys_readahead +ENDPROC(compat_sys_readahead_wrapper) + +ENTRY(compat_sys_fadvise64_64_wrapper) + mov w6, w1 + regs_to_64 x1, x2, x3 + regs_to_64 x2, x4, x5 + mov w3, w6 + b sys_fadvise64_64 +ENDPROC(compat_sys_fadvise64_64_wrapper) + +ENTRY(compat_sys_sync_file_range2_wrapper) + regs_to_64 x2, x2, x3 + regs_to_64 x3, x4, x5 + b sys_sync_file_range2 +ENDPROC(compat_sys_sync_file_range2_wrapper) + +ENTRY(compat_sys_fallocate_wrapper) + regs_to_64 x2, x2, x3 + regs_to_64 x3, x4, x5 + b sys_fallocate +ENDPROC(compat_sys_fallocate_wrapper) + +ENTRY(compat_sys_statfs64_wrapper) + mov w3, #84 + cmp w1, #88 + csel w1, w3, w1, eq + b compat_sys_statfs64 +ENDPROC(compat_sys_statfs64_wrapper) + +ENTRY(compat_sys_fstatfs64_wrapper) + mov w3, #84 + cmp w1, #88 + csel w1, w3, w1, eq + b compat_sys_fstatfs64 +ENDPROC(compat_sys_fstatfs64_wrapper)