From patchwork Thu Nov 1 13:43:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 149954 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp811500ljp; Thu, 1 Nov 2018 06:44:33 -0700 (PDT) X-Google-Smtp-Source: AJdET5eaRg+22areuVQdasdCrCbiMcA4y5ePxcxQGVt+T0G7InGlUayCOmeL5xRtJe7kSl295U2l X-Received: by 2002:a62:7f8c:: with SMTP id a134-v6mr8025066pfd.22.1541079872879; Thu, 01 Nov 2018 06:44:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541079872; cv=none; d=google.com; s=arc-20160816; b=A1m4jiT2F7FiDk9h5Gj5lVAC2+m4mHTrlRrQt680VtQvvqy/swHHCNS47E7ynaL+db n2HouUy+2kQydOGN3drbY56c2OWjPTjXVNg97bFdKB6vr5SMgBrhjzMtOOZIwOtwyIPY TeB8ChVKRa2cubltXziXsivRUB8NAOwAGjonHQVjDWAKym8+l87xM5M+Bwf8jOKYh5y1 cd08nHRYE1TnhQettPKOiIuiING8cFbSStnU/3O3NDDRSi7jMk20G63e+8uqYqXmRydq Gx2kIdrSzLs6+WGKaQrjrgxRv/LmrQ08pWi1lG+xYEUDr0Cw6mOKamRS13lBNxaGTQlJ ogYg== 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=/XsLB/mTm+LIF0r/5nrqJTJoWtRCz/bDdCwvPaNBjtY=; b=OXXUOVKiLb8rA2Jwh/wb+9Bo31qCvlLvRh27g/lK7TadA5iXU6MLTSEMdwZPy5LIpD 5ZhCHWKlUlOMC2oJ0EPVMxDup3p4aBDpmrZI7w5MW8rGLhp5iAbBXnr48VA31VYWhUrR zDhtNciF2LizfecqT2g2yIDKJYRwoPzjhqaILR7WsI5JuE+2aL3K6ma9afs2EsRqowJE eCeeDmmP6MAAhXDSIHEc92yfcOyIMF70xlxaw6noF1VffheiiOCkuQrHmBNKgFzwLFXQ 3lLzT44lY9KpeGe107nnZIJ8JCaWw82TcTyeA+sbHzXFtsoW38B6dljH2F8NPrJ6ndNm Hgsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BwQNTdSf; 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 c18-v6si21820088plz.116.2018.11.01.06.44.32; Thu, 01 Nov 2018 06:44:32 -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=BwQNTdSf; 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 S1728856AbeKAWrb (ORCPT + 32 others); Thu, 1 Nov 2018 18:47:31 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46188 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728657AbeKAWrb (ORCPT ); Thu, 1 Nov 2018 18:47:31 -0400 Received: by mail-pg1-f193.google.com with SMTP id w7so388705pgp.13 for ; Thu, 01 Nov 2018 06:44:29 -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=/XsLB/mTm+LIF0r/5nrqJTJoWtRCz/bDdCwvPaNBjtY=; b=BwQNTdSfvlHi4WkoY+Xf/IzabNjZD861ktNNAOV90juP+P3x+fiBS52/GcPGKm8t7p 3e4C4jtxCpqFl10VKGHCSNwIxTJEHv7adw6b04hamUWTODfCPMUOze31cCLuKGXzXBMs 34QOQZ5uhfohK8RAvApuZ7pwvTTksSSJeAKZA= 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=/XsLB/mTm+LIF0r/5nrqJTJoWtRCz/bDdCwvPaNBjtY=; b=jGAw3vcG8JEaYx9Z0VsqtQ8G4oLhXjg5gwqBjGUYvSNiy9Fgk24y0Y5UzIWfTeJ5zF M48DtG69uSX6rBLDQiHQq1PXpWWZbgspFBmWTTaj4HQ8yogSnAHyDUw05WAlTsZ/Ip1m u3a9eY0pr6jw/uNtta4kDrXYte6JCYbSHTYjLui91Ui0TmoAyvzmlUfPTRKKhMthccEM XFASaC/NyMBfb87TDIg5jgjOS8zkR161UxJkR3nTZe1K7qtyNGXA8YtCMPVYi9ySvoRj KYR27zHyNhxcFctm+gja/MjlWsVIgsxi+YyhSkJbxCy1Bk6Y7Iar7Zh2FgzOPU/o0E36 qTTw== X-Gm-Message-State: AGRZ1gIlMKr/f++ySQzWphUunvOdH+pfBoFogPTLFUsFO+dSR3/byusg aXMeVaPTBqzalsJHisqpDdt3Lw== X-Received: by 2002:aa7:8252:: with SMTP id e18-v6mr7906548pfn.164.1541079869330; Thu, 01 Nov 2018 06:44:29 -0700 (PDT) Received: from qualcomm-HP-ZBook-14-G2.domain.name ([106.51.104.211]) by smtp.gmail.com with ESMTPSA id r23-v6sm36359299pgm.48.2018.11.01.06.44.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Nov 2018 06:44:28 -0700 (PDT) From: Firoz Khan To: linux-alpha@vger.kernel.org, Richard Henderson , Ivan Kokshaysky , Matt Turner , 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 v2 3/5] alpha: add __NR_syscalls along with NR_SYSCALLS Date: Thu, 1 Nov 2018 19:13:35 +0530 Message-Id: <1541079817-3431-4-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541079817-3431-1-git-send-email-firoz.khan@linaro.org> References: <1541079817-3431-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 alpha 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- CALLS 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/alpha/include/asm/unistd.h | 2 +- arch/alpha/include/uapi/asm/unistd.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h index cbd04d3..65a5056 100644 --- a/arch/alpha/include/asm/unistd.h +++ b/arch/alpha/include/asm/unistd.h @@ -4,7 +4,7 @@ #include -#define NR_SYSCALLS 523 +#define NR_SYSCALLS __NR_syscalls #define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_STAT64 diff --git a/arch/alpha/include/uapi/asm/unistd.h b/arch/alpha/include/uapi/asm/unistd.h index 47c65f1..ab40aa6 100644 --- a/arch/alpha/include/uapi/asm/unistd.h +++ b/arch/alpha/include/uapi/asm/unistd.h @@ -465,4 +465,8 @@ #define __NR_pwritev2 521 #define __NR_statx 522 +#ifdef __KERNEL__ +#define __NR_syscalls 523 +#endif + #endif /* _UAPI_ALPHA_UNISTD_H */