Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp867019imd; Thu, 1 Nov 2018 06:51:19 -0700 (PDT) X-Google-Smtp-Source: AJdET5cyuxi+UDIjbOaiM9ii+IsTDCohhFMfP5yMZz9qolYRmcFifEzbkQxYnWdn9vsyjfoBZqqD X-Received: by 2002:a63:584a:: with SMTP id i10-v6mr7318507pgm.178.1541080278944; Thu, 01 Nov 2018 06:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541080278; cv=none; d=google.com; s=arc-20160816; b=ea/4sK2b4kpKu9w4b22ElptTaeqrkywhEa1RyBe6GapDtvzhTJWrO9v69WZixvZSAb HlzN0SJsGjxx21mb8MTv5hxve5aBPlGpm1lMMLsLbrf7/EER0xNSPXaKQcj3iYQhs0J1 j31aW2D/kr6FvAR/hk6EdPPFD1lx5ToXHF7vd1p/cjEp72Djfs+l/0T8/oYxvd1GETzc 99kHvNnIOuBDYNHJefMkuuBqTwVQIykgAcbSsiE/a++RqFnBGwoyV7iB+YvLaQ5sL1Pl mpQDOFjtD1EjafthsE8iXb95aCD0Jcv+euHZ+M4zXmEWbVpRD2bamJIfyGmYx7iwb13v HtYw== 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=nVzadkm3B8vZT4Re5btIMSdYYClObm2dBafrqh2nn0E=; b=GevckvnzFn7M4dwhvg4mSSaXOgiHDIAzgW9KMhFOhooNPYuMxCzyytTXBdIwMkmG11 cAVAXR5LDZBlsPOWmwjkO4htg/oDCMraxkHtsk3Dc6QkJl12DJJgiMAbcdpOdznvS23w 5Ib7u8f7Y7CORmo6bEndk5w9PsD8IwAofpgLktlnzWwIPFubeoazDfFcSy61HEdkTq1i 89u5AbCFJNMyQH9F5kjrgFLhpLvZ3uhnONqD2UKzJG03VoZZUvQNNVRiyIjvTwY/zYLM VzBdwr69tCwfuvOIBSVonZZNv6gfa3r2LSRWYxyPfclXQr5nAbKfFkDG7SE4XTG+9f0g YW7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IOZdKtRd; 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 61-v6si31265655plr.72.2018.11.01.06.51.03; Thu, 01 Nov 2018 06:51:18 -0700 (PDT) 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=IOZdKtRd; 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 S1728757AbeKAWw2 (ORCPT + 99 others); Thu, 1 Nov 2018 18:52:28 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42833 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728699AbeKAWw1 (ORCPT ); Thu, 1 Nov 2018 18:52:27 -0400 Received: by mail-pf1-f196.google.com with SMTP id f26-v6so9366366pfn.9 for ; Thu, 01 Nov 2018 06:49:24 -0700 (PDT) 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=nVzadkm3B8vZT4Re5btIMSdYYClObm2dBafrqh2nn0E=; b=IOZdKtRdSHOcHXtMjmIVEb21TnWhRzpFX4c4eSKMzaGla8oSzHS3qVOtQIjzvX07m+ NfScitucIIRyueCh5MMgNCzHwxJW/bJdc8crnd2wPV4QBpVWVVY/Piwv8v424MnhMC4x xseAkehsyZ9zCX+I9x/kyj10kGC6xoBrJtS5U= 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=nVzadkm3B8vZT4Re5btIMSdYYClObm2dBafrqh2nn0E=; b=fXPMk8DRjluHs8/JlXXYEj2O8e49pb29ZOhhb3IWahuJlQ/Gi6UI+7gPsvR5xMii3f 1F0/dl6iivkDAz1Pb1+S1MACuYb4jhBX3rTqwEZxM15BzR+JQn5+1Wxx4QaKmPZQAxao nDGmoysdHQTxmB2F2IQ4WqOauO9E6rBgd+gkutBsCHaCnr3FnNRR38e8jZslo+uRbgu5 7n+Su/QX36HIVxTm9snqJnA8xALTHOAGCwnFUFqzsrofZ/M1x1pFaFEMvdTU2PL44Lbv OSCie01t0JK0H1n1OHuwD7Usxpnx39+nEHwOoq9Iw+Y6m1RICgZCgm/zC6pYmp27Cr5X K9NA== X-Gm-Message-State: AGRZ1gLWVkfpDhC/vfbFG2n7yvWSyc4ZuGm2LtKL4Am49kHAvkeS49QV HWhaqLqDOgz//RATGo5Pl56xQA== X-Received: by 2002:a63:e00d:: with SMTP id e13-v6mr7185680pgh.114.1541080164492; Thu, 01 Nov 2018 06:49:24 -0700 (PDT) Received: from qualcomm-HP-ZBook-14-G2.domain.name ([106.51.104.211]) by smtp.gmail.com with ESMTPSA id p11-v6sm16567307pfn.53.2018.11.01.06.49.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Nov 2018 06:49:23 -0700 (PDT) From: Firoz Khan To: linux-sh@vger.kernel.org, Yoshinori Sato , Rich Felker , 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 v2 1/3] sh: add __NR_syscalls along with NR_syscalls Date: Thu, 1 Nov 2018 19:18:48 +0530 Message-Id: <1541080130-3678-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541080130-3678-1-git-send-email-firoz.khan@linaro.org> References: <1541080130-3678-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_syscalls macro holds the number of system call exist in sh architecture. We have to change the value of NR- _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_sy- scalls value. 1. Update NR_syscalls in asm/unistd.h manually by count- ing the no.of system calls. No need to update NR_sys- calls 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_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_32/64.h along with NR_syscalls which is moved to asm/unistd.h. The macro __NR_syscalls also added for making the name convention same across all architecture. While __NR_sys- calls 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/sh/include/asm/unistd.h | 2 ++ arch/sh/include/uapi/asm/unistd_32.h | 4 +++- arch/sh/include/uapi/asm/unistd_64.h | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/sh/include/asm/unistd.h b/arch/sh/include/asm/unistd.h index b36200a..66fd71c 100644 --- a/arch/sh/include/asm/unistd.h +++ b/arch/sh/include/asm/unistd.h @@ -5,6 +5,8 @@ # include # endif +#define NR_syscalls __NR_syscalls + # define __ARCH_WANT_OLD_READDIR # define __ARCH_WANT_OLD_STAT # define __ARCH_WANT_STAT64 diff --git a/arch/sh/include/uapi/asm/unistd_32.h b/arch/sh/include/uapi/asm/unistd_32.h index 58f04cf..31c85aa 100644 --- a/arch/sh/include/uapi/asm/unistd_32.h +++ b/arch/sh/include/uapi/asm/unistd_32.h @@ -396,6 +396,8 @@ #define __NR_preadv2 381 #define __NR_pwritev2 382 -#define NR_syscalls 383 +#ifdef __KERNEL__ +#define __NR_syscalls 383 +#endif #endif /* __ASM_SH_UNISTD_32_H */ diff --git a/arch/sh/include/uapi/asm/unistd_64.h b/arch/sh/include/uapi/asm/unistd_64.h index 6f809a5..75da548 100644 --- a/arch/sh/include/uapi/asm/unistd_64.h +++ b/arch/sh/include/uapi/asm/unistd_64.h @@ -416,6 +416,8 @@ #define __NR_preadv2 392 #define __NR_pwritev2 393 -#define NR_syscalls 394 +#ifdef __KERNEL__ +#define __NR_syscalls 394 +#endif #endif /* __ASM_SH_UNISTD_64_H */ -- 1.9.1