summaryrefslogtreecommitdiffstats
path: root/arch/x86/um/user-offsets.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2011-12-06 01:08:49 +0100
committerH. Peter Anvin <hpa@linux.intel.com>2011-12-06 01:08:49 +0100
commit45db1c6176c8171d9ae6fa6d82e07d115a5950ca (patch)
tree65ce8fcca9ffe02e0ecb83d6aa118ef44d7c86ce /arch/x86/um/user-offsets.c
parentum: Generate headers before generating user-offsets.s (diff)
downloadlinux-45db1c6176c8171d9ae6fa6d82e07d115a5950ca.tar.xz
linux-45db1c6176c8171d9ae6fa6d82e07d115a5950ca.zip
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 @@
#include <asm/ptrace.h>
#include <asm/types.h>
+#ifdef __i386__
+#define __SYSCALL_I386(nr, sym, compat) [nr] = 1,
+static char syscalls[] = {
+#include <asm/syscalls_32.h>
+};
+#else
+#define __SYSCALL_64(nr, sym, compat) [nr] = 1,
+static char syscalls[] = {
+#include <asm/syscalls_64.h>
+};
+#endif
+
#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
@@ -77,4 +89,7 @@ void foo(void)
DEFINE(UM_PROT_READ, PROT_READ);
DEFINE(UM_PROT_WRITE, PROT_WRITE);
DEFINE(UM_PROT_EXEC, PROT_EXEC);
+
+ DEFINE(__NR_syscall_max, sizeof(syscalls) - 1);
+ DEFINE(NR_syscalls, sizeof(syscalls));
}