From patchwork Tue Sep 29 22:14:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 7291091 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 63D199F1D5 for ; Tue, 29 Sep 2015 22:35:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29F3220685 for ; Tue, 29 Sep 2015 22:35:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DB34E2067D for ; Tue, 29 Sep 2015 22:35:26 +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 1Zh3T0-0002u6-T4; Tue, 29 Sep 2015 22:33:46 +0000 Received: from mail-by2on0066.outbound.protection.outlook.com ([207.46.100.66] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zh3Ea-0004Cg-7n for linux-arm-kernel@lists.infradead.org; Tue, 29 Sep 2015 22:18:54 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (91.78.158.8) by DM2PR07MB623.namprd07.prod.outlook.com (10.141.177.148) with Microsoft SMTP Server (TLS) id 15.1.280.20; Tue, 29 Sep 2015 22:18:28 +0000 From: Yury Norov To: , , , , , Subject: [PATCH v5 19/23] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Date: Wed, 30 Sep 2015 01:14:16 +0300 Message-ID: <1443564860-31208-20-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1443564860-31208-1-git-send-email-ynorov@caviumnetworks.com> References: <1443564860-31208-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [91.78.158.8] X-ClientProxiedBy: AM3PR07CA0016.eurprd07.prod.outlook.com (10.141.45.144) To DM2PR07MB623.namprd07.prod.outlook.com (10.141.177.148) X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB623; 2:S3AiTqDMryMk8z9FEIAbOW5DsokN/y2ifQW7cPfwGP/jZqi9PBddxhDEQxJW4uBp5lm9IlCQDDgKbbKbGKGyY9vbN5wdMtGS/gyMRZZo7IO8Ps4ojRJ4t8nVLplhOCNZBjZRpSinTdqbNJO7w9h352vBJEIxfidWv40sQBvNDqM=; 3:tWbmq94+V/d4T7Y/x/o9OCKG1gOXYugNRzl+r/kNHSf9ZSmIb1RE99NxHUW7bQyl+TQmxVKgactjERkQhqXe/190r/Ekg1KavOdA3Zm1DYnKKKSKqJm9q2FRyLs8NLjG5eiA3mQLcDQH1vd+ZGDSHQ==; 25:Rl4/0xzHM5wV5xzFuAPp35Pghnf4AO+xOV01z3lQAO7HjyjjhhIDWgcSYSDNSMSEPg+UOF3AiEgJDgRyNwqSEfWMqOZQhzApCUfpA6QR/BZPQlZPVuIeBhqLW7We3GBKQ52ZECEciHVQ5tKfZ49s1KmO8xQPuLJ6qA5NONksx7IRAUqO9Tiav/ygLAoAnBiLvBGUvFC0WHiK2Ld/A6YueVbbCAFSAoAu2M5XRFHcdLIu7qJR1/6P2WHBt/VA5MpY X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR07MB623; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB623; 20:/7AGjAEDbwU7Zqmd7x0tTo+nDaJmROsT893zN1Q6nX6SkOuVlHYKCgRsL05Dl9tZdOEUKgILPWw9RIcsCvmiHp0hsUeDUCWmDPfoedVjaE9OCQCfEyOBmZXDF7VMrKz1mPvBPaekH9PcjwhgcmTYnRhUbZVTka8mXHzOWJfpdCBiH5xZxNWXbYN41gUtlBmeqz+QjgV5qETfQhL4qgevOmmoT3ybSEOmDv6i9GacKr4PSFH71roIVNoshnSh2tZaf2VfCu3hFquGHf/pJyKMRYb5I/capAyfIyG9EWfx44+LB7xBhudB9m0UabhadNWFNoEACk4i45i2ot5YcCse8EMYl0xALA27HHEjfi1zDdWrZeONr1FLMcMwV2S19XiG69Xr7kFi0cgtgR0KB74PyHXoPa3eSbmH1oTOq8O9GT6Da7iUR4eGaESmYoNMJA537PD0W5nm5k2A2Rux5h266+ym1afrOpgrU+RvzXmFWyegrFogr7BHQu0TXFtG6fSSwF96wc9hhiFjPtIcCaIbYPAzOAOQl2hZ1Zv9E8Oa3NQLim7MlRorEo/4MOhH5m4gvgfdOL7on3Er/wWJv++Ao1BiLpyN3NyjSl3DTk7LWBE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001); SRVR:DM2PR07MB623; BCL:0; PCL:0; RULEID:; SRVR:DM2PR07MB623; X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB623; 4:rxzToGYCuc8GgxRRQT0jZzpKUh4BL9xew3+eE+BJBTFHRk2VxayKTrpo1PNMkWtSF8sXsHh1LFFeBqK2ifb75/fgGNr9szTK7QSjtZAI8qyxsZ4FlC5hA8rzHM3ZQqHIdgkqCAAXSXyp6nhXYiG/y7Ir/QvYuEIJywjmadMd9tD9MZHGCKvbGtLeUyqwP2+F3oDIA/CJxzLuqKngsOJY0IGuTX59kRIH4W/++5jS0SFDLPQ/qY/l/2fOlBlbuTUvWkXGJM5HNoKRmQsbnpJGbjKVG6WLp6dRCGSpx/mS7kvtqzV1P64HspQDYsMicByewlFvdL7iNVcmJ0oRMHAJEyl/3TxOTKgrB8Fu6pzsAuk= X-Forefront-PRVS: 0714841678 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(189002)(199003)(48376002)(107886002)(2950100001)(19580405001)(64706001)(229853001)(97736004)(19580395003)(66066001)(106356001)(92566002)(77096005)(33646002)(47776003)(77156002)(76506005)(15975445007)(42186005)(87976001)(68736005)(62966003)(105586002)(50986999)(40100003)(46102003)(2201001)(101416001)(50466002)(4001540100001)(81156007)(76176999)(5003940100001)(5001830100001)(5001860100001)(5007970100001)(189998001)(5001960100002)(5004730100002)(5001770100001)(5001920100001)(36756003)(50226001)(5008740100001)(122386002)(2004002)(2101003)(4001430100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR07MB623; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR07MB623; 23:+juP0Hmy6tQ3scIttMS+pplfrn+oPHaxujJly/Ss+s?= =?us-ascii?Q?SUzS5CiKozx4HLtNQtir1bmFRq//TQK/ShIOnKJRT9GL4dyCipklAYviU+bz?= =?us-ascii?Q?AgFpB/gFLSQTLGacEKdmUZ2bMNNOfQ11AJh5bGp5HcbK0afUOnGtQVdA0Hfu?= =?us-ascii?Q?CPxJrXhW+fNWH+5QGE8zcEB1IuDbBZ8PphYoqyrpIo18dH55zwBhKxLqjUCh?= =?us-ascii?Q?KgiZzeYZb0Aw6NL8lanm9mryRtChkDvw9+QL41/nLuxh4m5FIS1yO8yibX4n?= =?us-ascii?Q?hacf8Q4blD5mFq/1xX6W7JG3EyvTP78Sev1cYnluw6axTebgZszmpGUUQ9VJ?= =?us-ascii?Q?kDcLJ6BISVxrmrdPOJtphM7BA6/+pvHJpSI33Y6OFuNOwP284BgZgTAMoDlX?= =?us-ascii?Q?AZLsCaokbB1uW1nPtkxc0KGux5lYD9DU5g5vdnDey02GJSflgsnm7quNIsjC?= =?us-ascii?Q?0Av3vgv6bfGc+7ddrZ7aJ/fXAaOMh6z1a8IFGBg7iEjcqNClBKbVfHlfeoIY?= =?us-ascii?Q?YForuWytVh170ruH1zkhZs4gMA1eggklGuZ2oZ4JbHiqe626CbRCbdoKCHyI?= =?us-ascii?Q?BTvyjUkM31bw/BkSVaa6WegVd1/HG95YaJ7gMcd1gXsy1lDNrQYCLSig4Ub6?= =?us-ascii?Q?fbGewGQfx8qGbYU42oILThQGJvIhD6xYGiHXzyo4k/N+3sf2umTbGUuuFqv3?= =?us-ascii?Q?D6ifv4cV/JlW9iDG42VP1UMUaONCUoFq7IHe3+6g3f5EU+LuE8boz9p+1N6B?= =?us-ascii?Q?R68MCCUg7EvE60AcUmIMPzJ6vSYsHfBjBu/95ncdWS3ozyNSC/fJk+QA+GS3?= =?us-ascii?Q?IKtqJ2fpti8Rb/VPTQhhKGROeWqcxJSZVtoGBQlEfBOybSM4ZHOx/9qW54/H?= =?us-ascii?Q?Amj+q2mDQX3uMunjD6I34ORu5MnO8IeCbRegR6qXrDJQTJafk++uG4/Duoj+?= =?us-ascii?Q?/EV9ZHeJAO/7XYwbSmzSCFF4CYlTXk7rKtfUGMww77ZOJOAuR/+1mO44hIqz?= =?us-ascii?Q?RLW+kdOW2BPhflWV0OST+433I6ZojWaUHR/vbVg8rPKRqKlR/DmU7FBexr5V?= =?us-ascii?Q?LAJx0fzlazMT4vl8OUmlxDsWkJjvj+6hOAAELDThY6CSwUShybMj862pMmJN?= =?us-ascii?Q?RkG0AeFziGhICVNw4sQgi2EG7SK8MN9XneTWGb8t/JphxS3TyG7+AnbpOxlc?= =?us-ascii?Q?n0I4fzW5fbArLpwz0+ZfdHnoi5Fes27zcn9+XXLHvYhI1l4OXzdX8SnlkdWA?= =?us-ascii?Q?vJlORbxC1rYU7QPDdEWz1ZrRbwxMVQqF1TrCgN7fyYSFP4rQ5i18LeKtjGBe?= =?us-ascii?Q?7P5xmZB7N0laGfQRPY9l6AKy5Gos6OY+56kNMp7wO0KWv8jbA2F7O7oYXaeu?= =?us-ascii?Q?XFKS3Ok0EWjvEcFpO1Eemxzp8=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR07MB623; 5:wtxP+ZYul6bLyy8VlVpFy7LaeeijOkzjFoxgRxBV4HbiM6zeMKZrzBJ+rnWbgcUIRVekzZYsBTqKfuJOespwkLgWCtvT5VKJDdFFyq49n7/Wb79DwlvM9leZIml3MRulFzfOx105722FZYk8zGLRQg==; 24:LRmXPTLNtD92eJdHglwG2aZGGhCiZ9+MjteZ/OMAr8Jwm8eCMkj1Ifn9onQo++/N66LyfAxaHvaJG7Cvt3y5OVnvBZ7EClBkMJAdnFJ1Blg=; 20:lURMtG3L5+Y47KyNWpF8gin50qCDTTlsGfmS0vCNzeB3gANXOauANKHj4BX9RLzkjL/zzj2Wh9mpCIUZCZB8XA== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2015 22:18:28.9414 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR07MB623 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150929_151852_433141_C8C4E699 X-CRM114-Status: GOOD ( 16.98 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yury.norov@gmail.com, klimov.linux@gmail.com, Yury Norov , apinski@cavium.com, philipp.tomsich@theobroma-systems.com, christoph.muellner@theobroma-systems.com 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=BAD_ENC_HEADER,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 Add a separate syscall-table for ILP32, which dispatches either to native LP64 system call implementation or to compat-syscalls, as appropriate. This revision of the patch now addresses Catalin's comment regarding the duplicate reading of the task-flags in the el0_svc-handler and simply relies on the flags having been read by the kernel_entry macro. Signed-off-by: Philipp Tomsich Signed-off-by: Christoph Muellner Signed-off-by: Yury Norov create mode 100644 arch/arm64/kernel/sys_ilp32.c diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index 759c433..31eabf1 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h @@ -13,6 +13,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#ifdef CONFIG_ARM64_ILP32 +#define __ARCH_WANT_COMPAT_SYS_PREADV64 +#define __ARCH_WANT_COMPAT_SYS_PWRITEV64 +#endif #ifdef CONFIG_AARCH32_EL0 #define __ARCH_WANT_COMPAT_SYS_GETDENTS64 #define __ARCH_WANT_COMPAT_STAT64 diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index ff60c2f..a1cbb11 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -24,6 +24,7 @@ arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \ sys_compat.o entry32.o \ ../../arm/kernel/opcodes.o arm64-obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o +arm64-obj-$(CONFIG_ARM64_ILP32) += sys_ilp32.o arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o arm64-obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o arm64-obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 52be5c8..bcd921a 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -664,9 +664,13 @@ ENDPROC(ret_from_fork) */ .align 6 el0_svc: - adrp stbl, sys_call_table // load syscall table pointer uxtw scno, w8 // syscall number in w8 mov sc_nr, #__NR_syscalls +#ifdef CONFIG_ARM64_ILP32 + ldr x16, [tsk, #TI_FLAGS] + tbnz x16, #TIF_32BIT_AARCH64, el0_ilp32_svc // We are using ILP32 +#endif + adrp stbl, sys_call_table // load syscall table pointer el0_svc_naked: // compat entry point stp x0, scno, [sp, #S_ORIG_X0] // save the original x0 and syscall number enable_dbg_and_irq @@ -686,6 +690,12 @@ ni_sys: b ret_fast_syscall ENDPROC(el0_svc) +#ifdef CONFIG_ARM64_ILP32 +el0_ilp32_svc: + adrp stbl, sys_call_ilp32_table // load syscall table pointer + b el0_svc_naked +#endif + /* * This is the really slow path. We're going to be doing context * switches, and waiting for our parent to respond. diff --git a/arch/arm64/kernel/sys_ilp32.c b/arch/arm64/kernel/sys_ilp32.c new file mode 100644 index 0000000..623191a --- /dev/null +++ b/arch/arm64/kernel/sys_ilp32.c @@ -0,0 +1,178 @@ +/* + * AArch64- ILP32 specific system calls implementation + * + * Copyright (C) 2013 Cavium Inc. + * Author: Andrew Pinski + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Wrappers to pass the pt_regs argument. + */ +asmlinkage long sys_rt_sigreturn_wrapper(void); +#define sys_rt_sigreturn sys_rt_sigreturn_wrapper + +/* Using Compat syscalls where necessary */ +#define sys_ioctl compat_sys_ioctl +/* iovec */ +#define sys_readv compat_sys_readv +#define sys_writev compat_sys_writev +#define sys_preadv compat_sys_preadv64 +#define sys_pwritev compat_sys_pwritev64 +#define sys_vmsplice compat_sys_vmsplice +/* robust_list_head */ +#define sys_set_robust_list compat_sys_set_robust_list +#define sys_get_robust_list compat_sys_get_robust_list + +/* kexec_segment */ +#define sys_kexec_load compat_sys_kexec_load + +/* Ptrace has some structures which are different between ILP32 and LP64 */ +#define sys_ptrace compat_sys_ptrace + +/* struct msghdr */ +#define sys_recvfrom compat_sys_recvfrom +#define sys_recvmmsg compat_sys_recvmmsg +#define sys_sendmmsg compat_sys_sendmmsg +#define sys_sendmsg compat_sys_sendmsg +#define sys_recvmsg compat_sys_recvmsg + +#define sys_setsockopt compat_sys_setsockopt +#define sys_getsockopt compat_sys_getsockopt + +/* Array of pointers */ +#define sys_execve compat_sys_execve +#define sys_move_pages compat_sys_move_pages + +/* iovec */ +#define sys_process_vm_readv compat_sys_process_vm_readv +#define sys_process_vm_writev compat_sys_process_vm_writev + +/* Pointer in struct */ +#define sys_mount compat_sys_mount + +/* NUMA */ +/* unsigned long bitmaps */ +#define sys_get_mempolicy compat_sys_get_mempolicy +#define sys_set_mempolicy compat_sys_set_mempolicy +#define sys_mbind compat_sys_mbind +/* array of pointers */ +/* unsigned long bitmaps */ +#define sys_migrate_pages compat_sys_migrate_pages + +/* Scheduler */ +/* unsigned long bitmaps */ +#define sys_sched_setaffinity compat_sys_sched_setaffinity +#define sys_sched_getaffinity compat_sys_sched_getaffinity + +/* iov usage */ +#define sys_keyctl compat_sys_keyctl + +/* aio */ +/* Pointer to Pointer */ +#define sys_io_setup compat_sys_io_setup +/* Array of pointers */ +#define sys_io_submit compat_sys_io_submit + +/* We need to make sure the pointer gets copied correctly. */ +asmlinkage long ilp32_sys_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification) +{ + struct sigevent __user *p = NULL; + if (u_notification) { + struct sigevent n; + p = compat_alloc_user_space(sizeof(*p)); + if (copy_from_user(&n, u_notification, sizeof(*p))) + return -EFAULT; + if (n.sigev_notify == SIGEV_THREAD) + n.sigev_value.sival_ptr = compat_ptr((uintptr_t)n.sigev_value.sival_ptr); + if (copy_to_user(p, &n, sizeof(*p))) + return -EFAULT; + } + return sys_mq_notify(mqdes, p); +} + +/* sigevent contains sigval_t which is now 64bit always + but need special handling due to padding for SIGEV_THREAD. */ +#define sys_mq_notify ilp32_sys_mq_notify + + +/* sigaltstack needs some special handling as the + padding for stack_t might not be non-zero. */ +long ilp32_sys_sigaltstack(const stack_t __user *uss_ptr, + stack_t __user *uoss_ptr) +{ + stack_t uss, uoss; + int ret; + mm_segment_t seg; + + if (uss_ptr) { + if (!access_ok(VERIFY_READ, uss_ptr, sizeof(*uss_ptr))) + return -EFAULT; + if (__get_user(uss.ss_sp, &uss_ptr->ss_sp) | + __get_user(uss.ss_flags, &uss_ptr->ss_flags) | + __get_user(uss.ss_size, &uss_ptr->ss_size)) + return -EFAULT; + /* Zero extend the sp address and the size. */ + uss.ss_sp = (void *)(uintptr_t)(unsigned int)(uintptr_t)uss.ss_sp; + uss.ss_size = (size_t)(unsigned int)uss.ss_size; + } + seg = get_fs(); + set_fs(KERNEL_DS); + /* Note we need to use uoss as we have changed the segment to the + kernel one so passing an user one around is wrong. */ + ret = sys_sigaltstack((stack_t __force __user *) (uss_ptr ? &uss : NULL), + (stack_t __force __user *) &uoss); + set_fs(seg); + if (ret >= 0 && uoss_ptr) { + if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_t)) || + __put_user(uoss.ss_sp, &uoss_ptr->ss_sp) || + __put_user(uoss.ss_flags, &uoss_ptr->ss_flags) || + __put_user(uoss.ss_size, &uoss_ptr->ss_size)) + ret = -EFAULT; + } + return ret; +} + +/* sigaltstack needs some special handling as the padding + for stack_t might not be non-zero. */ +#define sys_sigaltstack ilp32_sys_sigaltstack + + +#include + +#undef __SYSCALL +#define __SYSCALL(nr, sym) [nr] = sym, + +asmlinkage long sys_mmap(unsigned long addr, unsigned long len, + unsigned long prot, unsigned long flags, + unsigned long fd, off_t off); + +/* + * The sys_call_ilp32_table array must be 4K aligned to be accessible from + * kernel/entry.S. + */ +void *sys_call_ilp32_table[__NR_syscalls] __aligned(4096) = { + [0 ... __NR_syscalls - 1] = sys_ni_syscall, +#include +};