microblaze: move __NR_syscalls macro from asm/unistd.h
authorFiroz Khan <firoz.khan@linaro.org>
Tue, 13 Nov 2018 06:04:32 +0000 (11:34 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 16 Nov 2018 07:24:33 +0000 (08:24 +0100)
__NR_syscalls 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>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/microblaze/include/asm/unistd.h
arch/microblaze/include/uapi/asm/unistd.h

index f42c40f5001b646c6fdbe86e9a36ceae6d65bcb1..9b7c2c4eaf12ea0e4d0056d14ed8b8bd7d3e0f7f 100644 (file)
@@ -38,6 +38,4 @@
 
 #endif /* __ASSEMBLY__ */
 
-#define __NR_syscalls         401
-
 #endif /* _ASM_MICROBLAZE_UNISTD_H */
index 7a9f16a7641374855d4d8f9a7189792031f51185..1c3f867b644889ebd6126d4f5674f613bfd0b6cd 100644 (file)
 #define __NR_io_pgetevents     399
 #define __NR_rseq              400
 
+#ifdef __KERNEL__
+#define __NR_syscalls          401
+#endif
+
 #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */