diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-29 21:12:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-29 21:12:23 -0400 |
commit | a591afc01d9e48affbacb365558a31e53c85af45 (patch) | |
tree | 9bb91f4eb94ec69fc4706c4944788ec5f3586063 /include/asm-generic | |
parent | 820d41cf0cd0e94a5661e093821e2e5c6b36a9d8 (diff) | |
parent | 31796ac4e8f0e88f5c10f1ad6dab8f19bebe44a4 (diff) |
Merge branch 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x32 support for x86-64 from Ingo Molnar:
"This tree introduces the X32 binary format and execution mode for x86:
32-bit data space binaries using 64-bit instructions and 64-bit kernel
syscalls.
This allows applications whose working set fits into a 32 bits address
space to make use of 64-bit instructions while using a 32-bit address
space with shorter pointers, more compressed data structures, etc."
Fix up trivial context conflicts in arch/x86/{Kconfig,vdso/vma.c}
* 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (71 commits)
x32: Fix alignment fail in struct compat_siginfo
x32: Fix stupid ia32/x32 inversion in the siginfo format
x32: Add ptrace for x32
x32: Switch to a 64-bit clock_t
x32: Provide separate is_ia32_task() and is_x32_task() predicates
x86, mtrr: Use explicit sizing and padding for the 64-bit ioctls
x86/x32: Fix the binutils auto-detect
x32: Warn and disable rather than error if binutils too old
x32: Only clear TIF_X32 flag once
x32: Make sure TS_COMPAT is cleared for x32 tasks
fs: Remove missed ->fds_bits from cessation use of fd_set structs internally
fs: Fix close_on_exec pointer in alloc_fdtable
x32: Drop non-__vdso weak symbols from the x32 VDSO
x32: Fix coding style violations in the x32 VDSO code
x32: Add x32 VDSO support
x32: Allow x32 to be configured
x32: If configured, add x32 system calls to system call tables
x32: Handle process creation
x32: Signal-related system calls
x86: Add #ifdef CONFIG_COMPAT to <asm/sys_ia32.h>
...
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/posix_types.h | 109 |
1 files changed, 22 insertions, 87 deletions
diff --git a/include/asm-generic/posix_types.h b/include/asm-generic/posix_types.h index 3dab00860e71..91d44bd4dde3 100644 --- a/include/asm-generic/posix_types.h +++ b/include/asm-generic/posix_types.h | |||
@@ -10,8 +10,13 @@ | |||
10 | * architectures, so that you can override them. | 10 | * architectures, so that you can override them. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifndef __kernel_long_t | ||
14 | typedef long __kernel_long_t; | ||
15 | typedef unsigned long __kernel_ulong_t; | ||
16 | #endif | ||
17 | |||
13 | #ifndef __kernel_ino_t | 18 | #ifndef __kernel_ino_t |
14 | typedef unsigned long __kernel_ino_t; | 19 | typedef __kernel_ulong_t __kernel_ino_t; |
15 | #endif | 20 | #endif |
16 | 21 | ||
17 | #ifndef __kernel_mode_t | 22 | #ifndef __kernel_mode_t |
@@ -19,7 +24,7 @@ typedef unsigned int __kernel_mode_t; | |||
19 | #endif | 24 | #endif |
20 | 25 | ||
21 | #ifndef __kernel_nlink_t | 26 | #ifndef __kernel_nlink_t |
22 | typedef unsigned long __kernel_nlink_t; | 27 | typedef __kernel_ulong_t __kernel_nlink_t; |
23 | #endif | 28 | #endif |
24 | 29 | ||
25 | #ifndef __kernel_pid_t | 30 | #ifndef __kernel_pid_t |
@@ -36,7 +41,7 @@ typedef unsigned int __kernel_gid_t; | |||
36 | #endif | 41 | #endif |
37 | 42 | ||
38 | #ifndef __kernel_suseconds_t | 43 | #ifndef __kernel_suseconds_t |
39 | typedef long __kernel_suseconds_t; | 44 | typedef __kernel_long_t __kernel_suseconds_t; |
40 | #endif | 45 | #endif |
41 | 46 | ||
42 | #ifndef __kernel_daddr_t | 47 | #ifndef __kernel_daddr_t |
@@ -44,8 +49,8 @@ typedef int __kernel_daddr_t; | |||
44 | #endif | 49 | #endif |
45 | 50 | ||
46 | #ifndef __kernel_uid32_t | 51 | #ifndef __kernel_uid32_t |
47 | typedef __kernel_uid_t __kernel_uid32_t; | 52 | typedef unsigned int __kernel_uid32_t; |
48 | typedef __kernel_gid_t __kernel_gid32_t; | 53 | typedef unsigned int __kernel_gid32_t; |
49 | #endif | 54 | #endif |
50 | 55 | ||
51 | #ifndef __kernel_old_uid_t | 56 | #ifndef __kernel_old_uid_t |
@@ -67,99 +72,29 @@ typedef unsigned int __kernel_size_t; | |||
67 | typedef int __kernel_ssize_t; | 72 | typedef int __kernel_ssize_t; |
68 | typedef int __kernel_ptrdiff_t; | 73 | typedef int __kernel_ptrdiff_t; |
69 | #else | 74 | #else |
70 | typedef unsigned long __kernel_size_t; | 75 | typedef __kernel_ulong_t __kernel_size_t; |
71 | typedef long __kernel_ssize_t; | 76 | typedef __kernel_long_t __kernel_ssize_t; |
72 | typedef long __kernel_ptrdiff_t; | 77 | typedef __kernel_long_t __kernel_ptrdiff_t; |
73 | #endif | 78 | #endif |
74 | #endif | 79 | #endif |
75 | 80 | ||
81 | #ifndef __kernel_fsid_t | ||
82 | typedef struct { | ||
83 | int val[2]; | ||
84 | } __kernel_fsid_t; | ||
85 | #endif | ||
86 | |||
76 | /* | 87 | /* |
77 | * anything below here should be completely generic | 88 | * anything below here should be completely generic |
78 | */ | 89 | */ |
79 | typedef long __kernel_off_t; | 90 | typedef __kernel_long_t __kernel_off_t; |
80 | typedef long long __kernel_loff_t; | 91 | typedef long long __kernel_loff_t; |
81 | typedef long __kernel_time_t; | 92 | typedef __kernel_long_t __kernel_time_t; |
82 | typedef long __kernel_clock_t; | 93 | typedef __kernel_long_t __kernel_clock_t; |
83 | typedef int __kernel_timer_t; | 94 | typedef int __kernel_timer_t; |
84 | typedef int __kernel_clockid_t; | 95 | typedef int __kernel_clockid_t; |
85 | typedef char * __kernel_caddr_t; | 96 | typedef char * __kernel_caddr_t; |
86 | typedef unsigned short __kernel_uid16_t; | 97 | typedef unsigned short __kernel_uid16_t; |
87 | typedef unsigned short __kernel_gid16_t; | 98 | typedef unsigned short __kernel_gid16_t; |
88 | 99 | ||
89 | typedef struct { | ||
90 | int val[2]; | ||
91 | } __kernel_fsid_t; | ||
92 | |||
93 | #ifdef __KERNEL__ | ||
94 | |||
95 | #undef __FD_SET | ||
96 | static inline void __FD_SET(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
97 | { | ||
98 | unsigned long __tmp = __fd / __NFDBITS; | ||
99 | unsigned long __rem = __fd % __NFDBITS; | ||
100 | __fdsetp->fds_bits[__tmp] |= (1UL<<__rem); | ||
101 | } | ||
102 | |||
103 | #undef __FD_CLR | ||
104 | static inline void __FD_CLR(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
105 | { | ||
106 | unsigned long __tmp = __fd / __NFDBITS; | ||
107 | unsigned long __rem = __fd % __NFDBITS; | ||
108 | __fdsetp->fds_bits[__tmp] &= ~(1UL<<__rem); | ||
109 | } | ||
110 | |||
111 | #undef __FD_ISSET | ||
112 | static inline int __FD_ISSET(unsigned long __fd, const __kernel_fd_set *__p) | ||
113 | { | ||
114 | unsigned long __tmp = __fd / __NFDBITS; | ||
115 | unsigned long __rem = __fd % __NFDBITS; | ||
116 | return (__p->fds_bits[__tmp] & (1UL<<__rem)) != 0; | ||
117 | } | ||
118 | |||
119 | /* | ||
120 | * This will unroll the loop for the normal constant case (8 ints, | ||
121 | * for a 256-bit fd_set) | ||
122 | */ | ||
123 | #undef __FD_ZERO | ||
124 | static inline void __FD_ZERO(__kernel_fd_set *__p) | ||
125 | { | ||
126 | unsigned long *__tmp = __p->fds_bits; | ||
127 | int __i; | ||
128 | |||
129 | if (__builtin_constant_p(__FDSET_LONGS)) { | ||
130 | switch (__FDSET_LONGS) { | ||
131 | case 16: | ||
132 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
133 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
134 | __tmp[ 4] = 0; __tmp[ 5] = 0; | ||
135 | __tmp[ 6] = 0; __tmp[ 7] = 0; | ||
136 | __tmp[ 8] = 0; __tmp[ 9] = 0; | ||
137 | __tmp[10] = 0; __tmp[11] = 0; | ||
138 | __tmp[12] = 0; __tmp[13] = 0; | ||
139 | __tmp[14] = 0; __tmp[15] = 0; | ||
140 | return; | ||
141 | |||
142 | case 8: | ||
143 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
144 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
145 | __tmp[ 4] = 0; __tmp[ 5] = 0; | ||
146 | __tmp[ 6] = 0; __tmp[ 7] = 0; | ||
147 | return; | ||
148 | |||
149 | case 4: | ||
150 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
151 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
152 | return; | ||
153 | } | ||
154 | } | ||
155 | __i = __FDSET_LONGS; | ||
156 | while (__i) { | ||
157 | __i--; | ||
158 | *__tmp = 0; | ||
159 | __tmp++; | ||
160 | } | ||
161 | } | ||
162 | |||
163 | #endif /* __KERNEL__ */ | ||
164 | |||
165 | #endif /* __ASM_GENERIC_POSIX_TYPES_H */ | 100 | #endif /* __ASM_GENERIC_POSIX_TYPES_H */ |