lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1546872766-3354-4-git-send-email-firoz.khan@linaro.org>
Date:   Mon,  7 Jan 2019 20:22:46 +0530
From:   Firoz Khan <firoz.khan@...aro.org>
To:     Mark Salter <msalter@...hat.com>,
        Aurelien Jacquiot <jacquiot.aurelien@...il.com>,
        Michal Simek <michal.simek@...inx.com>,
        linux-c6x-dev@...ux-c6x.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Philippe Ombredanne <pombredanne@...b.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Kate Stewart <kstewart@...uxfoundation.org>
Cc:     y2038@...ts.linaro.org, linux-kernel@...r.kernel.org,
        linux-arch@...r.kernel.org, arnd@...db.de, deepa.kernel@...il.com,
        marcin.juszkiewicz@...aro.org, firoz.khan@...aro.org
Subject: [PATCH 3/3] c6x: generate uapi and kapi headers

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@...aro.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(-)

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>
 };
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ