diff mbox series

[3/3] c6x: generate uapi and kapi headers

Message ID 1546872766-3354-4-git-send-email-firoz.khan@linaro.org
State New
Headers show
Series c6x: system call table generation for asm-generic | expand

Commit Message

Firoz Khan Jan. 7, 2019, 2:52 p.m. UTC
Unified system call table generation script need to be invoked
to generated the uapi and kapi headers. The Makefile changes
present in this patch will invoke the scripts and generate uapi
and kapi header files.

The generated files - unistd_*.h and syscall_table_*.h files
will be included by unistd.h and sys_c6x.c files by replacing
asm-generic/unistd.h file.

Signed-off-by: Firoz Khan <firoz.khan@linaro.org>

---
 arch/c6x/Makefile                  |  3 +++
 arch/c6x/include/asm/Kbuild        |  1 +
 arch/c6x/include/uapi/asm/Kbuild   |  1 +
 arch/c6x/include/uapi/asm/unistd.h | 14 +++++++++-----
 arch/c6x/kernel/sys_c6x.c          |  3 ++-
 5 files changed, 16 insertions(+), 6 deletions(-)

-- 
1.9.1

Comments

kernel test robot Jan. 8, 2019, 4:15 a.m. UTC | #1
Hi Firoz,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.0-rc1]
[cannot apply to next-20190107]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Firoz-Khan/c6x-system-call-table-generation-for-asm-generic/20190108-100353
config: c6x-evmc6678_defconfig (attached as .config)
compiler: c6x-elf-gcc (GCC) 8.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.1.0 make.cross ARCH=c6x 

All errors (new ones prefixed by >>):

>> make[2]: *** No rule to make target 'scripts/syscalls/syscall.tbl', needed by 'arch/c6x/include/generated/asm/syscall_table.h'.

>> make[2]: *** No rule to make target 'scripts/syscalltbl.sh', needed by 'arch/c6x/include/generated/asm/syscall_table.h'.

>> make[2]: *** No rule to make target 'scripts/syscallhdr.sh', needed by 'arch/c6x/include/generated/uapi/asm/unistd_32.h'.

   make[2]: Target 'all' not remade because of errors.
   make[1]: *** [archheaders] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [sub-make] Error 2

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox series

Patch

diff --git a/arch/c6x/Makefile b/arch/c6x/Makefile
index b7aa854..acc9c91 100644
--- a/arch/c6x/Makefile
+++ b/arch/c6x/Makefile
@@ -53,6 +53,9 @@  dtbImage.%: vmlinux
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
+archheaders:
+	$(Q)$(MAKE) $(build)=arch/c6x/kernel/syscalls all
+
 define archhelp
   @echo '  vmlinux.bin     - Binary kernel image (arch/$(ARCH)/boot/vmlinux.bin)'
   @echo '  dtbImage.<dt>   - ELF image with $(arch)/boot/dts/<dt>.dts linked in'
diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild
index 33a2c94..3d551e6 100644
--- a/arch/c6x/include/asm/Kbuild
+++ b/arch/c6x/include/asm/Kbuild
@@ -1,3 +1,4 @@ 
+generated-y += syscall_table.h
 generic-y += atomic.h
 generic-y += barrier.h
 generic-y += bugs.h
diff --git a/arch/c6x/include/uapi/asm/Kbuild b/arch/c6x/include/uapi/asm/Kbuild
index 6c6f630..28823e3 100644
--- a/arch/c6x/include/uapi/asm/Kbuild
+++ b/arch/c6x/include/uapi/asm/Kbuild
@@ -1,5 +1,6 @@ 
 include include/uapi/asm-generic/Kbuild.asm
 
+generated-y += unistd_32.h
 generic-y += kvm_para.h
 generic-y += shmparam.h
 generic-y += ucontext.h
diff --git a/arch/c6x/include/uapi/asm/unistd.h b/arch/c6x/include/uapi/asm/unistd.h
index 9e9ffe5..4633005 100644
--- a/arch/c6x/include/uapi/asm/unistd.h
+++ b/arch/c6x/include/uapi/asm/unistd.h
@@ -20,9 +20,13 @@ 
 #define __ARCH_WANT_SYS_CLONE
 #define __ARCH_NOMMU
 
-/* Use the standard ABI for syscalls. */
-#include <asm-generic/unistd.h>
+#include <asm/bitsperlong.h>
 
-/* C6X-specific syscalls. */
-#define __NR_cache_sync	(__NR_arch_specific_syscall + 0)
-__SYSCALL(__NR_cache_sync, sys_cache_sync)
+#ifndef __SYSCALL
+#define __SYSCALL(x, y)
+#endif
+
+#if __BITS_PER_LONG == 32
+#define __NR_cache_sync	__NR_arch_specific_syscall0
+#include <asm/unistd_32.h>
+#endif
diff --git a/arch/c6x/kernel/sys_c6x.c b/arch/c6x/kernel/sys_c6x.c
index a742ae25..3e4b4e4 100644
--- a/arch/c6x/kernel/sys_c6x.c
+++ b/arch/c6x/kernel/sys_c6x.c
@@ -70,5 +70,6 @@  asmlinkage int sys_cache_sync(unsigned long s, unsigned long e)
  */
 void *sys_call_table[__NR_syscalls] = {
 	[0 ... __NR_syscalls-1] = sys_ni_syscall,
-#include <asm/unistd.h>
+#define sys_arch_specific_syscall0	sys_cache_sync
+#include <asm/syscall_table.h>
 };