H. Peter Anvin | 303395a | 2011-11-11 16:07:41 -0800 | [diff] [blame] | 1 | #ifndef _ASM_X86_UNISTD_H |
| 2 | #define _ASM_X86_UNISTD_H 1 |
| 3 | |
H. Peter Anvin | 6cbb369 | 2012-02-14 14:38:31 -0800 | [diff] [blame] | 4 | /* x32 syscall flag bit */ |
| 5 | #define __X32_SYSCALL_BIT 0x40000000 |
| 6 | |
Thomas Gleixner | 96a388d | 2007-10-11 11:20:03 +0200 | [diff] [blame] | 7 | #ifdef __KERNEL__ |
H. Peter Anvin | fca460f | 2012-02-19 07:56:26 -0800 | [diff] [blame] | 8 | |
| 9 | # ifdef CONFIG_X86_X32_ABI |
| 10 | # define __SYSCALL_MASK (~(__X32_SYSCALL_BIT)) |
| 11 | # else |
| 12 | # define __SYSCALL_MASK (~0) |
| 13 | # endif |
| 14 | |
Adrian Bunk | b11caa7 | 2008-04-20 22:02:17 +0300 | [diff] [blame] | 15 | # ifdef CONFIG_X86_32 |
H. Peter Anvin | 303395a | 2011-11-11 16:07:41 -0800 | [diff] [blame] | 16 | |
| 17 | # include <asm/unistd_32.h> |
| 18 | # define __ARCH_WANT_IPC_PARSE_VERSION |
| 19 | # define __ARCH_WANT_STAT64 |
H. Peter Anvin | 4f2f81a | 2012-01-19 12:41:25 -0800 | [diff] [blame] | 20 | # define __ARCH_WANT_SYS_IPC |
H. Peter Anvin | 303395a | 2011-11-11 16:07:41 -0800 | [diff] [blame] | 21 | # define __ARCH_WANT_SYS_OLD_MMAP |
| 22 | # define __ARCH_WANT_SYS_OLD_SELECT |
| 23 | |
Adrian Bunk | b11caa7 | 2008-04-20 22:02:17 +0300 | [diff] [blame] | 24 | # else |
H. Peter Anvin | 303395a | 2011-11-11 16:07:41 -0800 | [diff] [blame] | 25 | |
| 26 | # include <asm/unistd_64.h> |
H. Peter Anvin | ea499fe | 2012-02-14 14:46:23 -0800 | [diff] [blame] | 27 | # include <asm/unistd_64_x32.h> |
H. Peter Anvin | 303395a | 2011-11-11 16:07:41 -0800 | [diff] [blame] | 28 | # define __ARCH_WANT_COMPAT_SYS_TIME |
| 29 | |
Adrian Bunk | b11caa7 | 2008-04-20 22:02:17 +0300 | [diff] [blame] | 30 | # endif |
H. Peter Anvin | 303395a | 2011-11-11 16:07:41 -0800 | [diff] [blame] | 31 | |
| 32 | # define __ARCH_WANT_OLD_READDIR |
| 33 | # define __ARCH_WANT_OLD_STAT |
| 34 | # define __ARCH_WANT_SYS_ALARM |
| 35 | # define __ARCH_WANT_SYS_FADVISE64 |
| 36 | # define __ARCH_WANT_SYS_GETHOSTNAME |
| 37 | # define __ARCH_WANT_SYS_GETPGRP |
| 38 | # define __ARCH_WANT_SYS_LLSEEK |
| 39 | # define __ARCH_WANT_SYS_NICE |
| 40 | # define __ARCH_WANT_SYS_OLDUMOUNT |
| 41 | # define __ARCH_WANT_SYS_OLD_GETRLIMIT |
| 42 | # define __ARCH_WANT_SYS_OLD_UNAME |
| 43 | # define __ARCH_WANT_SYS_PAUSE |
| 44 | # define __ARCH_WANT_SYS_RT_SIGACTION |
| 45 | # define __ARCH_WANT_SYS_RT_SIGSUSPEND |
| 46 | # define __ARCH_WANT_SYS_SGETMASK |
| 47 | # define __ARCH_WANT_SYS_SIGNAL |
| 48 | # define __ARCH_WANT_SYS_SIGPENDING |
| 49 | # define __ARCH_WANT_SYS_SIGPROCMASK |
| 50 | # define __ARCH_WANT_SYS_SOCKETCALL |
| 51 | # define __ARCH_WANT_SYS_TIME |
| 52 | # define __ARCH_WANT_SYS_UTIME |
| 53 | # define __ARCH_WANT_SYS_WAITPID |
| 54 | |
| 55 | /* |
| 56 | * "Conditional" syscalls |
| 57 | * |
| 58 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), |
| 59 | * but it doesn't work on all toolchains, so we just do it by hand |
| 60 | */ |
| 61 | # define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") |
| 62 | |
Adrian Bunk | b11caa7 | 2008-04-20 22:02:17 +0300 | [diff] [blame] | 63 | #else |
| 64 | # ifdef __i386__ |
H. Peter Anvin | 303395a | 2011-11-11 16:07:41 -0800 | [diff] [blame] | 65 | # include <asm/unistd_32.h> |
H. Peter Anvin | 6cbb369 | 2012-02-14 14:38:31 -0800 | [diff] [blame] | 66 | # elif defined(__LP64__) |
H. Peter Anvin | 303395a | 2011-11-11 16:07:41 -0800 | [diff] [blame] | 67 | # include <asm/unistd_64.h> |
H. Peter Anvin | 6cbb369 | 2012-02-14 14:38:31 -0800 | [diff] [blame] | 68 | # else |
| 69 | # include <asm/unistd_x32.h> |
Thomas Gleixner | 96a388d | 2007-10-11 11:20:03 +0200 | [diff] [blame] | 70 | # endif |
| 71 | #endif |
H. Peter Anvin | 303395a | 2011-11-11 16:07:41 -0800 | [diff] [blame] | 72 | |
| 73 | #endif /* _ASM_X86_UNISTD_H */ |