From patchwork Fri Oct 26 05:11:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 149566 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp323083ljp; Thu, 25 Oct 2018 22:11:55 -0700 (PDT) X-Google-Smtp-Source: AJdET5e1EYLHMAL2YnUArSeuhYmUWnURl7ZMO+Oj0gpOEjS4PvRt4YJdSv0l/pEXbEDoZTW+xnG7 X-Received: by 2002:a17:902:8bc6:: with SMTP id r6-v6mr2128038plo.0.1540530714868; Thu, 25 Oct 2018 22:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540530714; cv=none; d=google.com; s=arc-20160816; b=jMXGNOGGfmLlBeYnc/zLoZI0UEHm8zK4/MQl83vWPirFba0vTVSurXev/imGYJQJML M57rPEz7sRVQ1Mmul2mg/9deppkCOsYDM6X6y0/Pk5vTStYhdGRtn8PU2NpJ7W0VQWpd QFUfOTqsoOHTYVRgf20ogXemeqHMvYzsdn+FT5mccxBCppcBfFVI1iLLU0VlVtZ9lIyM ZFu3EqfgR1pcRSmFEa0ierMi6HwwIfiuK86SQbCQK4h6uNcTkx3ApgvLvao/gUC7EGcw 4SdsMOJS1aIxo7hiJVECtgxvEwhyuYMEI/msGQRawgaRpOE4ZjMx5qUgFmz/BBxa3kfh biwQ== 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=kmPQRtCg67Rb8OhlxUSRTL6Ko6ikHgAeICx3msAVfdc=; b=YC4eY9awu0tiAjwSdVBzYZbf1Or1NkaCvkyXzmgJnWreTyLNRMM7sr/6UGgqgO9t4S PYq2xDsGiAhsy542VQ57kvMD+0UnmfTOwR65kooOeHr2MeCHZSuQ2hhHMPPh/djK40MF dsg1A3T2d+3A3Byq/2vQ91+Yfq5RA3AM0ohWlRs3QPP/XHHA3aP6pZtjo3MqeEiNn0CG 9w5Tex8RZCbbSjBe3RISeaf2C8D8XFsBi7Qv2c2nbJn2Iysn2GCjFqZ7D5S0aB3fZ6KG HJf3gdRXILd34Zd7vc1m5livnCGp9Avgz5PepDdg/R/9E1NJkP0OHbqog6Wp450p63qs /5Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QJf5oDcX; 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 i35-v6si9874537plg.361.2018.10.25.22.11.54; Thu, 25 Oct 2018 22:11:54 -0700 (PDT) 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=QJf5oDcX; 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 S1726580AbeJZNrW (ORCPT + 32 others); Fri, 26 Oct 2018 09:47:22 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:42514 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbeJZNrW (ORCPT ); Fri, 26 Oct 2018 09:47:22 -0400 Received: by mail-pl1-f194.google.com with SMTP id t6-v6so4890192plo.9 for ; Thu, 25 Oct 2018 22:11:53 -0700 (PDT) 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=kmPQRtCg67Rb8OhlxUSRTL6Ko6ikHgAeICx3msAVfdc=; b=QJf5oDcXUzCVxKvMG0uoX7wnvG+rLw0VD/8slqssFz/i2hXZB8urzu9stYYuPhhfE/ H46ZHwbz8E54LzpWAce5ZYcyTj1KTjpPtgo2A2bmg9v1QjO4GRio8avvMsCCoBg0XPmq tRYjfcciwwGNWpEXodzba/ucHn/nWyt33iOP4= 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=kmPQRtCg67Rb8OhlxUSRTL6Ko6ikHgAeICx3msAVfdc=; b=lYUS5A7Fvm7cJzdjl9xLKemjG59PbwEjaxcrxEt2eOdM4LQCMJWFDdlsEa5jdocPYH sWFzb4shl9w4jVpZH2PrHaPQNxPWkpQ5dw8QsC92tqjSD420uyUepdjOTN74D0YHsjBO wD3c6PL9CyYibDXt425/nj2j7tINb9tyliN2AfwnS0Xby82eJlXp05VULOCjQpEbwk6n 2R62ZZDLvfq8g4FwHvNhS6QVZ4YAMVQY1lFrzH3QmrkXCDolqaGonER/gTm8MTZ3aDl1 JoasMYX5Mbgn8Xj3ogQT2OkPC56y0cPrDy9e2CYdcQ/xzofAbxRF64pkUtK45ev9aT/y Xq7w== X-Gm-Message-State: AGRZ1gIlPiPqS74OvBUwPrqyhXhHyo+6Lk4IHR9iWH0OVoS9uKwIuC+J NLESQb2y0t97Wj2W/kaIs4bd6A== X-Received: by 2002:a17:902:a618:: with SMTP id u24-v6mr2076116plq.77.1540530712796; Thu, 25 Oct 2018 22:11:52 -0700 (PDT) Received: from qualcomm-HP-ZBook-14-G2.domain.name ([49.207.61.165]) by smtp.gmail.com with ESMTPSA id u13-v6sm9608912pgp.18.2018.10.25.22.11.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Oct 2018 22:11:52 -0700 (PDT) From: Firoz Khan To: linux-ia64@vger.kernel.org, Tony Luck , Fenghua Yu , Thomas Gleixner , Greg Kroah-Hartman , Philippe Ombredanne , 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 2/5] ia64: add __NR_syscalls along with NR_syscalls Date: Fri, 26 Oct 2018 10:41:11 +0530 Message-Id: <1540530674-3824-3-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540530674-3824-1-git-send-email-firoz.khan@linaro.org> References: <1540530674-3824-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 ia64 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 total number of system calls information. So we have two option to update NR_sy- scalls 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 it 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/ia64/include/asm/unistd.h | 4 +--- arch/ia64/include/uapi/asm/unistd.h | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index ffb705d..397b143 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h @@ -10,9 +10,7 @@ #include - - -#define NR_syscalls 326 /* length of syscall table */ +#define NR_syscalls __NR_syscalls /* length of syscall table */ /* * The following defines stop scripts/checksyscalls.sh from complaining about diff --git a/arch/ia64/include/uapi/asm/unistd.h b/arch/ia64/include/uapi/asm/unistd.h index 4d590c9..4186dc2 100644 --- a/arch/ia64/include/uapi/asm/unistd.h +++ b/arch/ia64/include/uapi/asm/unistd.h @@ -341,4 +341,8 @@ #define __NR_preadv2 1348 #define __NR_pwritev2 1349 +#ifdef __KERNEL__ +#define __NR_syscalls 326 +#endif + #endif /* _UAPI_ASM_IA64_UNISTD_H */