From patchwork Thu Dec 6 05:18:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 152987 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp10126043ljp; Wed, 5 Dec 2018 21:19:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/WkLsHldqYZw9wI7elAN2uYjPk/a9jil6UBxz7JwJiYGHoav+XRovXAw0DuW/yXGfSg3k5N X-Received: by 2002:a63:7e5b:: with SMTP id o27mr22769482pgn.214.1544073575311; Wed, 05 Dec 2018 21:19:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544073575; cv=none; d=google.com; s=arc-20160816; b=NEA7OVM/ZOtyg3zabW3l/w3XLrGvP9ZS3W2E8kpXexcFXhIpGRXojw1XxLcrteA9Q2 1ep6rFRLWEVZ+hC8M9gItm7Uz9LLbEDjume0+3F5/Y+HNN9dPgUrs9ZwxXvUMVk3Rtg9 WNBXDbraR4CuiXqjDcs5wflA2mB1SSS2byo1RBGOMIh6pwWcbijDODU0UIr8rzdcKseJ wiR3bUjyUoMgGUCTIH6G5jeiU27odytDFU3tvvtmESrBEMxRMkRlElAoyXjSSXMIjWSM UVVFPk5EYKUK/mTyReX/hot7qq2CPsnPTBnJViW/kJCFID8zxfe8pNCL5lIv1Y55O5F4 64Jw== 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=yx4F/G/3vfW5kmaeztPnoRjgSWSUfiwjruXBI4npa20TpSrHFsBGPMjh0Yl7l9fMsm qHZd+kNK9Xkm4b9bD3eJs4sVEGk0IuYO8OmAinGjF5aurIJXEt3/CxmW7mHyHvHX4Gpu 4BW10QQ2Sg03UbrLfRgeWD4ULVKEnhTTYQD4l+e2g80qcVoFfVHZ20CAjG0pIAZYvsl5 9NLBzpYEesf0H40izmHnkiydpo8xf0uEAZo1mtmK5ZIArbFQ6A76Hgvm3GKChw0cXd3O Bfefwu6P8IPUErbykd9RoZU/vJm1FTzJ6EPRwrqh5elrzcKSjYhd1lg64V5OY/6sWtyd HDWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LsWzddNn; 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 h9si21411723pli.418.2018.12.05.21.19.34; Wed, 05 Dec 2018 21:19:35 -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=LsWzddNn; 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 S1729014AbeLFFTZ (ORCPT + 31 others); Thu, 6 Dec 2018 00:19:25 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:45929 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728489AbeLFFTY (ORCPT ); Thu, 6 Dec 2018 00:19:24 -0500 Received: by mail-pg1-f195.google.com with SMTP id y4so10086890pgc.12 for ; Wed, 05 Dec 2018 21:19:24 -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=LsWzddNnSpnI8bf2rDcBqamsS82gKi9t+RgrgQ7mFavobL3Z+6zEzj+g5feQM2Vgim o49WN3HgSa2vwsV9Z5yUl0r98x05JhVykKBuAQSU4rJnKY50G54LRa7SswM/KE4WA18E TsOMm68vyLyljVmkCtFvEf6deRm9mBrYfozpw= 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=fV8FlnkDFIUfeDRUvAoEL/fI1uCe8iMRyvu23bHnJmCSO+4/p1mBeWB95/eqpzxw9p Z5auGYZk0Xhz7r80xzU24LhHKT9p63e1SGa7SG7K7Xl6B/xX4ckZO80w52rIKGaLQQgE mZ0Yg/g5B6vLNBjDwvJBvmT2YhqYr6yMqOI+/MX5rqzowO+yjnOwco+31U0FifKeFCbO /ODiurcPNRO8T4Mh19sjcKwU4ICE87eT4qL7+zsBIl1W2nuKnyQnTAMGSMWcTykanYTp RS+Wy5/OQOZhqF28v8r8Zrbfu9rs83wo73APqqRgJ6bipdsqlOc45iM+zTr6mzCE4g0R u2mA== X-Gm-Message-State: AA+aEWZ0QZyyGViHbVFRPUHtOxUPKNsJZc+L0Aeow97Mn7ZURaeUR+Cq r94FbMKxQhd4TyGNQdsWNj+IzA== X-Received: by 2002:a62:4156:: with SMTP id o83mr27054347pfa.72.1544073563972; Wed, 05 Dec 2018 21:19:23 -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 r66sm32877803pfk.157.2018.12.05.21.19.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Dec 2018 21:19:23 -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 v4 1/7] mips: add __NR_syscalls along with __NR_Linux_syscalls Date: Thu, 6 Dec 2018 10:48:22 +0530 Message-Id: <1544073508-13720-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544073508-13720-1-git-send-email-firoz.khan@linaro.org> References: <1544073508-13720-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 */