diff options
author | H. Peter Anvin <hpa@zytor.com> | 2012-02-14 17:38:31 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-02-20 15:51:00 -0500 |
commit | 6cbb369f578378cf5b1876766d860ae7c2a94d60 (patch) | |
tree | 0006e59ecea7023014dd619cb4199eb342b60fb7 | |
parent | 6630f11ba54414b9870d87dfef2bee467bfa842a (diff) |
x32: Generate <asm/unistd_x32.h>
Generate <asm/unistd_x32.h>; this exports x32 system call numbers to
user space.
[ v2: Enclose all arguments to syshdr in '' so empty arguments aren't
dropped on the floor. ]
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | arch/x86/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/unistd.h | 7 | ||||
-rw-r--r-- | arch/x86/syscalls/Makefile | 13 |
3 files changed, 17 insertions, 4 deletions
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index 986954fb951..f9c0d3ba9e8 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild | |||
@@ -25,3 +25,4 @@ header-y += vsyscall.h | |||
25 | 25 | ||
26 | genhdr-y += unistd_32.h | 26 | genhdr-y += unistd_32.h |
27 | genhdr-y += unistd_64.h | 27 | genhdr-y += unistd_64.h |
28 | genhdr-y += unistd_x32.h | ||
diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h index 21f77b89e47..dab5349f14f 100644 --- a/arch/x86/include/asm/unistd.h +++ b/arch/x86/include/asm/unistd.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef _ASM_X86_UNISTD_H | 1 | #ifndef _ASM_X86_UNISTD_H |
2 | #define _ASM_X86_UNISTD_H 1 | 2 | #define _ASM_X86_UNISTD_H 1 |
3 | 3 | ||
4 | /* x32 syscall flag bit */ | ||
5 | #define __X32_SYSCALL_BIT 0x40000000 | ||
6 | |||
4 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
5 | # ifdef CONFIG_X86_32 | 8 | # ifdef CONFIG_X86_32 |
6 | 9 | ||
@@ -52,8 +55,10 @@ | |||
52 | #else | 55 | #else |
53 | # ifdef __i386__ | 56 | # ifdef __i386__ |
54 | # include <asm/unistd_32.h> | 57 | # include <asm/unistd_32.h> |
55 | # else | 58 | # elif defined(__LP64__) |
56 | # include <asm/unistd_64.h> | 59 | # include <asm/unistd_64.h> |
60 | # else | ||
61 | # include <asm/unistd_x32.h> | ||
57 | # endif | 62 | # endif |
58 | #endif | 63 | #endif |
59 | 64 | ||
diff --git a/arch/x86/syscalls/Makefile b/arch/x86/syscalls/Makefile index 89dd9581c5a..8051c3134ad 100644 --- a/arch/x86/syscalls/Makefile +++ b/arch/x86/syscalls/Makefile | |||
@@ -10,8 +10,10 @@ syshdr := $(srctree)/$(src)/syscallhdr.sh | |||
10 | systbl := $(srctree)/$(src)/syscalltbl.sh | 10 | systbl := $(srctree)/$(src)/syscalltbl.sh |
11 | 11 | ||
12 | quiet_cmd_syshdr = SYSHDR $@ | 12 | quiet_cmd_syshdr = SYSHDR $@ |
13 | cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' $< $@ \ | 13 | cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \ |
14 | $(syshdr_abi_$(basetarget)) $(syshdr_pfx_$(basetarget)) | 14 | '$(syshdr_abi_$(basetarget))' \ |
15 | '$(syshdr_pfx_$(basetarget))' \ | ||
16 | '$(syshdr_offset_$(basetarget))' | ||
15 | quiet_cmd_systbl = SYSTBL $@ | 17 | quiet_cmd_systbl = SYSTBL $@ |
16 | cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@ | 18 | cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@ |
17 | 19 | ||
@@ -24,6 +26,11 @@ syshdr_pfx_unistd_32_ia32 := ia32_ | |||
24 | $(out)/unistd_32_ia32.h: $(syscall32) $(syshdr) | 26 | $(out)/unistd_32_ia32.h: $(syscall32) $(syshdr) |
25 | $(call if_changed,syshdr) | 27 | $(call if_changed,syshdr) |
26 | 28 | ||
29 | syshdr_abi_unistd_x32 := common,x32 | ||
30 | syshdr_offset_unistd_x32 := __X32_SYSCALL_BIT | ||
31 | $(out)/unistd_x32.h: $(syscall64) $(syshdr) | ||
32 | $(call if_changed,syshdr) | ||
33 | |||
27 | syshdr_abi_unistd_64 := common,64 | 34 | syshdr_abi_unistd_64 := common,64 |
28 | $(out)/unistd_64.h: $(syscall64) $(syshdr) | 35 | $(out)/unistd_64.h: $(syscall64) $(syshdr) |
29 | $(call if_changed,syshdr) | 36 | $(call if_changed,syshdr) |
@@ -33,7 +40,7 @@ $(out)/syscalls_32.h: $(syscall32) $(systbl) | |||
33 | $(out)/syscalls_64.h: $(syscall64) $(systbl) | 40 | $(out)/syscalls_64.h: $(syscall64) $(systbl) |
34 | $(call if_changed,systbl) | 41 | $(call if_changed,systbl) |
35 | 42 | ||
36 | syshdr-y += unistd_32.h unistd_64.h | 43 | syshdr-y += unistd_32.h unistd_64.h unistd_x32.h |
37 | syshdr-y += syscalls_32.h | 44 | syshdr-y += syscalls_32.h |
38 | syshdr-$(CONFIG_X86_64) += unistd_32_ia32.h | 45 | syshdr-$(CONFIG_X86_64) += unistd_32_ia32.h |
39 | syshdr-$(CONFIG_X86_64) += syscalls_64.h | 46 | syshdr-$(CONFIG_X86_64) += syscalls_64.h |