diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2011-12-05 19:08:49 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2011-12-05 19:08:49 -0500 |
commit | 45db1c6176c8171d9ae6fa6d82e07d115a5950ca (patch) | |
tree | 65ce8fcca9ffe02e0ecb83d6aa118ef44d7c86ce /arch/x86/um/user-offsets.c | |
parent | 392f4b7db82ee592cc62b813e2a127d370dea42a (diff) |
x86, um: Use the same style generated syscall tables as native
Now when the native kernel uses a single style of generated system
call table, follow suite for UML and implement the same style, all in
C. This requires __NR_syscall_max and NR_syscalls to be generated; on
native this is done in asm-headers.h but that file is common to all
UML architectures; therefore put it in user-headers.h instead which
already have accommodations for architecture-specific values.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/um/user-offsets.c')
-rw-r--r-- | arch/x86/um/user-offsets.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/um/user-offsets.c b/arch/x86/um/user-offsets.c index ca49be8ddd0c..5edf4f4bbf53 100644 --- a/arch/x86/um/user-offsets.c +++ b/arch/x86/um/user-offsets.c | |||
@@ -8,6 +8,18 @@ | |||
8 | #include <asm/ptrace.h> | 8 | #include <asm/ptrace.h> |
9 | #include <asm/types.h> | 9 | #include <asm/types.h> |
10 | 10 | ||
11 | #ifdef __i386__ | ||
12 | #define __SYSCALL_I386(nr, sym, compat) [nr] = 1, | ||
13 | static char syscalls[] = { | ||
14 | #include <asm/syscalls_32.h> | ||
15 | }; | ||
16 | #else | ||
17 | #define __SYSCALL_64(nr, sym, compat) [nr] = 1, | ||
18 | static char syscalls[] = { | ||
19 | #include <asm/syscalls_64.h> | ||
20 | }; | ||
21 | #endif | ||
22 | |||
11 | #define DEFINE(sym, val) \ | 23 | #define DEFINE(sym, val) \ |
12 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) | 24 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) |
13 | 25 | ||
@@ -77,4 +89,7 @@ void foo(void) | |||
77 | DEFINE(UM_PROT_READ, PROT_READ); | 89 | DEFINE(UM_PROT_READ, PROT_READ); |
78 | DEFINE(UM_PROT_WRITE, PROT_WRITE); | 90 | DEFINE(UM_PROT_WRITE, PROT_WRITE); |
79 | DEFINE(UM_PROT_EXEC, PROT_EXEC); | 91 | DEFINE(UM_PROT_EXEC, PROT_EXEC); |
92 | |||
93 | DEFINE(__NR_syscall_max, sizeof(syscalls) - 1); | ||
94 | DEFINE(NR_syscalls, sizeof(syscalls)); | ||
80 | } | 95 | } |