From patchwork Thu Dec 13 09:07:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 153614 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp570538ljp; Thu, 13 Dec 2018 01:08:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/XDBy/Hh7m4XKAfH7nzTSjt4h90p+E+o+fbzr5I38Dgcz3aU2sS7Km59/tNjvUKL1SmcTqi X-Received: by 2002:a63:6006:: with SMTP id u6mr1441835pgb.176.1544692104163; Thu, 13 Dec 2018 01:08:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544692104; cv=none; d=google.com; s=arc-20160816; b=ZX2dTGjwcBnbo2fdEtvb1MefyvmJN6B0T/oegVcA/a6yhVyn08NdRZyVurhPjtZu9I 7iRpRINOB1faqrV54aUsX7rV/kwdA1eTDfwpkLGGlz1XKt8I0HeszM9keyy7s1Daa2mg dcgDNIn41OiCnwhrbcIdcXOhVu4ofBLDvuyzCYpUSE4dAH/4auig4hgUuNsixjps19ay ey5l88fHTlXdmp5eHYTqgzZkS73OArusH8zM8nYHv+jsNLkInbgpP//k/osksMPmDiqR 18ynORnfKdoR4tZKhwhm4wUgs4+OXoVv77NSdVKa1a6Jo5tY9CdRnY9T2xN2ZgOaYy/m 0/3g== 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=Wb417OnKCsAl4Z/fCyj9gp3MECWD1xdJ22nGeHzLHlQ6vD1B5Gy1QQ4bcuOxEInWw1 Om60nZsfPrmCKU26MaawKm6mJrJsWOFrJ2O+simCZf4yc81ys2QdD0MQyMEmj703okOn yi5EfG7WofKlB5O/j+BX6QxuryZZkcDHVGZauSMqaOPQxtO/xj7m04Um3GE8zzf132Pw gvyw5gHQf2xdm0t+3+1HiJAc9clW0AayhWrabSSVgryzNiYmHHVPqRyvKAB7cQNbu8ii XiofuG9FrKv/MhAYptM1bz6zjX/fvwcboSoULNIXUy3wjG9FOboxsPU/HTfX+sUBu8pA odcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IhSrxQMu; 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 w189si1143573pfb.151.2018.12.13.01.08.23; Thu, 13 Dec 2018 01:08:24 -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=IhSrxQMu; 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 S1727652AbeLMJIW (ORCPT + 31 others); Thu, 13 Dec 2018 04:08:22 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42610 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726976AbeLMJIW (ORCPT ); Thu, 13 Dec 2018 04:08:22 -0500 Received: by mail-pl1-f195.google.com with SMTP id y1so756003plp.9 for ; Thu, 13 Dec 2018 01:08:21 -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=IhSrxQMuCOQLwK9hBOPySYeyDIBdlRzA71tgiq8HpRugLsZ1KbEeLsR9uBw+6szAPJ r2haCgnE0UaswOHrXGx84k/W5pWswFr57YryDLfmx9IQAs+1XN0mmGV/39HhrweqZsQe iDA4dT5b6g0nFVvriIGFdSiY5P7HWfPezlrs8= 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=I9AZKImfB9D6ZPGwXo4i6uJRzkjBQyVkF9oGNun7FXN79jl72jeLAnr9mKAcyF41eO /VO5AY+QWpedJuAOiELbf0N5LQi/fQaYJmJRzts4GSTbhcumpC/dys3T8EGBIxz/cSY/ If8sfzhsMhZTnNEIHGIK+I4PHbPmcN4R6clqcbhE2fAlShEmj+QsC7Dazx3SMvYsjRg/ vUBo/WQpk3MW4WmoK3UDbV5xxq0IK5L6CQiSfdd7R+V3dis/YfzGNI4RvDTuGGaYo/pC KQG7b6DWQ6zjTmpGoq+fMo89NyWbAzYlGsgzY/d4iVKRSe1XaLb5zcXC5wx7oIatEuT5 nN1w== X-Gm-Message-State: AA+aEWaXPeSQSXJ29RG6hBgjNOOv9p7R0i2Mta0OwsnOTor8jRZ1SQ3X GLYVdemU5dwbMWNsHnYRfRUaxg== X-Received: by 2002:a17:902:3281:: with SMTP id z1mr23322684plb.296.1544692101486; Thu, 13 Dec 2018 01:08:21 -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 m11sm1650533pgh.51.2018.12.13.01.08.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Dec 2018 01:08:20 -0800 (PST) From: Firoz Khan To: linux-mips@vger.kernel.org, Ralf Baechle , Paul Burton , James Hogan , Greg Kroah-Hartman , Philippe Ombredanne , Thomas Gleixner , Kate Stewart Cc: y2038@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, arnd@arndb.de, deepa.kernel@gmail.com, marcin.juszkiewicz@linaro.org, firoz.khan@linaro.org Subject: [PATCH v5 1/7] mips: add __NR_syscalls along with __NR_Linux_syscalls Date: Thu, 13 Dec 2018 14:37:33 +0530 Message-Id: <1544692059-9728-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544692059-9728-1-git-send-email-firoz.khan@linaro.org> References: <1544692059-9728-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 */