Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10303998imu; Wed, 5 Dec 2018 21:20:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wm4r/jbg3y9D/p//7oXqhhDCJfRibBwHzDjzOo4CLK7xBv/eGju9yaKYv4tjiopTvGQOf0 X-Received: by 2002:a17:902:8f83:: with SMTP id z3mr26294768plo.328.1544073621814; Wed, 05 Dec 2018 21:20:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544073621; cv=none; d=google.com; s=arc-20160816; b=Jck8X1rynTqLroS3KyYkcASKDkA2x+ihGsi08WHa2MoxHkoK7Y7OBJYX/qAtHXnd2W rgZUDByZiXreErlmTb5aG7G8bbWKXPy73MtAeJZ4kK8XLTaqRkTMB2E0uTRaiZt8qD9H ZAznZEwDt1RsV9FIz+qycxYuChSPiPPxtMObfB5dDa2dQTau/EUYzUCs4iLy07EMZEKH 24/Eb4bhKMi6jDUpaQ0TagRpU+ZIkc3zydZE0BvBk/NRKqc9iuD62SOXzR4b27nEoa7+ rchfi66gPI+9YFb/ZW8dfxglqxqygxt2ikptTpKcP36GmAjcbmFaB4boNjSB4ZTpG1UD JKSA== 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 3si23070023plo.217.2018.12.05.21.20.04; Wed, 05 Dec 2018 21:20:21 -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 S1729000AbeLFFTZ (ORCPT + 99 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(-) 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 */ -- 1.9.1