Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1695569imm; Wed, 16 May 2018 01:29:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZryUj7eZPWo+X77kchnRYVILCZ+K1fIC/BUl6FpyWyHmX+YAtjeh93+GD6gSWH+znGVYfKP X-Received: by 2002:a62:5d99:: with SMTP id n25-v6mr18835570pfj.143.1526459354007; Wed, 16 May 2018 01:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526459353; cv=none; d=google.com; s=arc-20160816; b=OUgEVQ63vWuzl/LI0ZLADTvheAl4eIuwY9EFuJ812TqFLxP1nCwpCZ0k35uc9fb+zi 4pbizQxEUcBHj13mUAQX7kUS5QAavnQOjekMaFuoLFaoYctwLfFRaX/VLsS18xqUGL/r +uj5pz9XzAPmpdt6w0VFFpXqlQU1SeD/2IAAybtyzgC09HchWdfVZkxqN+fSuMsX6lzy /ao9u8oSehwDml/OQ5cbD+lSS3fQFd+2VYeqPcVzWQoTXWoGAuNX4Ou6TWtnb6esUsYT CQH+PWnRlcoF6/yj4PGqO9B2QrXpA6Q0mBNhN0P4nfy6VW4P+QMtEhIyL5/PPSMsnXAT xEjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=MoulHWZtZ+nLTwYDIyk2ZpsgCVOqVTy2dYWsCjnisFI=; b=D74zobUix7H3viIveVzAFAHOsrL9EIeerjsKSWFQiW8iNUYuQGQc9tECzGIjW5D7TN G9lCxxUvVr8D/W2hRnTex9otvKQAj32oM/3dy4jliBpeFeH+7W2EaqvSW32OcQZReDCs D5v5eFqzVnQwMVVyAfD223rL+f81Xv6M6+NqVN1SqIClVk0GPMxzDinJU8FZF811VXVD ruvkRJFaFEw1MjDlrgkTncdfLllJ7ptVwXxkviiorJ4O9bTORRztQUaE+10xwE8FJ4ip T7F4csmhFL27Js5G4H07R71T1RxkPq/JdaZRMk0nsBlGu18y123FuQSc1UwD9Jf2l7V4 Bc0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=MermSLEp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8-v6si1659600pgs.24.2018.05.16.01.28.59; Wed, 16 May 2018 01:29:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=MermSLEp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753081AbeEPI1H (ORCPT + 99 others); Wed, 16 May 2018 04:27:07 -0400 Received: from mail-by2nam01on0078.outbound.protection.outlook.com ([104.47.34.78]:2806 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752734AbeEPIW0 (ORCPT ); Wed, 16 May 2018 04:22:26 -0400 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 Cc: Yury Norov , Adam Borowski , Alexander Graf , Alexey Klimov , Andreas Schwab , Andrew Pinski , Bamvor Zhangjian , Chris Metcalf , Christoph Muellner , Dave Martin , "David S . Miller" , Florian Weimer , Geert Uytterhoeven , Heiko Carstens , James Hogan , James Morse , Joseph Myers , Lin Yongting , Manuel Montezelo , Mark Brown , Martin Schwidefsky , Maxim Kuvyrkov , Nathan_Lynch , Philipp Tomsich , Prasun Kapoor , Ramana Radhakrishnan , Steve Ellcey , Szabolcs Nagy 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 Content-Type: text/plain 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?KZNfByoIH0O73XPDcmEzxl8B5QZwf1+89ed4fxIsqE0bZRaqhtOtn54aqyyA?= =?us-ascii?Q?B34ZoHkzQJ6e8wqKW8UKBXSM6rClEyPF93OqEwnCSejIeBPgcetT0GIG6cBH?= =?us-ascii?Q?0y40M+eX4z0D3i2ysFYRCiFRLB3iFlVUzs2BbwCCII2kfyR8PfacyyNYkqdP?= =?us-ascii?Q?NOBslpPYYtvH2JlG1i7pslvzKiclQUrzURf18bjfr3ESdJhRY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3f5eFE7Lw+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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.17.0