aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-29 21:12:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-29 21:12:23 -0400
commita591afc01d9e48affbacb365558a31e53c85af45 (patch)
tree9bb91f4eb94ec69fc4706c4944788ec5f3586063 /arch/sparc
parent820d41cf0cd0e94a5661e093821e2e5c6b36a9d8 (diff)
parent31796ac4e8f0e88f5c10f1ad6dab8f19bebe44a4 (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 'arch/sparc')
-rw-r--r--arch/sparc/include/asm/posix_types.h133
1 files changed, 17 insertions, 116 deletions
diff --git a/arch/sparc/include/asm/posix_types.h b/arch/sparc/include/asm/posix_types.h
index dbfc1a34b3a2..3070f25ae90a 100644
--- a/arch/sparc/include/asm/posix_types.h
+++ b/arch/sparc/include/asm/posix_types.h
@@ -9,35 +9,16 @@
9 9
10#if defined(__sparc__) && defined(__arch64__) 10#if defined(__sparc__) && defined(__arch64__)
11/* sparc 64 bit */ 11/* sparc 64 bit */
12typedef unsigned long __kernel_size_t;
13typedef long __kernel_ssize_t;
14typedef long __kernel_ptrdiff_t;
15typedef long __kernel_time_t;
16typedef long __kernel_clock_t;
17typedef int __kernel_pid_t;
18typedef int __kernel_ipc_pid_t;
19typedef unsigned int __kernel_uid_t;
20typedef unsigned int __kernel_gid_t;
21typedef unsigned long __kernel_ino_t;
22typedef unsigned int __kernel_mode_t;
23typedef unsigned int __kernel_nlink_t; 12typedef unsigned int __kernel_nlink_t;
24typedef int __kernel_daddr_t; 13#define __kernel_nlink_t __kernel_nlink_t
25typedef long __kernel_off_t;
26typedef char * __kernel_caddr_t;
27typedef unsigned short __kernel_uid16_t;
28typedef unsigned short __kernel_gid16_t;
29typedef int __kernel_clockid_t;
30typedef int __kernel_timer_t;
31 14
32typedef unsigned short __kernel_old_uid_t; 15typedef unsigned short __kernel_old_uid_t;
33typedef unsigned short __kernel_old_gid_t; 16typedef unsigned short __kernel_old_gid_t;
34typedef __kernel_uid_t __kernel_uid32_t; 17#define __kernel_old_uid_t __kernel_old_uid_t
35typedef __kernel_gid_t __kernel_gid32_t;
36
37typedef unsigned int __kernel_old_dev_t;
38 18
39/* Note this piece of asymmetry from the v9 ABI. */ 19/* Note this piece of asymmetry from the v9 ABI. */
40typedef int __kernel_suseconds_t; 20typedef int __kernel_suseconds_t;
21#define __kernel_suseconds_t __kernel_suseconds_t
41 22
42#else 23#else
43/* sparc 32 bit */ 24/* sparc 32 bit */
@@ -45,109 +26,29 @@ typedef int __kernel_suseconds_t;
45typedef unsigned int __kernel_size_t; 26typedef unsigned int __kernel_size_t;
46typedef int __kernel_ssize_t; 27typedef int __kernel_ssize_t;
47typedef long int __kernel_ptrdiff_t; 28typedef long int __kernel_ptrdiff_t;
48typedef long __kernel_time_t; 29#define __kernel_size_t __kernel_size_t
49typedef long __kernel_suseconds_t; 30
50typedef long __kernel_clock_t;
51typedef int __kernel_pid_t;
52typedef unsigned short __kernel_ipc_pid_t; 31typedef unsigned short __kernel_ipc_pid_t;
32#define __kernel_ipc_pid_t __kernel_ipc_pid_t
33
53typedef unsigned short __kernel_uid_t; 34typedef unsigned short __kernel_uid_t;
54typedef unsigned short __kernel_gid_t; 35typedef unsigned short __kernel_gid_t;
55typedef unsigned long __kernel_ino_t; 36#define __kernel_uid_t __kernel_uid_t
37
56typedef unsigned short __kernel_mode_t; 38typedef unsigned short __kernel_mode_t;
39#define __kernel_mode_t __kernel_mode_t
40
57typedef short __kernel_nlink_t; 41typedef short __kernel_nlink_t;
42#define __kernel_nlink_t __kernel_nlink_t
43
58typedef long __kernel_daddr_t; 44typedef long __kernel_daddr_t;
59typedef long __kernel_off_t; 45#define __kernel_daddr_t __kernel_daddr_t
60typedef char * __kernel_caddr_t; 46
61typedef unsigned short __kernel_uid16_t;
62typedef unsigned short __kernel_gid16_t;
63typedef unsigned int __kernel_uid32_t;
64typedef unsigned int __kernel_gid32_t;
65typedef unsigned short __kernel_old_uid_t;
66typedef unsigned short __kernel_old_gid_t;
67typedef unsigned short __kernel_old_dev_t; 47typedef unsigned short __kernel_old_dev_t;
68typedef int __kernel_clockid_t; 48#define __kernel_old_dev_t __kernel_old_dev_t
69typedef int __kernel_timer_t;
70 49
71#endif /* defined(__sparc__) && defined(__arch64__) */ 50#endif /* defined(__sparc__) && defined(__arch64__) */
72 51
73#ifdef __GNUC__ 52#include <asm-generic/posix_types.h>
74typedef long long __kernel_loff_t;
75#endif
76
77typedef struct {
78 int val[2];
79} __kernel_fsid_t;
80
81#ifdef __KERNEL__
82
83#undef __FD_SET
84static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
85{
86 unsigned long _tmp = fd / __NFDBITS;
87 unsigned long _rem = fd % __NFDBITS;
88 fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
89}
90
91#undef __FD_CLR
92static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
93{
94 unsigned long _tmp = fd / __NFDBITS;
95 unsigned long _rem = fd % __NFDBITS;
96 fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
97}
98
99#undef __FD_ISSET
100static inline int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p)
101{
102 unsigned long _tmp = fd / __NFDBITS;
103 unsigned long _rem = fd % __NFDBITS;
104 return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
105}
106
107/*
108 * This will unroll the loop for the normal constant cases (8 or 32 longs,
109 * for 256 and 1024-bit fd_sets respectively)
110 */
111#undef __FD_ZERO
112static inline void __FD_ZERO(__kernel_fd_set *p)
113{
114 unsigned long *tmp = p->fds_bits;
115 int i;
116
117 if (__builtin_constant_p(__FDSET_LONGS)) {
118 switch (__FDSET_LONGS) {
119 case 32:
120 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
121 tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
122 tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
123 tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
124 tmp[16] = 0; tmp[17] = 0; tmp[18] = 0; tmp[19] = 0;
125 tmp[20] = 0; tmp[21] = 0; tmp[22] = 0; tmp[23] = 0;
126 tmp[24] = 0; tmp[25] = 0; tmp[26] = 0; tmp[27] = 0;
127 tmp[28] = 0; tmp[29] = 0; tmp[30] = 0; tmp[31] = 0;
128 return;
129 case 16:
130 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
131 tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
132 tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
133 tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
134 return;
135 case 8:
136 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
137 tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
138 return;
139 case 4:
140 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
141 return;
142 }
143 }
144 i = __FDSET_LONGS;
145 while (i) {
146 i--;
147 *tmp = 0;
148 tmp++;
149 }
150}
151 53
152#endif /* __KERNEL__ */
153#endif /* __SPARC_POSIX_TYPES_H */ 54#endif /* __SPARC_POSIX_TYPES_H */