blob: 0d9776e9e2dc3f2a539015a5f2930e00d2727a99 [file] [log] [blame]
H. Peter Anvin303395a2011-11-11 16:07:41 -08001#ifndef _ASM_X86_UNISTD_H
2#define _ASM_X86_UNISTD_H 1
3
H. Peter Anvin6cbb3692012-02-14 14:38:31 -08004/* x32 syscall flag bit */
5#define __X32_SYSCALL_BIT 0x40000000
6
Thomas Gleixner96a388d2007-10-11 11:20:03 +02007#ifdef __KERNEL__
H. Peter Anvinfca460f2012-02-19 07:56:26 -08008
9# ifdef CONFIG_X86_X32_ABI
10# define __SYSCALL_MASK (~(__X32_SYSCALL_BIT))
11# else
12# define __SYSCALL_MASK (~0)
13# endif
14
Adrian Bunkb11caa72008-04-20 22:02:17 +030015# ifdef CONFIG_X86_32
H. Peter Anvin303395a2011-11-11 16:07:41 -080016
17# include <asm/unistd_32.h>
H. Peter Anvin303395a2011-11-11 16:07:41 -080018# define __ARCH_WANT_STAT64
H. Peter Anvin4f2f81a2012-01-19 12:41:25 -080019# define __ARCH_WANT_SYS_IPC
H. Peter Anvin303395a2011-11-11 16:07:41 -080020# define __ARCH_WANT_SYS_OLD_MMAP
21# define __ARCH_WANT_SYS_OLD_SELECT
22
Adrian Bunkb11caa72008-04-20 22:02:17 +030023# else
H. Peter Anvin303395a2011-11-11 16:07:41 -080024
25# include <asm/unistd_64.h>
H. Peter Anvinea499fe2012-02-14 14:46:23 -080026# include <asm/unistd_64_x32.h>
H. Peter Anvin303395a2011-11-11 16:07:41 -080027# define __ARCH_WANT_COMPAT_SYS_TIME
28
Adrian Bunkb11caa72008-04-20 22:02:17 +030029# endif
H. Peter Anvin303395a2011-11-11 16:07:41 -080030
31# define __ARCH_WANT_OLD_READDIR
32# define __ARCH_WANT_OLD_STAT
33# define __ARCH_WANT_SYS_ALARM
34# define __ARCH_WANT_SYS_FADVISE64
35# define __ARCH_WANT_SYS_GETHOSTNAME
36# define __ARCH_WANT_SYS_GETPGRP
37# define __ARCH_WANT_SYS_LLSEEK
38# define __ARCH_WANT_SYS_NICE
39# define __ARCH_WANT_SYS_OLDUMOUNT
40# define __ARCH_WANT_SYS_OLD_GETRLIMIT
41# define __ARCH_WANT_SYS_OLD_UNAME
42# define __ARCH_WANT_SYS_PAUSE
43# define __ARCH_WANT_SYS_RT_SIGACTION
44# define __ARCH_WANT_SYS_RT_SIGSUSPEND
45# define __ARCH_WANT_SYS_SGETMASK
46# define __ARCH_WANT_SYS_SIGNAL
47# define __ARCH_WANT_SYS_SIGPENDING
48# define __ARCH_WANT_SYS_SIGPROCMASK
49# define __ARCH_WANT_SYS_SOCKETCALL
50# define __ARCH_WANT_SYS_TIME
51# define __ARCH_WANT_SYS_UTIME
52# define __ARCH_WANT_SYS_WAITPID
53
54/*
55 * "Conditional" syscalls
56 *
57 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
58 * but it doesn't work on all toolchains, so we just do it by hand
59 */
60# define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
61
Adrian Bunkb11caa72008-04-20 22:02:17 +030062#else
63# ifdef __i386__
H. Peter Anvin303395a2011-11-11 16:07:41 -080064# include <asm/unistd_32.h>
H.J. Lu98e52722012-04-23 14:51:14 -070065# elif defined(__ILP32__)
H. Peter Anvin6cbb3692012-02-14 14:38:31 -080066# include <asm/unistd_x32.h>
H.J. Lu98e52722012-04-23 14:51:14 -070067# else
68# include <asm/unistd_64.h>
Thomas Gleixner96a388d2007-10-11 11:20:03 +020069# endif
70#endif
H. Peter Anvin303395a2011-11-11 16:07:41 -080071
72#endif /* _ASM_X86_UNISTD_H */