]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
fix uml-x86_64
authorAl Viro <viro@ftp.linux.org.uk>
Tue, 15 May 2007 19:36:00 +0000 (20:36 +0100)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 16 May 2007 01:56:37 +0000 (18:56 -0700)
__NR_syscall_max is done in x86_64 asm-offsets; do an equivalent in
uml kern_constants.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/include/sysdep-x86_64/kernel-offsets.h
arch/um/include/sysdep-x86_64/syscalls.h
arch/um/sys-x86_64/syscall_table.c

index a307237b7964394189e220673c160bddf08a6227..c978b589df419abc42c818dba54012dcbc8fb3f6 100644 (file)
 #define OFFSET(sym, str, mem) \
        DEFINE(sym, offsetof(struct str, mem));
 
+#define __NO_STUBS 1
+#undef __SYSCALL
+#undef _ASM_X86_64_UNISTD_H_
+#define __SYSCALL(nr, sym) [nr] = 1,
+static char syscalls[] = {
+#include <asm/arch/unistd.h>
+};
+
 void foo(void)
 {
 #include <common-offsets.h>
+DEFINE(UM_NR_syscall_max, sizeof(syscalls) - 1);
 }
index 5e86aa047b2ba0ac8cf2cf6f10487a47a2d81d00..cf72256609e4ea29d42b331123b1db672c9c4899 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <linux/msg.h>
 #include <linux/shm.h>
+#include <kern_constants.h>
 
 typedef long syscall_handler_t(void);
 
@@ -29,6 +30,6 @@ extern long old_mmap(unsigned long addr, unsigned long len,
 extern syscall_handler_t sys_modify_ldt;
 extern syscall_handler_t sys_arch_prctl;
 
-#define NR_syscalls (__NR_syscall_max + 1)
+#define NR_syscalls (UM_NR_syscall_max + 1)
 
 #endif
index 9e9ad72c2ba4fad3f836ff6f294cfa045f6d9622..5133988d36101c14d87155ed10ae29c28de836de 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/linkage.h>
 #include <linux/sys.h>
 #include <linux/cache.h>
+#include <kern_constants.h>
 
 #define __NO_STUBS
 
@@ -45,8 +46,8 @@ typedef void (*sys_call_ptr_t)(void);
 
 extern void sys_ni_syscall(void);
 
-sys_call_ptr_t sys_call_table[__NR_syscall_max+1] __cacheline_aligned = {
+sys_call_ptr_t sys_call_table[UM_NR_syscall_max+1] __cacheline_aligned = {
        /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */
-       [0 ... __NR_syscall_max] = &sys_ni_syscall,
+       [0 ... UM_NR_syscall_max] = &sys_ni_syscall,
 #include <asm-x86_64/unistd.h>
 };