fix uml-x86_64

__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>

authored by Al Viro and committed by Linus Torvalds ecec5ba6 327b9eeb

+14 -3
+9
arch/um/include/sysdep-x86_64/kernel-offsets.h
··· 17 17 #define OFFSET(sym, str, mem) \ 18 18 DEFINE(sym, offsetof(struct str, mem)); 19 19 20 + #define __NO_STUBS 1 21 + #undef __SYSCALL 22 + #undef _ASM_X86_64_UNISTD_H_ 23 + #define __SYSCALL(nr, sym) [nr] = 1, 24 + static char syscalls[] = { 25 + #include <asm/arch/unistd.h> 26 + }; 27 + 20 28 void foo(void) 21 29 { 22 30 #include <common-offsets.h> 31 + DEFINE(UM_NR_syscall_max, sizeof(syscalls) - 1); 23 32 }
+2 -1
arch/um/include/sysdep-x86_64/syscalls.h
··· 9 9 10 10 #include <linux/msg.h> 11 11 #include <linux/shm.h> 12 + #include <kern_constants.h> 12 13 13 14 typedef long syscall_handler_t(void); 14 15 ··· 30 29 extern syscall_handler_t sys_modify_ldt; 31 30 extern syscall_handler_t sys_arch_prctl; 32 31 33 - #define NR_syscalls (__NR_syscall_max + 1) 32 + #define NR_syscalls (UM_NR_syscall_max + 1) 34 33 35 34 #endif
+3 -2
arch/um/sys-x86_64/syscall_table.c
··· 4 4 #include <linux/linkage.h> 5 5 #include <linux/sys.h> 6 6 #include <linux/cache.h> 7 + #include <kern_constants.h> 7 8 8 9 #define __NO_STUBS 9 10 ··· 46 45 47 46 extern void sys_ni_syscall(void); 48 47 49 - sys_call_ptr_t sys_call_table[__NR_syscall_max+1] __cacheline_aligned = { 48 + sys_call_ptr_t sys_call_table[UM_NR_syscall_max+1] __cacheline_aligned = { 50 49 /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ 51 - [0 ... __NR_syscall_max] = &sys_ni_syscall, 50 + [0 ... UM_NR_syscall_max] = &sys_ni_syscall, 52 51 #include <asm-x86_64/unistd.h> 53 52 };