From: Firoz Khan <firoz.khan@linaro.org>
To: Michal Simek <monstr@monstr.eu>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Philippe Ombredanne <pombredanne@nexb.com>,
Thomas Gleixner <tglx@linutronix.de>,
Kate Stewart <kstewart@linuxfoundation.org>
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 [thread overview]
Message-ID: <1540530552-3652-2-git-send-email-firoz.khan@linaro.org> (raw)
In-Reply-To: <1540530552-3652-1-git-send-email-firoz.khan@linaro.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 <firoz.khan@linaro.org>
---
arch/microblaze/include/asm/unistd.h | 2 --
arch/microblaze/include/uapi/asm/unistd.h | 4 ++++
2 files changed, 4 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..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 */
--
1.9.1
next prev parent reply other threads:[~2018-10-26 5:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-26 5:09 [PATCH v3 0/3] microblaze: system call table generation support Firoz Khan
2018-10-26 5:09 ` Firoz Khan [this message]
2018-10-26 5:09 ` [PATCH v3 2/3] microblaze: add " Firoz Khan
2018-10-26 5:09 ` [PATCH v3 3/3] microblaze: generate uapi header and system call table files Firoz Khan
2018-11-05 9:16 ` Michal Simek
2018-11-05 10:26 ` Firoz Khan
2018-11-08 13:44 ` Arnd Bergmann
2018-11-08 13:50 ` Michal Simek
2018-11-05 8:18 ` [PATCH v3 0/3] microblaze: system call table generation support Michal Simek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1540530552-3652-2-git-send-email-firoz.khan@linaro.org \
--to=firoz.khan@linaro.org \
--cc=arnd@arndb.de \
--cc=deepa.kernel@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kstewart@linuxfoundation.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcin.juszkiewicz@linaro.org \
--cc=monstr@monstr.eu \
--cc=pombredanne@nexb.com \
--cc=tglx@linutronix.de \
--cc=y2038@lists.linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).