From patchwork Fri Oct 26 05:09:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 149561 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp321501ljp; Thu, 25 Oct 2018 22:09:43 -0700 (PDT) X-Google-Smtp-Source: AJdET5e/dH7pL6y+ATFot39H5lzXo4I9fVqoMRYz5FEgAeBhD+KSpG0yuooSKnzWpDEn/4eoFenm X-Received: by 2002:a17:902:a9c5:: with SMTP id b5-v6mr2096422plr.340.1540530583497; Thu, 25 Oct 2018 22:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540530583; cv=none; d=google.com; s=arc-20160816; b=hNnjFD0Yq0+TPMMkkUEHAIpl+TmtN64PRE0zYArQETiOH7zQ75zOJ9uPUpyC7s0Gzh hNrAA+h2exxkuIOl7pl4KtJlWmnOVWUocPPTVWL7c+UOoyr3dG2642PJ8nyxId8Ls15G Bd9x6zeVq+sZYo2ywbRJOAH/axHFKHousMUjotftxSDZLjTvyiOzuZj4Ztdg6QZkeiZH Zspv9vtuwfc7MOPrqoBrmjrJxOlrhEVodtU0ouBY1vWp6KOM5fE+auT7OWOy1WzQfKfq Zzi1MSOUcqJEM8AsP5JV67n6QTDtqGPfEFNYG3NkXj4oowYKK8uspiQMjcHsU5NRq+oM LBFA== 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=S/KbYVLYlBJWhmcNmudeyLEr88M5mv3E/URnA16ciHE=; b=TvhfvfCOf/kGUd6ZerIcA+1LzgIqVuBmhjqHbBHAY4D2ls3pgdzLcFaq31IAW9a317 k2dnFTNARreY0NQI/U0ANZW2MZncmuZYSinT94/RI06vcc9VrFIqea/H4vOsTBoPEfDR plGhqbwQ7VxPdd2DN/SXWUfurJlHTvWXDaYGJ0Ms8odlUvMP/VLVDzuqSsFDrh9WM0iE HbcZ4Ti7q41sLf/TJSoouPIzM2+twpRavSuvESvpqFGxmgxfD6U3Cy1kdId6RKCy4P2d aY9HbfOzSk+SRIbXWyoj5gEz4rOBpMf+gl32S2i6eofuP3p21XJE79sbTcevZZH8g8w5 NgtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T3ax6nsJ; 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 y1-v6si10121522pgq.263.2018.10.25.22.09.43; Thu, 25 Oct 2018 22:09:43 -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=T3ax6nsJ; 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 S1726254AbeJZNpK (ORCPT + 32 others); Fri, 26 Oct 2018 09:45:10 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40936 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726078AbeJZNpK (ORCPT ); Fri, 26 Oct 2018 09:45:10 -0400 Received: by mail-pl1-f195.google.com with SMTP id b9-v6so4598544pls.7 for ; Thu, 25 Oct 2018 22:09:41 -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=S/KbYVLYlBJWhmcNmudeyLEr88M5mv3E/URnA16ciHE=; b=T3ax6nsJHqivyvL7QDfUUkqGEf2+73Yaa1cPt35Tsgi2m5HKFlBdptZeC4wQbtVyyH dxHYZesv58hmkSlQfci2myxfBWJaoPIwaixc2yLj+jcjwyTs/5kkCiTliGXbepwXcyIr kgeJZmVCuNLXq/05JujC3MZRjGWXxqh4C/KPE= 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=S/KbYVLYlBJWhmcNmudeyLEr88M5mv3E/URnA16ciHE=; b=KcQyonP8W9Tt6gz01xrwfZeMZWFzxrKnkLIDDg9TZmK360tRuLRM+XXYMk/DU4bBMb bsE+7c8UfxATPN2R+mGFyJ6bCcAD+88NK4YFdqGOTxWoeERbfOsn5kxl98MKSw5jp+kb BTqvU6ZtWE0JsZp2K/kHgCevqG2nGiWxYONkfzJXjcNkvsE3x3yYWynsGuI1OSrQnjHf DC4sOjwEo+W2OSz7rOOCSYUEfvKXHfEpoHPlOzwPleSmzIP17ohpAFSoWbDaSEk2K569 AAf7nBmpl4ec/O05OIhOFq+ySLtf4iMndOW09xn37Ft5ZeiPdSXZpU2POokaVT9x1GNF ILqg== X-Gm-Message-State: AGRZ1gKSLeAE+RhfiamxpwHrvdKLDnhPPVHqzm5UDVU7JsWxq/Z1B59z nkoAxNXxHu1vIrnjuFnnVR3rFg== X-Received: by 2002:a17:902:bf41:: with SMTP id u1-v6mr2162135pls.10.1540530581408; Thu, 25 Oct 2018 22:09:41 -0700 (PDT) Received: from qualcomm-HP-ZBook-14-G2.domain.name ([49.207.61.165]) by smtp.gmail.com with ESMTPSA id i135-v6sm3579822pfe.115.2018.10.25.22.09.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Oct 2018 22:09:40 -0700 (PDT) From: Firoz Khan To: Michal Simek , 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 v3 1/3] microblaze: move __NR_syscalls macro from asm/unistd.h Date: Fri, 26 Oct 2018 10:39:10 +0530 Message-Id: <1540530552-3652-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540530552-3652-1-git-send-email-firoz.khan@linaro.org> References: <1540530552-3652-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 microblaze 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- _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 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 moved the __NR_syscalls macro from asm/unistd.h to uapi- /asm/unistd.h. 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/microblaze/include/asm/unistd.h | 2 -- arch/microblaze/include/uapi/asm/unistd.h | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h index a62d094..e19550f 100644 --- a/arch/microblaze/include/asm/unistd.h +++ b/arch/microblaze/include/asm/unistd.h @@ -38,6 +38,4 @@ #endif /* __ASSEMBLY__ */ -#define __NR_syscalls 401 - #endif /* _ASM_MICROBLAZE_UNISTD_H */ diff --git a/arch/microblaze/include/uapi/asm/unistd.h b/arch/microblaze/include/uapi/asm/unistd.h index 7a9f16a..ed9c6f5 100644 --- a/arch/microblaze/include/uapi/asm/unistd.h +++ b/arch/microblaze/include/uapi/asm/unistd.h @@ -418,4 +418,8 @@ #define __NR_io_pgetevents 399 #define __NR_rseq 400 +#ifdef __KERNEL__ +#define __NR_syscalls 401 +#endif + #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */