From patchwork Thu Dec 13 09:02:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 153608 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp566815ljp; Thu, 13 Dec 2018 01:04:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vymq+eNtFpwdXaQRqIoxMnVola2LS0ItbPjIEZAtqfmMk1sve/pYGyt0peU4H/Buw9/0ZI X-Received: by 2002:a62:30c3:: with SMTP id w186mr23450071pfw.39.1544691866425; Thu, 13 Dec 2018 01:04:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544691866; cv=none; d=google.com; s=arc-20160816; b=Bnqalwka/P/M2gZUOncyUQI2tmxsyWcRwx9715uAYQbq2cfT1/B4MnXCHHiYDK6NsR N929qWOHptOWZ9KEXqwzm4GxnIBDvPKNtuaLec3B+fMlcSC2hpTjPTLRrPh1xMEmA3co dQHk9BVro5J54mG7+PY758TBRnulwl/9oR2iOor5u41/Ms3Hi9PoxJi37Gzw1O1K/myK onOs5oNcG4xOqa8S/yGMfR1MI/tu0Ty/smPZygB1DzrPsvmJJmSAhczYK3nYyzzzbEw0 RLduLj8DQGjIVNermlsXaljQ4i6/U+s926zoC4IlZwW0x+V0SBpdtiqCIpnHTPRG7gDu ddjg== 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=XJq1AFUaGxDCB6jFqaj05hzzcUKv19kg30xJpzrgoLo=; b=DyIESBn5A6EVXIKhdBr4RkZQHCYZN7MG+KMTK4DVOKKUNtCYJOe7wXVLbseq8GWnzU v8zk/nHN1MMWnnIM0TD91/9RvrWwKdQR6abrbFmHvoajIUBS1Yy0RJhgNtThYKztVyHh y/lKiamuexdOGgIkmySXZ7hpR7dQxksYHbtcpPfmPAVCsCYDqYhDeJaD7bwJoXskMfiK MRMokpVqjS8Su+9CwKybeClAtJIDhyB/zptLOpyJIuNhBo4zy1lYJT2sfejSfKDhiu/2 ObRW7FNUk88EfDy4kxoOfFBuCrlkheOlXNrwMY/CmO/HAgbWLaBWbyJE3lDIvQ8BxD+5 bk1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=elAnmEh9; 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 35si1216109plf.177.2018.12.13.01.04.25; Thu, 13 Dec 2018 01:04:26 -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=elAnmEh9; 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 S1726416AbeLMJEX (ORCPT + 31 others); Thu, 13 Dec 2018 04:04:23 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:33476 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727296AbeLMJET (ORCPT ); Thu, 13 Dec 2018 04:04:19 -0500 Received: by mail-pl1-f196.google.com with SMTP id z23so769932plo.0 for ; Thu, 13 Dec 2018 01:04:19 -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=XJq1AFUaGxDCB6jFqaj05hzzcUKv19kg30xJpzrgoLo=; b=elAnmEh9KUCn3gmzt/Clqz5G1DrU/kGyTLG5NbnyZwn1RG6N7A/R7AgEJB4a4SJw4b ZeawoJwUbRSk8rHxTHTGhQNqFij1axko4nw9RBnjtkDtQUFrXn1aV41/cxWKaiKgbSaF Qck3wtmGYNSEE5I5FQ7cg1iVDkCtFltUrGVY4= 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=XJq1AFUaGxDCB6jFqaj05hzzcUKv19kg30xJpzrgoLo=; b=BfONtgIUS1A1JaGL8Uhq3Mf9Vhlx1yMp/yN+x7XY76+gbX0urB/8dOkS1QtuUf6oIK efwa9nZRqgM5XIOToomxFXNRFBRzfMQyHOm+oUcEKmDLJh5Ks95N62zRCYSSDZos0Cfv TajvGIupM6584NlG3SAe5xRhJrxIjK+VdtVJMZN7J8jYhsLoVQbUz4jRSBMqH0dq47/6 FG0a945btXvFhU99rKEcU1yXJxHjAu19/9c3tAlb0Te3JWg64uILwEXcW8RrKoXidJCJ FF4ik6waXixPmTgWTncPv8nz6gRfsUn4J3ACYFj4hks/ntdPTMdJAUX9+2M5I8S0oIMy E2aA== X-Gm-Message-State: AA+aEWZQpOe3p+/9NW7dN01vOOI1UXKtGfGDb8aZuHiOfAw8nQHOMjLF V0Cr61LItNtwuDtRkCadfz1AaQ== X-Received: by 2002:a17:902:3181:: with SMTP id x1mr22796735plb.58.1544691859041; Thu, 13 Dec 2018 01:04:19 -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 s9sm1888305pgl.88.2018.12.13.01.04.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Dec 2018 01:04:18 -0800 (PST) From: Firoz Khan To: linuxppc-dev@lists.ozlabs.org, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Arnd Bergmann , Geert Uytterhoeven , Ram Pai , Mathieu Desnoyers , Boqun Feng , Breno Leitao , Greg Kroah-Hartman , Philippe Ombredanne , Thomas Gleixner , Kate Stewart Cc: y2038@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, deepa.kernel@gmail.com, marcin.juszkiewicz@linaro.org, firoz.khan@linaro.org Subject: [PATCH v5 1/5] powerpc: add __NR_syscalls along with NR_syscalls Date: Thu, 13 Dec 2018 14:32:46 +0530 Message-Id: <1544691770-8938-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544691770-8938-1-git-send-email-firoz.khan@linaro.org> References: <1544691770-8938-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 powerpc 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 number of system call information. So we have two option to update NR_syscalls 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 in 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.h along with NR_syscalls asm/unistd.h. 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/powerpc/include/asm/unistd.h | 3 +-- arch/powerpc/include/uapi/asm/unistd.h | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index b0de85b..a3c35e6 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h @@ -11,8 +11,7 @@ #include - -#define NR_syscalls 389 +#define NR_syscalls __NR_syscalls #define __NR__exit __NR_exit diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h index 985534d..7195868 100644 --- a/arch/powerpc/include/uapi/asm/unistd.h +++ b/arch/powerpc/include/uapi/asm/unistd.h @@ -10,7 +10,6 @@ #ifndef _UAPI_ASM_POWERPC_UNISTD_H_ #define _UAPI_ASM_POWERPC_UNISTD_H_ - #define __NR_restart_syscall 0 #define __NR_exit 1 #define __NR_fork 2 @@ -401,4 +400,8 @@ #define __NR_rseq 387 #define __NR_io_pgetevents 388 +#ifdef __KERNEL__ +#define __NR_syscalls 389 +#endif + #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */