diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2011-11-11 19:07:41 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2011-11-17 16:35:37 -0500 |
commit | 303395ac3bf3e2cb488435537d416bc840438fcb (patch) | |
tree | f979e40575b28ba5bb851d6de0bb0ae5b91541c3 /arch/x86/kernel/asm-offsets_32.c | |
parent | 29dc54c673ea2531d589400badb4ada5f5f60dae (diff) |
x86: Generate system call tables and unistd_*.h from tables
Generate system call tables and unistd_*.h automatically from the
tables in arch/x86/syscalls. All other information, like NR_syscalls,
is auto-generated, some of which is in asm-offsets_*.c.
This allows us to keep all the system call information in one place,
and allows for kernel space and user space to see different
information; this is currently used for the ia32 system call numbers
when building the 64-bit kernel, but will be used by the x32 ABI in
the near future.
This also removes some gratuitious differences between i386, x86-64
and ia32; in particular, now all system call tables are generated with
the same mechanism.
Cc: H. J. Lu <hjl.tools@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel/asm-offsets_32.c')
-rw-r--r-- | arch/x86/kernel/asm-offsets_32.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c index 395a10e68067..85d98ab15cdc 100644 --- a/arch/x86/kernel/asm-offsets_32.c +++ b/arch/x86/kernel/asm-offsets_32.c | |||
@@ -3,6 +3,11 @@ | |||
3 | #include <linux/lguest.h> | 3 | #include <linux/lguest.h> |
4 | #include "../../../drivers/lguest/lg.h" | 4 | #include "../../../drivers/lguest/lg.h" |
5 | 5 | ||
6 | #define __SYSCALL_I386(nr, sym, compat) [nr] = 1, | ||
7 | static char syscalls[] = { | ||
8 | #include <asm/syscalls_32.h> | ||
9 | }; | ||
10 | |||
6 | /* workaround for a warning with -Wmissing-prototypes */ | 11 | /* workaround for a warning with -Wmissing-prototypes */ |
7 | void foo(void); | 12 | void foo(void); |
8 | 13 | ||
@@ -76,4 +81,7 @@ void foo(void) | |||
76 | OFFSET(LGUEST_PAGES_regs_errcode, lguest_pages, regs.errcode); | 81 | OFFSET(LGUEST_PAGES_regs_errcode, lguest_pages, regs.errcode); |
77 | OFFSET(LGUEST_PAGES_regs, lguest_pages, regs); | 82 | OFFSET(LGUEST_PAGES_regs, lguest_pages, regs); |
78 | #endif | 83 | #endif |
84 | BLANK(); | ||
85 | DEFINE(__NR_syscall_max, sizeof(syscalls) - 1); | ||
86 | DEFINE(NR_syscalls, sizeof(syscalls)); | ||
79 | } | 87 | } |