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/include/asm/unistd.h | |
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/include/asm/unistd.h')
-rw-r--r-- | arch/x86/include/asm/unistd.h | 54 |
1 files changed, 50 insertions, 4 deletions
diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h index 2a58ed3e51d8..b4a3db7ce140 100644 --- a/arch/x86/include/asm/unistd.h +++ b/arch/x86/include/asm/unistd.h | |||
@@ -1,13 +1,59 @@ | |||
1 | #ifndef _ASM_X86_UNISTD_H | ||
2 | #define _ASM_X86_UNISTD_H 1 | ||
3 | |||
1 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
2 | # ifdef CONFIG_X86_32 | 5 | # ifdef CONFIG_X86_32 |
3 | # include "unistd_32.h" | 6 | |
7 | # include <asm/unistd_32.h> | ||
8 | # define __ARCH_WANT_IPC_PARSE_VERSION | ||
9 | # define __ARCH_WANT_STAT64 | ||
10 | # define __ARCH_WANT_SYS_OLD_MMAP | ||
11 | # define __ARCH_WANT_SYS_OLD_SELECT | ||
12 | |||
4 | # else | 13 | # else |
5 | # include "unistd_64.h" | 14 | |
15 | # include <asm/unistd_64.h> | ||
16 | # define __ARCH_WANT_COMPAT_SYS_TIME | ||
17 | |||
6 | # endif | 18 | # endif |
19 | |||
20 | # define __ARCH_WANT_OLD_READDIR | ||
21 | # define __ARCH_WANT_OLD_STAT | ||
22 | # define __ARCH_WANT_SYS_ALARM | ||
23 | # define __ARCH_WANT_SYS_FADVISE64 | ||
24 | # define __ARCH_WANT_SYS_GETHOSTNAME | ||
25 | # define __ARCH_WANT_SYS_GETPGRP | ||
26 | # define __ARCH_WANT_SYS_LLSEEK | ||
27 | # define __ARCH_WANT_SYS_NICE | ||
28 | # define __ARCH_WANT_SYS_OLDUMOUNT | ||
29 | # define __ARCH_WANT_SYS_OLD_GETRLIMIT | ||
30 | # define __ARCH_WANT_SYS_OLD_UNAME | ||
31 | # define __ARCH_WANT_SYS_PAUSE | ||
32 | # define __ARCH_WANT_SYS_RT_SIGACTION | ||
33 | # define __ARCH_WANT_SYS_RT_SIGSUSPEND | ||
34 | # define __ARCH_WANT_SYS_SGETMASK | ||
35 | # define __ARCH_WANT_SYS_SIGNAL | ||
36 | # define __ARCH_WANT_SYS_SIGPENDING | ||
37 | # define __ARCH_WANT_SYS_SIGPROCMASK | ||
38 | # define __ARCH_WANT_SYS_SOCKETCALL | ||
39 | # define __ARCH_WANT_SYS_TIME | ||
40 | # define __ARCH_WANT_SYS_UTIME | ||
41 | # define __ARCH_WANT_SYS_WAITPID | ||
42 | |||
43 | /* | ||
44 | * "Conditional" syscalls | ||
45 | * | ||
46 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
47 | * but it doesn't work on all toolchains, so we just do it by hand | ||
48 | */ | ||
49 | # define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
50 | |||
7 | #else | 51 | #else |
8 | # ifdef __i386__ | 52 | # ifdef __i386__ |
9 | # include "unistd_32.h" | 53 | # include <asm/unistd_32.h> |
10 | # else | 54 | # else |
11 | # include "unistd_64.h" | 55 | # include <asm/unistd_64.h> |
12 | # endif | 56 | # endif |
13 | #endif | 57 | #endif |
58 | |||
59 | #endif /* _ASM_X86_UNISTD_H */ | ||