aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/um/user-offsets.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2011-12-05 19:08:49 -0500
committerH. Peter Anvin <hpa@linux.intel.com>2011-12-05 19:08:49 -0500
commit45db1c6176c8171d9ae6fa6d82e07d115a5950ca (patch)
tree65ce8fcca9ffe02e0ecb83d6aa118ef44d7c86ce /arch/x86/um/user-offsets.c
parent392f4b7db82ee592cc62b813e2a127d370dea42a (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.c15
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,
13static char syscalls[] = {
14#include <asm/syscalls_32.h>
15};
16#else
17#define __SYSCALL_64(nr, sym, compat) [nr] = 1,
18static 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}