diff options
-rw-r--r-- | arch/um/include/sysdep-x86_64/kernel-offsets.h | 9 | ||||
-rw-r--r-- | arch/um/include/sysdep-x86_64/syscalls.h | 3 | ||||
-rw-r--r-- | arch/um/sys-x86_64/syscall_table.c | 5 |
3 files changed, 14 insertions, 3 deletions
diff --git a/arch/um/include/sysdep-x86_64/kernel-offsets.h b/arch/um/include/sysdep-x86_64/kernel-offsets.h index a307237b7964..c978b589df41 100644 --- a/arch/um/include/sysdep-x86_64/kernel-offsets.h +++ b/arch/um/include/sysdep-x86_64/kernel-offsets.h | |||
@@ -17,7 +17,16 @@ | |||
17 | #define OFFSET(sym, str, mem) \ | 17 | #define OFFSET(sym, str, mem) \ |
18 | DEFINE(sym, offsetof(struct str, mem)); | 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 | void foo(void) | 28 | void foo(void) |
21 | { | 29 | { |
22 | #include <common-offsets.h> | 30 | #include <common-offsets.h> |
31 | DEFINE(UM_NR_syscall_max, sizeof(syscalls) - 1); | ||
23 | } | 32 | } |
diff --git a/arch/um/include/sysdep-x86_64/syscalls.h b/arch/um/include/sysdep-x86_64/syscalls.h index 5e86aa047b2b..cf72256609e4 100644 --- a/arch/um/include/sysdep-x86_64/syscalls.h +++ b/arch/um/include/sysdep-x86_64/syscalls.h | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | #include <linux/msg.h> | 10 | #include <linux/msg.h> |
11 | #include <linux/shm.h> | 11 | #include <linux/shm.h> |
12 | #include <kern_constants.h> | ||
12 | 13 | ||
13 | typedef long syscall_handler_t(void); | 14 | typedef long syscall_handler_t(void); |
14 | 15 | ||
@@ -29,6 +30,6 @@ extern long old_mmap(unsigned long addr, unsigned long len, | |||
29 | extern syscall_handler_t sys_modify_ldt; | 30 | extern syscall_handler_t sys_modify_ldt; |
30 | extern syscall_handler_t sys_arch_prctl; | 31 | extern syscall_handler_t sys_arch_prctl; |
31 | 32 | ||
32 | #define NR_syscalls (__NR_syscall_max + 1) | 33 | #define NR_syscalls (UM_NR_syscall_max + 1) |
33 | 34 | ||
34 | #endif | 35 | #endif |
diff --git a/arch/um/sys-x86_64/syscall_table.c b/arch/um/sys-x86_64/syscall_table.c index 9e9ad72c2ba4..5133988d3610 100644 --- a/arch/um/sys-x86_64/syscall_table.c +++ b/arch/um/sys-x86_64/syscall_table.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/linkage.h> | 4 | #include <linux/linkage.h> |
5 | #include <linux/sys.h> | 5 | #include <linux/sys.h> |
6 | #include <linux/cache.h> | 6 | #include <linux/cache.h> |
7 | #include <kern_constants.h> | ||
7 | 8 | ||
8 | #define __NO_STUBS | 9 | #define __NO_STUBS |
9 | 10 | ||
@@ -45,8 +46,8 @@ typedef void (*sys_call_ptr_t)(void); | |||
45 | 46 | ||
46 | extern void sys_ni_syscall(void); | 47 | extern void sys_ni_syscall(void); |
47 | 48 | ||
48 | sys_call_ptr_t sys_call_table[__NR_syscall_max+1] __cacheline_aligned = { | 49 | sys_call_ptr_t sys_call_table[UM_NR_syscall_max+1] __cacheline_aligned = { |
49 | /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ | 50 | /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ |
50 | [0 ... __NR_syscall_max] = &sys_ni_syscall, | 51 | [0 ... UM_NR_syscall_max] = &sys_ni_syscall, |
51 | #include <asm-x86_64/unistd.h> | 52 | #include <asm-x86_64/unistd.h> |
52 | }; | 53 | }; |