From patchwork Thu Nov 29 08:43:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 152377 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2115115ljp; Thu, 29 Nov 2018 00:44:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/WgmqdwqS7OxgPIBIYakeGvYS7E1t0p5FvYUBVzg0dEjyvcILxfsRhhN2XjdW9zkbDgR6Xr X-Received: by 2002:aa7:868f:: with SMTP id d15mr523347pfo.225.1543481063246; Thu, 29 Nov 2018 00:44:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543481063; cv=none; d=google.com; s=arc-20160816; b=grRUrmGIqpnPvQfYUgbrIQSrltCDFAeEYCK0quGrdg9eqiKLs0H562INg4wG0hHJUh 8vcVSaGxqJY12i2anQNwBAEPfnk//MFkVYUsADjQvHPcC5+odt/I/XRuA6iK9D+0c/LZ v/i7OWm+5MEMt4EgMLjmQxjUSa/u0JsJkS2V9odpVwhj8WqdIfGASpwm29z/sOgCNtp4 uG/jhqo8oxmHeZwKIQaRnaPFHljOu4ApOaDUHTEjWynBxaV8zMyagofxhhLjp6QB5LPt /WL5iTtw8Nvk4kF7jrO9gRWhs9wRE6eXhRAQnYYHKGVDrA92anO6GUwj6xLytwUgU34M /HFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=YFkH6BiVFMb84PF3sgPw/qdfk9RQVU5JUMVa27R0rjA=; b=bEM5WUJPsZsbLEeoYTnNpOByIM3vis0ZxqHsWhG6+IgNhPGW9RidR316lI2LdPU3Cl fij5laSKU2NSXwetmxBGIe/xT9uFDu3vihmbWuHsSWSKpGO2k2jKtvW6iNwyZq7JKgGw LqN1amO9l5m3CYkgCt8h97U+DjO9xlQOe7Yji0E9lFh82hl+nFXiAFRl5siTTr5BXDsP f8reLl/SHNL6UFqc5rl4aswGqPV1vdYyV6BMyQOj+acFWuB38le7+Meym2pmSbamVMBw WdueeCjsEKMt56cKkRieMVM22QsneYvv8A1SPVpi7lja+WJp0sfLgUQ7PQV6kKOfC3TL kXGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DhrhxN5n; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h16si1414020pgh.283.2018.11.29.00.44.22; Thu, 29 Nov 2018 00:44:23 -0800 (PST) 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=@linaro.org header.s=google header.b=DhrhxN5n; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727603AbeK2Ts5 (ORCPT + 32 others); Thu, 29 Nov 2018 14:48:57 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:45579 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726789AbeK2Ts5 (ORCPT ); Thu, 29 Nov 2018 14:48:57 -0500 Received: by mail-pl1-f196.google.com with SMTP id a14so665387plm.12 for ; Thu, 29 Nov 2018 00:44:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YFkH6BiVFMb84PF3sgPw/qdfk9RQVU5JUMVa27R0rjA=; b=DhrhxN5n8teCFA7v8nZRiQu16yHWm1E4p6mrtVuf/P10ftxWDObBJJR5NPa7K0cRDY z74dFrJzVBD6MChogCw7s96gRNgenl9iJwFeADIfvp3jrq3PZjcS+nZXFnQE08eJiT1C 91AjGDL7+Kx7ZAR2tzKkGNPqTeTc/Y0gU0JWA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YFkH6BiVFMb84PF3sgPw/qdfk9RQVU5JUMVa27R0rjA=; b=GmpgsHvfJ9UVbR6IJKlFYy0jTuYfK1o+/TBeOhLk+LOsfXjbXiLx5bP9rU70WKq82Q nE2dt7/9mT/cKp8bumksqrY7Y76gMUHgLj1ykNxXOfCpt4kLxflj+kZ6bv0jACCUmMMC oSLkFrUYU7qtfgXIcOi1wnSgG9TRnpyTeaBXquur0VKZr8frHX6DDW1HYGjw+rXdhZkk M/37llIQODJ3DxOCbIotRpuXOP2zFwQuUhOb1sTosRyXrsjTmfwE+/juht0rDWl8Md+t xL74IwO0sozqAgFid0rtkW7s4e3nBakrt4Wipnls8ZgNarYfQJlW51Jg9ZawyItR18ur KcyA== X-Gm-Message-State: AA+aEWajQeTEIKSitxPUF3aNg0JW6XqED365qEeG7ocWHdy+i/1oPYrh LLFTaGKZAmulibXkgquERG+LEA== X-Received: by 2002:a17:902:25ab:: with SMTP id y40-v6mr586719pla.258.1543481060271; Thu, 29 Nov 2018 00:44:20 -0800 (PST) Received: from qualcomm-HP-ZBook-14-G2.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 73-v6sm2322683pfl.142.2018.11.29.00.44.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Nov 2018 00:44:19 -0800 (PST) From: Firoz Khan To: linux-mips@linux-mips.org, Ralf Baechle , Paul Burton , James Hogan , Greg Kroah-Hartman , Philippe Ombredanne , Thomas Gleixner , Kate Stewart Cc: y2038@lists.linaro.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, deepa.kernel@gmail.com, marcin.juszkiewicz@linaro.org, firoz.khan@linaro.org Subject: [PATCH v3 1/6] mips: add __NR_syscalls along with __NR_Linux_syscalls Date: Thu, 29 Nov 2018 14:13:31 +0530 Message-Id: <1543481016-18500-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543481016-18500-1-git-send-email-firoz.khan@linaro.org> References: <1543481016-18500-1-git-send-email-firoz.khan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __NR_Linux_syscalls macro holds the number of system call exist in mips architecture. We have to change the value of __NR_Linux_syscalls, if we add or delete a system call. One of the patch in this patch series has a script which will generate a uapi header based on syscall.tbl file. The syscall.tbl file contains the total number of system calls information. So we have two option to update __NR- _Linux_syscalls value. 1. Update __NR_Linux_syscalls in asm/unistd.h manually by counting the no.of system calls. No need to update __NR_Linux_syscalls until we either add a new system call or delete existing system call. 2. We can keep this feature it above mentioned script, that will count the number of syscalls and keep it in a generated file. In this case we don't need to expli- citly update __NR_Linux_syscalls in asm/unistd.h file. The 2nd option will be the recommended one. For that, I added the __NR_syscalls macro in uapi/asm/unistd.h along with __NR_Linux_syscalls. The macro __NR_syscalls also added for making the name convention same across all architecture. While __NR_syscalls isn't strictly part of the uapi, having it as part of the generated header to simplifies the implementation. We also need to enclose this macro with #ifdef __KERNEL__ to avoid side effects. Signed-off-by: Firoz Khan --- arch/mips/include/uapi/asm/unistd.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h index f25dd1d..6914be5 100644 --- a/arch/mips/include/uapi/asm/unistd.h +++ b/arch/mips/include/uapi/asm/unistd.h @@ -391,11 +391,14 @@ #define __NR_rseq (__NR_Linux + 367) #define __NR_io_pgetevents (__NR_Linux + 368) +#ifdef __KERNEL__ +#define __NR_syscalls 368 +#endif /* * Offset of the last Linux o32 flavoured syscall */ -#define __NR_Linux_syscalls 368 +#define __NR_Linux_syscalls __NR_syscalls #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ @@ -738,10 +741,14 @@ #define __NR_rseq (__NR_Linux + 327) #define __NR_io_pgetevents (__NR_Linux + 328) +#ifdef __KERNEL__ +#define __NR_syscalls 328 +#endif + /* * Offset of the last Linux 64-bit flavoured syscall */ -#define __NR_Linux_syscalls 328 +#define __NR_Linux_syscalls __NR_syscalls #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ @@ -1088,10 +1095,14 @@ #define __NR_rseq (__NR_Linux + 331) #define __NR_io_pgetevents (__NR_Linux + 332) +#ifdef __KERNEL__ +#define __NR_syscalls 332 +#endif + /* * Offset of the last N32 flavoured syscall */ -#define __NR_Linux_syscalls 332 +#define __NR_Linux_syscalls __NR_syscalls #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */