Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp175685imu; Thu, 6 Dec 2018 22:13:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/WCRv8mN+a9yRKKSl6tx6CGnq6eyRHbPuceNnweF2FFOUy3oaz+2RVO1TAAnD7YTjtTQcpF X-Received: by 2002:a65:448a:: with SMTP id l10mr835764pgq.387.1544163199369; Thu, 06 Dec 2018 22:13:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544163199; cv=none; d=google.com; s=arc-20160816; b=ryjgjomE15RlkEFs+KH7Kg6kynsdZ77tGGyw0vFBr3DhQGoO7EP55rdS+fenGx7V+l BktkAWJpgroHDoBa/rUoar+FiA/Ih/h2Ze19QVutyB/cIttBNjHETbCd5H1Egp2RYfBz LYbmc0lhpR6aLGLQYySUHp4NABDYVcAA75eKCy5WzetseY2Yp2T7i4LOiI2lv8I46zFA YSI9kuQUXZTgWkIRutQ+Cf+ur7AGEKc5rtrg0qsae99+SYiWoJ277RhwfXN8HJacgXC1 hYHH5X2w51G1e+Lq43GoiPE7fRoZEjiDGYFJZqWBqAf/k5oYSTmzENB3qkzgZZIsSlgw 81Vw== 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=vQ11L5fbSlQywDlarp8Vx7gPwaLgwn+tMy8AoLNYKwqAbCCMDn86N2HnY9fNEMT84P KiKxevBw7rBaic0CteZx5G1+afor48nEt5aJPPoyVi+NTg6+GcI+u6iM0M0gvF7zHglR HUixGEwVaAj6a6TpwL7VjJW1K8Kggcs1SBE6igkHBhm27DXXtl5DQwJXA1P+z/FlA85f GaQTM9+T2ToRoUM9a2lNxXqG+wh5QZ9vvIgB0eMwHslVBhBr3uHXyAwLEKnHfR7RrGNC 3PpJ4hEV/YTJI1dHY6NZKiVJ3Of63YdNviO2H3mJ5pyB9t4ui5eWpQT7HTOPFStU3dam yZ9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QY46Sm2N; 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 r28si1948918pgm.317.2018.12.06.22.13.04; Thu, 06 Dec 2018 22:13:19 -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=QY46Sm2N; 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 S1726044AbeLGGMO (ORCPT + 99 others); Fri, 7 Dec 2018 01:12:14 -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-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