From: Firoz Khan <firoz.khan@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>,
linuxppc-dev@lists.ozlabs.org,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Ram Pai <linuxram@us.ibm.com>, Breno Leitao <leitao@debian.org>,
Boqun Feng <boqun.feng@gmail.com>,
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, deepa.kernel@gmail.com,
marcin.juszkiewicz@linaro.org, firoz.khan@linaro.org
Subject: [PATCH 1/3] powerpc: Replace NR_syscalls macro from asm/unistd.h
Date: Fri, 14 Sep 2018 14:02:58 +0530 [thread overview]
Message-ID: <1536913980-4811-2-git-send-email-firoz.khan@linaro.org> (raw)
In-Reply-To: <1536913980-4811-1-git-send-email-firoz.khan@linaro.org>
__NR_syscalls macro holds the number of system call exist in POWERPC
architecture. This macro is currently the part of asm/unistd.h file.
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 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 <firoz.khan@linaro.org>
---
arch/powerpc/include/asm/unistd.h | 3 +--
arch/powerpc/include/uapi/asm/unistd.h | 2 ++
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h
index c19379f..54732f9 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -11,8 +11,7 @@
#include <uapi/asm/unistd.h>
-
-#define NR_syscalls 389
+#define NR_syscalls __NR_syscalls
#define __NR__exit __NR_exit
diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h
index 985534d..f999df2 100644
--- a/arch/powerpc/include/uapi/asm/unistd.h
+++ b/arch/powerpc/include/uapi/asm/unistd.h
@@ -401,4 +401,6 @@
#define __NR_rseq 387
#define __NR_io_pgetevents 388
+#define __NR_syscalls 389
+
#endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
--
1.9.1
next prev parent reply other threads:[~2018-09-14 8:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-14 8:32 [PATCH 0/3] System call table generation support Firoz Khan
2018-09-14 8:32 ` Firoz Khan [this message]
2018-09-14 8:32 ` [PATCH 2/3] powerpc: Add system " Firoz Khan
2018-09-14 10:01 ` Arnd Bergmann
2018-09-18 12:15 ` Firoz Khan
2018-09-24 20:59 ` Arnd Bergmann
2018-09-25 0:48 ` Michael Ellerman
2018-09-25 6:00 ` Arnd Bergmann
2018-09-25 12:25 ` Michael Ellerman
2018-09-14 8:33 ` [PATCH 3/3] powerpc: uapi header and system call table file generation Firoz Khan
2018-11-29 6:34 ` [PATCH 0/3] System call table generation support Satheesh Rajendran
2018-11-29 8:18 ` Firoz Khan
2018-11-30 7:01 ` Satheesh Rajendran
2018-11-30 9:40 ` Firoz Khan
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=1536913980-4811-2-git-send-email-firoz.khan@linaro.org \
--to=firoz.khan@linaro.org \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=boqun.feng@gmail.com \
--cc=deepa.kernel@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kstewart@linuxfoundation.org \
--cc=leitao@debian.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=linuxram@us.ibm.com \
--cc=marcin.juszkiewicz@linaro.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--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).