diff options
author | H. Peter Anvin <hpa@zytor.com> | 2012-02-08 00:08:56 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-02-14 15:01:29 -0500 |
commit | 86fcd10e9a57bd9cab113cd6e10d814c849abccd (patch) | |
tree | 7d31a350c1c65f5cde17120359f54ff529cfa536 /arch | |
parent | 08a655ca7f9cab1b2b42f6714407ead8c317edf8 (diff) |
mips: Use generic posix_types.h
Change the mips architecture to use <asm-generic/posix_types.h>.
[ v2: remove redundant definition of __kernel_loff_t ]
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Link: http://lkml.kernel.org/r/1328677745-20121-13-git-send-email-hpa@zytor.com
Cc: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/include/asm/posix_types.h | 121 |
1 files changed, 7 insertions, 114 deletions
diff --git a/arch/mips/include/asm/posix_types.h b/arch/mips/include/asm/posix_types.h index c200102c8586..e0308dcca135 100644 --- a/arch/mips/include/asm/posix_types.h +++ b/arch/mips/include/asm/posix_types.h | |||
@@ -17,128 +17,21 @@ | |||
17 | * assume GCC is being used. | 17 | * assume GCC is being used. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | typedef unsigned long __kernel_ino_t; | ||
21 | typedef unsigned int __kernel_mode_t; | ||
22 | #if (_MIPS_SZLONG == 32) | ||
23 | typedef unsigned long __kernel_nlink_t; | ||
24 | #endif | ||
25 | #if (_MIPS_SZLONG == 64) | 20 | #if (_MIPS_SZLONG == 64) |
26 | typedef unsigned int __kernel_nlink_t; | 21 | typedef unsigned int __kernel_nlink_t; |
22 | #define __kernel_nlink_t __kernel_nlink_t | ||
27 | #endif | 23 | #endif |
28 | typedef long __kernel_off_t; | ||
29 | typedef int __kernel_pid_t; | ||
30 | typedef int __kernel_ipc_pid_t; | ||
31 | typedef unsigned int __kernel_uid_t; | ||
32 | typedef unsigned int __kernel_gid_t; | ||
33 | #if (_MIPS_SZLONG == 32) | ||
34 | typedef unsigned int __kernel_size_t; | ||
35 | typedef int __kernel_ssize_t; | ||
36 | typedef int __kernel_ptrdiff_t; | ||
37 | #endif | ||
38 | #if (_MIPS_SZLONG == 64) | ||
39 | typedef unsigned long __kernel_size_t; | ||
40 | typedef long __kernel_ssize_t; | ||
41 | typedef long __kernel_ptrdiff_t; | ||
42 | #endif | ||
43 | typedef long __kernel_time_t; | ||
44 | typedef long __kernel_suseconds_t; | ||
45 | typedef long __kernel_clock_t; | ||
46 | typedef int __kernel_timer_t; | ||
47 | typedef int __kernel_clockid_t; | ||
48 | typedef long __kernel_daddr_t; | ||
49 | typedef char * __kernel_caddr_t; | ||
50 | 24 | ||
51 | typedef unsigned short __kernel_uid16_t; | 25 | typedef long __kernel_daddr_t; |
52 | typedef unsigned short __kernel_gid16_t; | 26 | #define __kernel_daddr_t __kernel_daddr_t |
53 | typedef unsigned int __kernel_uid32_t; | ||
54 | typedef unsigned int __kernel_gid32_t; | ||
55 | typedef __kernel_uid_t __kernel_old_uid_t; | ||
56 | typedef __kernel_gid_t __kernel_old_gid_t; | ||
57 | typedef unsigned int __kernel_old_dev_t; | ||
58 | |||
59 | #ifdef __GNUC__ | ||
60 | typedef long long __kernel_loff_t; | ||
61 | #endif | ||
62 | 27 | ||
63 | typedef struct { | ||
64 | #if (_MIPS_SZLONG == 32) | 28 | #if (_MIPS_SZLONG == 32) |
29 | typedef struct { | ||
65 | long val[2]; | 30 | long val[2]; |
66 | #endif | ||
67 | #if (_MIPS_SZLONG == 64) | ||
68 | int val[2]; | ||
69 | #endif | ||
70 | } __kernel_fsid_t; | 31 | } __kernel_fsid_t; |
32 | #define __kernel_fsid_t __kernel_fsid_t | ||
33 | #endif | ||
71 | 34 | ||
72 | #if defined(__KERNEL__) | 35 | #include <asm-generic/posix_types.h> |
73 | |||
74 | #undef __FD_SET | ||
75 | static __inline__ void __FD_SET(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
76 | { | ||
77 | unsigned long __tmp = __fd / __NFDBITS; | ||
78 | unsigned long __rem = __fd % __NFDBITS; | ||
79 | __fdsetp->fds_bits[__tmp] |= (1UL<<__rem); | ||
80 | } | ||
81 | |||
82 | #undef __FD_CLR | ||
83 | static __inline__ void __FD_CLR(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
84 | { | ||
85 | unsigned long __tmp = __fd / __NFDBITS; | ||
86 | unsigned long __rem = __fd % __NFDBITS; | ||
87 | __fdsetp->fds_bits[__tmp] &= ~(1UL<<__rem); | ||
88 | } | ||
89 | |||
90 | #undef __FD_ISSET | ||
91 | static __inline__ int __FD_ISSET(unsigned long __fd, const __kernel_fd_set *__p) | ||
92 | { | ||
93 | unsigned long __tmp = __fd / __NFDBITS; | ||
94 | unsigned long __rem = __fd % __NFDBITS; | ||
95 | return (__p->fds_bits[__tmp] & (1UL<<__rem)) != 0; | ||
96 | } | ||
97 | |||
98 | /* | ||
99 | * This will unroll the loop for the normal constant case (8 ints, | ||
100 | * for a 256-bit fd_set) | ||
101 | */ | ||
102 | #undef __FD_ZERO | ||
103 | static __inline__ void __FD_ZERO(__kernel_fd_set *__p) | ||
104 | { | ||
105 | unsigned long *__tmp = __p->fds_bits; | ||
106 | int __i; | ||
107 | |||
108 | if (__builtin_constant_p(__FDSET_LONGS)) { | ||
109 | switch (__FDSET_LONGS) { | ||
110 | case 16: | ||
111 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
112 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
113 | __tmp[ 4] = 0; __tmp[ 5] = 0; | ||
114 | __tmp[ 6] = 0; __tmp[ 7] = 0; | ||
115 | __tmp[ 8] = 0; __tmp[ 9] = 0; | ||
116 | __tmp[10] = 0; __tmp[11] = 0; | ||
117 | __tmp[12] = 0; __tmp[13] = 0; | ||
118 | __tmp[14] = 0; __tmp[15] = 0; | ||
119 | return; | ||
120 | |||
121 | case 8: | ||
122 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
123 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
124 | __tmp[ 4] = 0; __tmp[ 5] = 0; | ||
125 | __tmp[ 6] = 0; __tmp[ 7] = 0; | ||
126 | return; | ||
127 | |||
128 | case 4: | ||
129 | __tmp[ 0] = 0; __tmp[ 1] = 0; | ||
130 | __tmp[ 2] = 0; __tmp[ 3] = 0; | ||
131 | return; | ||
132 | } | ||
133 | } | ||
134 | __i = __FDSET_LONGS; | ||
135 | while (__i) { | ||
136 | __i--; | ||
137 | *__tmp = 0; | ||
138 | __tmp++; | ||
139 | } | ||
140 | } | ||
141 | |||
142 | #endif /* defined(__KERNEL__) */ | ||
143 | 36 | ||
144 | #endif /* _ASM_POSIX_TYPES_H */ | 37 | #endif /* _ASM_POSIX_TYPES_H */ |