From patchwork Thu Dec 13 09:07:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Firoz Khan X-Patchwork-Id: 10728223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7BA1A15A6 for ; Thu, 13 Dec 2018 09:08:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D30429D75 for ; Thu, 13 Dec 2018 09:08:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 610722BB27; Thu, 13 Dec 2018 09:08:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 558FB29D75 for ; Thu, 13 Dec 2018 09:08:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726976AbeLMJIX (ORCPT ); Thu, 13 Dec 2018 04:08:23 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:32841 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727578AbeLMJIW (ORCPT ); Thu, 13 Dec 2018 04:08:22 -0500 Received: by mail-pl1-f193.google.com with SMTP id z23so775564plo.0 for ; Thu, 13 Dec 2018 01:08:21 -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=YFkH6BiVFMb84PF3sgPw/qdfk9RQVU5JUMVa27R0rjA=; b=IhSrxQMuCOQLwK9hBOPySYeyDIBdlRzA71tgiq8HpRugLsZ1KbEeLsR9uBw+6szAPJ r2haCgnE0UaswOHrXGx84k/W5pWswFr57YryDLfmx9IQAs+1XN0mmGV/39HhrweqZsQe iDA4dT5b6g0nFVvriIGFdSiY5P7HWfPezlrs8= 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=YFkH6BiVFMb84PF3sgPw/qdfk9RQVU5JUMVa27R0rjA=; b=ZcoaBIQYEDtVyoEiJHO1w6Zj4krMq5x536lqKHlJcgkG9LM0zv3zO/a9WtplertTNW NWLKNLM9vNPRLfml0RCbnfGVzTmif0INUQ7a/5CmPyygLiCjH7Fw42EtmqPrtHWs/jZb IFyd4PArddOiiYAYSL/4urzhP0IcSOdNPKjJt5AFN7UBI89H8t/Gn7yn34X0TeRXBtFQ 3JJZzhbnCH2tPFF6iktjgnKEv9FGddctb8zqMvEkoEhzqnC/H2irVzRl5MoQVrRQKPAD zyLYAVdLyHFu5Fss3ndoUrB7x+38RnDp6++dfrty09Ovzew5k2xXWxEs6EQ0ygTVytp0 zUKQ== X-Gm-Message-State: AA+aEWahWHAqmT7SqmbcXyEllzbhzz3dEyTzpk+SI+k09euZ0PrNYkS0 OiBsQUuLxzfD7ADbEyllbDj3WxPut0k= X-Google-Smtp-Source: AFSGD/Ul8NvKUUsNBub/mHPHzQzSMP/KfkK/7kkP2pxtNTJbApTALdzMP9BoAIjbht5I0EW25Y/DPg== X-Received: by 2002:a17:902:3281:: with SMTP id z1mr23322684plb.296.1544692101486; Thu, 13 Dec 2018 01:08:21 -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 m11sm1650533pgh.51.2018.12.13.01.08.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Dec 2018 01:08:20 -0800 (PST) From: Firoz Khan To: linux-mips@vger.kernel.org, Ralf Baechle , Paul Burton , James Hogan , 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 v5 1/7] mips: add __NR_syscalls along with __NR_Linux_syscalls Date: Thu, 13 Dec 2018 14:37:33 +0530 Message-Id: <1544692059-9728-2-git-send-email-firoz.khan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544692059-9728-1-git-send-email-firoz.khan@linaro.org> References: <1544692059-9728-1-git-send-email-firoz.khan@linaro.org> Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP __NR_Linux_syscalls macro holds the number of system call exist in mips architecture. We have to change the value of __NR_Linux_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- _Linux_syscalls value. 1. Update __NR_Linux_syscalls in asm/unistd.h manually by counting the no.of system calls. No need to update __NR_Linux_syscalls 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_Linux_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_Linux_syscalls. 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/mips/include/uapi/asm/unistd.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h index f25dd1d..6914be5 100644 --- a/arch/mips/include/uapi/asm/unistd.h +++ b/arch/mips/include/uapi/asm/unistd.h @@ -391,11 +391,14 @@ #define __NR_rseq (__NR_Linux + 367) #define __NR_io_pgetevents (__NR_Linux + 368) +#ifdef __KERNEL__ +#define __NR_syscalls 368 +#endif /* * Offset of the last Linux o32 flavoured syscall */ -#define __NR_Linux_syscalls 368 +#define __NR_Linux_syscalls __NR_syscalls #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ @@ -738,10 +741,14 @@ #define __NR_rseq (__NR_Linux + 327) #define __NR_io_pgetevents (__NR_Linux + 328) +#ifdef __KERNEL__ +#define __NR_syscalls 328 +#endif + /* * Offset of the last Linux 64-bit flavoured syscall */ -#define __NR_Linux_syscalls 328 +#define __NR_Linux_syscalls __NR_syscalls #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ @@ -1088,10 +1095,14 @@ #define __NR_rseq (__NR_Linux + 331) #define __NR_io_pgetevents (__NR_Linux + 332) +#ifdef __KERNEL__ +#define __NR_syscalls 332 +#endif + /* * Offset of the last N32 flavoured syscall */ -#define __NR_Linux_syscalls 332 +#define __NR_Linux_syscalls __NR_syscalls #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */