From mboxrd@z Thu Jan 1 00:00:00 1970 From: Firoz Khan Subject: [PATCH 1/3] microblaze: Replace NR_syscalls macro from asm/unistd.h Date: Thu, 9 Aug 2018 10:57:44 +0530 Message-ID: <1533792466-4227-2-git-send-email-firoz.khan@linaro.org> References: <1533792466-4227-1-git-send-email-firoz.khan@linaro.org> Return-path: In-Reply-To: <1533792466-4227-1-git-send-email-firoz.khan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: linux-arch.vger.kernel.org __NR_syscalls macro holds the number of system call exist in this architecture. This macro is currently the part of asm/unistd.h file. We have 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 counting the no.of system calls. No need to update __NR_syscalls untill we either add a new system call or delete an existing system call. 2. We can keep this feature it above mentioned script, that'll count the number of syscalls and keep it in a generated file. In this case we don't need to explicitly 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. The macro name also changed form NR_syscalls to __NR_syscalls 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. Signed-off-by: Firoz Khan --- arch/microblaze/include/asm/unistd.h | 2 -- arch/microblaze/include/uapi/asm/unistd.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) 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..bde6b38 100644 --- a/arch/microblaze/include/uapi/asm/unistd.h +++ b/arch/microblaze/include/uapi/asm/unistd.h @@ -418,4 +418,6 @@ #define __NR_io_pgetevents 399 #define __NR_rseq 400 +#define __NR_syscalls 401 + #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ -- 1.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f67.google.com ([209.85.160.67]:35688 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728323AbeHIHvW (ORCPT ); Thu, 9 Aug 2018 03:51:22 -0400 Received: by mail-pl0-f67.google.com with SMTP id w3-v6so2055107plq.2 for ; Wed, 08 Aug 2018 22:28:21 -0700 (PDT) From: Firoz Khan Subject: [PATCH 1/3] microblaze: Replace NR_syscalls macro from asm/unistd.h Date: Thu, 9 Aug 2018 10:57:44 +0530 Message-ID: <1533792466-4227-2-git-send-email-firoz.khan@linaro.org> In-Reply-To: <1533792466-4227-1-git-send-email-firoz.khan@linaro.org> References: <1533792466-4227-1-git-send-email-firoz.khan@linaro.org> Sender: linux-arch-owner@vger.kernel.org List-ID: 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 Message-ID: <20180809052744.YvNGo1FUtLcZL01M25XGXravea4FBmbrfRPB_IWKBdY@z> __NR_syscalls macro holds the number of system call exist in this architecture. This macro is currently the part of asm/unistd.h file. We have 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 counting the no.of system calls. No need to update __NR_syscalls untill we either add a new system call or delete an existing system call. 2. We can keep this feature it above mentioned script, that'll count the number of syscalls and keep it in a generated file. In this case we don't need to explicitly 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. The macro name also changed form NR_syscalls to __NR_syscalls 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. Signed-off-by: Firoz Khan --- arch/microblaze/include/asm/unistd.h | 2 -- arch/microblaze/include/uapi/asm/unistd.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) 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..bde6b38 100644 --- a/arch/microblaze/include/uapi/asm/unistd.h +++ b/arch/microblaze/include/uapi/asm/unistd.h @@ -418,4 +418,6 @@ #define __NR_io_pgetevents 399 #define __NR_rseq 400 +#define __NR_syscalls 401 + #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ -- 1.9.1