diff options
author | H. Peter Anvin <hpa@zytor.com> | 2012-02-08 00:09:02 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-02-14 15:01:30 -0500 |
commit | 8c4c7a9a0fd4217a044b33f91f1e5b2987cbfa04 (patch) | |
tree | d944092ac4db61b0444746f36254cc390d9c115b /arch | |
parent | 81620bb7acee40dda4dbfdd061cd22c373529372 (diff) |
sparc: Use generic posix_types.h
Change the sparc architecture to use <asm-generic/posix_types.h>.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Acked-by: "David S. Miller" <davem@davemloft.net>
Link: http://lkml.kernel.org/r/1328677745-20121-19-git-send-email-hpa@zytor.com
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc/include/asm/posix_types.h | 133 |
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 */ |
12 | typedef unsigned long __kernel_size_t; | ||
13 | typedef long __kernel_ssize_t; | ||
14 | typedef long __kernel_ptrdiff_t; | ||
15 | typedef long __kernel_time_t; | ||
16 | typedef long __kernel_clock_t; | ||
17 | typedef int __kernel_pid_t; | ||
18 | typedef int __kernel_ipc_pid_t; | ||
19 | typedef unsigned int __kernel_uid_t; | ||
20 | typedef unsigned int __kernel_gid_t; | ||
21 | typedef unsigned long __kernel_ino_t; | ||
22 | typedef unsigned int __kernel_mode_t; | ||
23 | typedef unsigned int __kernel_nlink_t; | 12 | typedef unsigned int __kernel_nlink_t; |
24 | typedef int __kernel_daddr_t; | 13 | #define __kernel_nlink_t __kernel_nlink_t |
25 | typedef long __kernel_off_t; | ||
26 | typedef char * __kernel_caddr_t; | ||
27 | typedef unsigned short __kernel_uid16_t; | ||
28 | typedef unsigned short __kernel_gid16_t; | ||
29 | typedef int __kernel_clockid_t; | ||
30 | typedef int __kernel_timer_t; | ||
31 | 14 | ||
32 | typedef unsigned short __kernel_old_uid_t; | 15 | typedef unsigned short __kernel_old_uid_t; |
33 | typedef unsigned short __kernel_old_gid_t; | 16 | typedef unsigned short __kernel_old_gid_t; |
34 | typedef __kernel_uid_t __kernel_uid32_t; | 17 | #define __kernel_old_uid_t __kernel_old_uid_t |
35 | typedef __kernel_gid_t __kernel_gid32_t; | ||
36 | |||
37 | typedef 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. */ |
40 | typedef int __kernel_suseconds_t; | 20 | typedef 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; | |||
45 | typedef unsigned int __kernel_size_t; | 26 | typedef unsigned int __kernel_size_t; |
46 | typedef int __kernel_ssize_t; | 27 | typedef int __kernel_ssize_t; |
47 | typedef long int __kernel_ptrdiff_t; | 28 | typedef long int __kernel_ptrdiff_t; |
48 | typedef long __kernel_time_t; | 29 | #define __kernel_size_t __kernel_size_t |
49 | typedef long __kernel_suseconds_t; | 30 | |
50 | typedef long __kernel_clock_t; | ||
51 | typedef int __kernel_pid_t; | ||
52 | typedef unsigned short __kernel_ipc_pid_t; | 31 | typedef unsigned short __kernel_ipc_pid_t; |
32 | #define __kernel_ipc_pid_t __kernel_ipc_pid_t | ||
33 | |||
53 | typedef unsigned short __kernel_uid_t; | 34 | typedef unsigned short __kernel_uid_t; |
54 | typedef unsigned short __kernel_gid_t; | 35 | typedef unsigned short __kernel_gid_t; |
55 | typedef unsigned long __kernel_ino_t; | 36 | #define __kernel_uid_t __kernel_uid_t |
37 | |||
56 | typedef unsigned short __kernel_mode_t; | 38 | typedef unsigned short __kernel_mode_t; |
39 | #define __kernel_mode_t __kernel_mode_t | ||
40 | |||
57 | typedef short __kernel_nlink_t; | 41 | typedef short __kernel_nlink_t; |
42 | #define __kernel_nlink_t __kernel_nlink_t | ||
43 | |||
58 | typedef long __kernel_daddr_t; | 44 | typedef long __kernel_daddr_t; |
59 | typedef long __kernel_off_t; | 45 | #define __kernel_daddr_t __kernel_daddr_t |
60 | typedef char * __kernel_caddr_t; | 46 | |
61 | typedef unsigned short __kernel_uid16_t; | ||
62 | typedef unsigned short __kernel_gid16_t; | ||
63 | typedef unsigned int __kernel_uid32_t; | ||
64 | typedef unsigned int __kernel_gid32_t; | ||
65 | typedef unsigned short __kernel_old_uid_t; | ||
66 | typedef unsigned short __kernel_old_gid_t; | ||
67 | typedef unsigned short __kernel_old_dev_t; | 47 | typedef unsigned short __kernel_old_dev_t; |
68 | typedef int __kernel_clockid_t; | 48 | #define __kernel_old_dev_t __kernel_old_dev_t |
69 | typedef 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> |
74 | typedef long long __kernel_loff_t; | ||
75 | #endif | ||
76 | |||
77 | typedef struct { | ||
78 | int val[2]; | ||
79 | } __kernel_fsid_t; | ||
80 | |||
81 | #ifdef __KERNEL__ | ||
82 | |||
83 | #undef __FD_SET | ||
84 | static 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 | ||
92 | static 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 | ||
100 | static 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 | ||
112 | static 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 */ |