From patchwork Wed Nov 14 10:03:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 151059 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5488220ljp; Wed, 14 Nov 2018 02:03:56 -0800 (PST) X-Google-Smtp-Source: AJdET5f+xysu2h5ryM9r1cnOKaAZEKL0ueN1hptiX3nGLOXqR3rxLKOFWgX8SuUVrY0jKPnMXZ/n X-Received: by 2002:a65:6215:: with SMTP id d21mr1127547pgv.289.1542189836698; Wed, 14 Nov 2018 02:03:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542189836; cv=none; d=google.com; s=arc-20160816; b=vet0Z2jl9CTn8pAhMN/CPAkGyJTmgxwqRxtKYfOXvXs6a15P7yzu6HAo1F3twbw9az OTxlvERGG2X5QNMPigjhm5JZXLDOZKcz29k3Ldkv0J8gu2QyNf7gwFUEe36f59Zycchc 5IBqqnPNa8yE3WHbrzpZssfzj32wabWEGNRaMW3geX9Q/ipIFjlGYYIquK9T4kKnDc7x kWkAqL2xBIxiOX900DOEJYObql4q62dV0p25jprV7JdFKk1XBGI/noZaWOPvjT06+iGu SmEMteEEWMKGjvCoZVfnnR+vjDlGEN977n1/kt4NV2n0nILR6mua9h9mDDKuF+FN1A7u w7GQ== 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=ozNGs1A6lkEUWs38d7vdZb20UrSGf7NsTXAxSkAV6hFRSPY14mOEIjfXpqpQ+6iYVX tKqx9whSImIo1682JLCLNvctlv57uQfNltrnFTfnJJ2tmwrmzfPncKZ4zJ04kOiFAco+ SCOecpSwY4USrwyJ2IpwNUKv4TzAhaujPXvnos5zCr17eQSvOHHOQzGe9rxme6cSUUsu kgXC+9xHows6STul2o7W8HtNkpz8guZ1dG2EtfYwBPLRtXn54GF9MM5qz6tdABl98RGR RHcqcOFtktIMQWJG0WaRAUlyyC1ETnYy7OoE9pbpNXiXsqVEnc0eT3TB/8v5pMLoZDqE SENQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M6U8fd9w; 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 l4-v6si26159755plb.258.2018.11.14.02.03.56; Wed, 14 Nov 2018 02:03:56 -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=M6U8fd9w; 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 S1732594AbeKNUG2 (ORCPT + 32 others); Wed, 14 Nov 2018 15:06:28 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46685 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728033AbeKNUG1 (ORCPT ); Wed, 14 Nov 2018 15:06:27 -0500 Received: by mail-pf1-f195.google.com with SMTP id s9-v6so7643445pfm.13 for ; Wed, 14 Nov 2018 02:03:53 -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=M6U8fd9wv90fiQvXu3EAhL9CN2/gEdq00GlhtKGf19lmZJyqdho+RNiklBGLwRG614 ZH3tqsM9dUCex9hSEjEsUrEh7uVF2yGPPO2oUEwc/jYFCJy+3iQTNMDqz5cOwB6KuEjZ cMElAvdTJtzREwOLXiLQvVMw+MDZ15UI9ht80= 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=MEcApUAF2ej9YqsklWIZpFK7YW04RP+RTu3ZjTfhs57+6ZqWS4rmAa6MKATKtCiaEh 0lIlwjFiNhIUS5z5vWH0/GqaTrIIW8SMc0gXGyGFZtlpPhiY6At1gLFKc/KNCkjKRdzp U3UHe3TQVH+s3JmjH0UtX1bCg+sYSgY8DGKeC4UEgt1xU/m6Kh2V6CMHBKzCnupGokoR hAcxZjAAtzUYZXNgb+8qwLEbmVMom1OeH91KoipHBjTh6v6EBgGSysQGUoVNV0UqKhMk nxRhu/urM6cEcICH0uL8Sx6ygYYqTW+IrfOjKEocQHI6lbolT3M5cika2Z2Zc+BBPHPQ FPtg== X-Gm-Message-State: AGRZ1gI5Fm6CPJLhqQwXkS5ftOMY9YEzBYAdqCFO/KXg9uGnP1ppKzDk 4OxjsjmvpLTtDpyQ/g/m0+Ki8Q== X-Received: by 2002:a62:1896:: with SMTP id 144-v6mr1348684pfy.88.1542189833137; Wed, 14 Nov 2018 02:03:53 -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 g15sm21633873pfj.131.2018.11.14.02.03.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Nov 2018 02:03:52 -0800 (PST) From: Firoz Khan To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Arnd Bergmann , Ram Pai , Geert Uytterhoeven , Breno Leitao , Boqun Feng , linuxppc-dev@lists.ozlabs.org, Thomas Gleixner , Greg Kroah-Hartman , Philippe Ombredanne , 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 v2 1/4] powerpc: add __NR_syscalls along with NR_syscalls Date: Wed, 14 Nov 2018 15:33:15 +0530 Message-Id: <1542189798-27713-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542189798-27713-1-git-send-email-firoz.khan@linaro.org> References: <1542189798-27713-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_ */