From patchwork Thu Nov 29 04:26:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 152361 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1927960ljp; Wed, 28 Nov 2018 20:27:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/VFRZYK7Y0JnWNQ+Cteuck34hWw5+9ERATGXYHfDR3O+AwMXiIFHEXlW2vOKGGdBOYfHYHy X-Received: by 2002:a17:902:bf0c:: with SMTP id bi12mr4311plb.0.1543465679561; Wed, 28 Nov 2018 20:27:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543465679; cv=none; d=google.com; s=arc-20160816; b=WnbZbl8F3Pf7u66B+i5/BKNFWoMSpQWgMN2g/7/poMrx1DVPUwaVl1We/egySXpXfW uHy8dQsvTLeUm4ko0210sBAEjJ5rVHO5zQkNiekTzuMvq0T6MsSLAeRLeneF79ldR0fA tVQ5RwJUitW8ozrzY4OSOquMbug0kB8SPaKbjsUFV/5GeHHcjlCzUAkwG/ClgU+uOGwP bfAbfSt9LtnEgN6h3k9WPLoG4NojoGicARwCnM6H5z84m4xkaIzNXHZ4i/mz+PZvQvCv 2LVZyD3hTfh+9q2gnhfqIHDq7oHpvhtkCHR6+RDN+MWH/YQU7PNJGBjmuOqtsV7KKDnd CveQ== 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=LKBsWSmP4GNUsv4SYosFLB6bX6Ubg45cYd2jpfuSG/o4XG8ZUS5zHEfL11gdaHThP4 iZqlYPSyWsuMVy0xDVYZOjusLUxo2PApvwSwet9SMMk7+GQ/x+5DhxA17342Jg94yP7K 4fLHcUropuPOfe74XtIj0wJT8hOeWApvOZQyQM6sm5BEkQP+W04KD1Rv14lY4Jq/ovsD kgY4KQrHid4Jzuxw4V9o31DwDSmfSbxUh1L97k/14EyM7AJuIOk6GyV07LA7QAU2zkTV i62Wfzrk024qgGT6NxplxDyWjKInBRMWsmJWocmYO1DMBZsHoUVcu9++2+Q2LCbtIL1s 9r8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dw4w+jTE; 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 3si891191pla.240.2018.11.28.20.27.59; Wed, 28 Nov 2018 20:27:59 -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=Dw4w+jTE; 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 S1727736AbeK2Pb4 (ORCPT + 32 others); Thu, 29 Nov 2018 10:31:56 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40504 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727693AbeK2Pb4 (ORCPT ); Thu, 29 Nov 2018 10:31:56 -0500 Received: by mail-pf1-f194.google.com with SMTP id i12so373732pfo.7 for ; Wed, 28 Nov 2018 20:27:56 -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=Dw4w+jTE4sHeLHbFY3h8XVpKi3OIVSznCkWDKwpiGYHlzkJKreDJLYtgPydbnATQQv qydXXL/H54a76SOH8inBTEx/gd9WTTbN9wU6j1mnRERrsYXrudmaoLihg9uxvYk2Pn5f P2928+HzbuFTZvfoT/BuV2wGXyzTRGf6QXVAo= 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=VAB1YWcvLKz5uy0+P+C6sdXeTvLHkTq3Cg4TpNs0Aib0IJIN94jp9kXPJw6eGWT4DV atTgVRuHaPctfV2Xh72ycwDVzouNRLd7jzP6QMC71Q1cu1dooDrCJ3nzswct0ryVpGaD 1UPjRDPwvOGpHsfmOHzRtQkFISGLKU7sEC3usQIuV4CCIvxIim7nyAuVIL6bTAD1z52C c80+QW2fqrtlGEzF2L05OTZTTWPJwnhheJ0AXJag3Ucszm4G38Wt5ayTTY2MPZhOZBL/ 1szk9a/2AV2RkA/bTotsIwoahI6+gJ6qCIl1VTbUavz7Yjk87YE0+Ep+Tlk1D+fhM4e9 vjGw== X-Gm-Message-State: AA+aEWYOPMFKAkuMA2fYYg8PuGDMBvdzsv+T35VtDpacjteUiHf1hu5Y Dy9zB7paGk+4svwF0v4zkRfw8w== X-Received: by 2002:a63:955a:: with SMTP id t26mr36023391pgn.449.1543465676346; Wed, 28 Nov 2018 20:27:56 -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 p2sm770473pfb.28.2018.11.28.20.27.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Nov 2018 20:27:55 -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 , 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, deepa.kernel@gmail.com, marcin.juszkiewicz@linaro.org, firoz.khan@linaro.org Subject: [PATCH v3 1/4] powerpc: add __NR_syscalls along with NR_syscalls Date: Thu, 29 Nov 2018 09:56:48 +0530 Message-Id: <1543465611-17122-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543465611-17122-1-git-send-email-firoz.khan@linaro.org> References: <1543465611-17122-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_ */