From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98079C07E85 for ; Fri, 7 Dec 2018 06:12:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 599DF20837 for ; Fri, 7 Dec 2018 06:12:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linaro.org header.i=@linaro.org header.b="QY46Sm2N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 599DF20837 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726051AbeLGGMP (ORCPT ); Fri, 7 Dec 2018 01:12:15 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:34331 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbeLGGMO (ORCPT ); Fri, 7 Dec 2018 01:12:14 -0500 Received: by mail-pg1-f194.google.com with SMTP id 17so1258084pgg.1 for ; Thu, 06 Dec 2018 22:12:13 -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=QY46Sm2Nl3AHZVZjmDu8Gey6y8aeofjBj2L0PLZ3+M7ontKbOpOW+0SlfPNlieasJ7 PXRZfDy1wJS9zcYnrBXVsY8RpZuXoyVtdbKzNasGH/1nFUGQRSfOH3o5xZK7YIVYv6+4 AA1cUxlJOrll55AMDQJI6tZXG1olYAFaIjqow= 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=CAKVdOYSrPlxP5SnzZiu3vSjFJzq9IJMcpzU6onGXtsah2yfTjwJKw+O6WI/e3ZYEj 7+csm4AYEkaDP51OnnkPqQrigsTxhu7NZKcNMzeioP+kQlkU/EKxfOrfsce7zSkTmBcS vpL6O+gpZC0cUABnodW53R8DUC4rL+0HwaSNbXstD63ZajcRjFBm0F7R4Fj506UrS9oG HAHqcskyRM0QBrLQINoOidCn8NpMwhoavDVOSAZWSvVCMl0EM39DIwQ+dhujRfMu2YpI eJeJErf1F8Pf1aruS8RZRpLmnka+R7tZaYjfpYNGoD2ZBczPjzBXtazoSxtuHw4ceS/R 2F0Q== X-Gm-Message-State: AA+aEWbAW2QobOcR6enHE74pafGCQRBGVXnPb8m6BgXt9yap6aqrYWed g4/SLWLaiK1uGMjeZr/3ReByRg== X-Google-Smtp-Source: AFSGD/USsBR/7thb5No7OBIgBryyzo3YVsOnZ0kGzLuGB49UHgH7z0J76d/3o+LMPnVJy8yW25fQTA== X-Received: by 2002:a63:e156:: with SMTP id h22mr847994pgk.255.1544163133110; Thu, 06 Dec 2018 22:12:13 -0800 (PST) Received: from qualcomm-HP-ZBook-14-G2.domain.name ([49.207.61.25]) by smtp.gmail.com with ESMTPSA id r4sm5719862pgn.54.2018.12.06.22.12.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Dec 2018 22:12:12 -0800 (PST) From: Firoz Khan To: linuxppc-dev@lists.ozlabs.org, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Ram Pai , Geert Uytterhoeven , Mathieu Desnoyers , Breno Leitao , Boqun Feng , 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/5] powerpc: add __NR_syscalls along with NR_syscalls Date: Fri, 7 Dec 2018 11:41:36 +0530 Message-Id: <1544163100-15510-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544163100-15510-1-git-send-email-firoz.khan@linaro.org> References: <1544163100-15510-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(-) 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_ */ -- 1.9.1