From patchwork Mon Dec 17 10:40:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 153975 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2311424ljp; Mon, 17 Dec 2018 02:41:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/V+fxpCWxg9X3DltuI47cyXpazQd/et9itX6THuowkZGYvfrDEMeHfg51LUImCkujqTOOgu X-Received: by 2002:a63:7044:: with SMTP id a4mr11475985pgn.359.1545043285765; Mon, 17 Dec 2018 02:41:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545043285; cv=none; d=google.com; s=arc-20160816; b=Fx5xJ5vYoYxDN6DvbVeZzN4WqqyHXQVqrxpBvfXHeydzSuZ7Ao2iRzB6iYvDj2a+m9 sOXee1apf5aFuEw6/3pCAA19b3PE186o4qglYK7bB0Tc7deUjCrBgQTT88OdSYLSr3ME ob4dJPEUiynJvooriK17MKPqwT0zjpRlo/E1ELb0gpOs6gEh5JX47NqRQ850fGTLhdn9 8/ghOTnZuWnnsrMGFUiRCs4Xri2/33Rh2SQy1l7/Y6jPBaA4JYWJgJxaGO+ST+WcMxKX O2wCSCYJvQx57Fa215HSFomMUkqVq/qS+TxtR/hF/VmMw2MeLbacOmX3qYe++Y+4LNl8 cjgQ== 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=ayQZOo9CGM3Bq1a20DFcGnIZ6r4sWG67Y9US1iHCGN0QOCdP2oN1k4fX2RSgNIvS1S HKBcDerYOA3z75SojFlGjp9hRjb8weutCE19jX+nXBrMjtmqpPIEDOwYHV/qmdxsrVKU VLRfdvrsRu7RLhAnkma8Ht7nBKVNZeq6i1rSdjDk3WA/p0C/DbU+zW1Are3hFJIdrXG6 cmE6iqGH6R1TFMUQ6fTHplBosmDSmpfKtpbbmnE+NKCCi3c6HVdjs4ShJ4blF5kgLtJI M9qZzQf8YSYbD6zRWPcBB+s729XQcHZjCY+tmcqwg1he5Fnp/W6i4chh3QfGjBkoTtzl UcRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LZJ0PUMZ; 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 j193si10236055pge.332.2018.12.17.02.41.25; Mon, 17 Dec 2018 02:41:25 -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=LZJ0PUMZ; 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 S1732379AbeLQKlX (ORCPT + 31 others); Mon, 17 Dec 2018 05:41:23 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:34195 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726991AbeLQKlW (ORCPT ); Mon, 17 Dec 2018 05:41:22 -0500 Received: by mail-pl1-f193.google.com with SMTP id w4so5954927plz.1 for ; Mon, 17 Dec 2018 02:41:22 -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=LZJ0PUMZgwY1ciUTFaX7gsA3e2I0WwOiC7BvY6QLw5snWHh56g46LL3yRXFINvI8ic o+V7UjqxEU+Q78V+Io6IWK1o7ebT2/WStAUysb3NH/l7Txc+xz3WOYWVApn4aYRbVodS 9NnEHZWEOtmmWVDmfP3ZpoTOq5mhh188hJ8F4= 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=KBKNM4h38JyXpIr7KVi/FSZyK2ASCMO1V2/3Z5rac94qPbLzoNM4n5GStEZ26pKpCa GrYvKoF8sbIhJFkJoAq+iVS/i8y3vb+ezDWSVJqN9tdYVHlwEFqciM3y6LqvzMOlhj1H nzIM8ZOoIYJcZO6IsMZR5+lZDQUeWTRZv5ZfpnxMbP+D1sGcIESS5bryFxg2TmW64VR7 7f3o0gfgRAOCO3lN2yXq7qhPM1yOZ7appFHWZBYy4CZhS3bsHksP8ywlZBEU7A40FLQ5 N+GHPiHehcbJNtuZkCgppJf/18mMMF14B82rReEL1E0y9v4zGiU9xhg41AKd6pTmHxlc 6scg== X-Gm-Message-State: AA+aEWZYjDeREUjFmkvDlNMnfFYgDydm7M8ZjRWGNCmmLxQeP32ny8Os OKYpxr6xBlqlS79s+MDQXlT5KA== X-Received: by 2002:a17:902:848d:: with SMTP id c13mr12309944plo.257.1545043282112; Mon, 17 Dec 2018 02:41:22 -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 b27sm17224826pfh.113.2018.12.17.02.41.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Dec 2018 02:41:21 -0800 (PST) From: Firoz Khan To: linuxppc-dev@lists.ozlabs.org, sathnaga@linux.vnet.ibm.com, 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 v6 1/5] powerpc: add __NR_syscalls along with NR_syscalls Date: Mon, 17 Dec 2018 16:10:32 +0530 Message-Id: <1545043236-11649-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545043236-11649-1-git-send-email-firoz.khan@linaro.org> References: <1545043236-11649-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_ */