diff options
author | jdl@freescale.com <jdl@freescale.com> | 2005-09-09 17:43:52 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-09-21 05:21:07 -0400 |
commit | 17b1dc07aebdef9ee43c06525bee702d5f0e9db1 (patch) | |
tree | 4965361a9762f351a8192fb0842ba552cc0e4bd3 | |
parent | da0825fd201a03294dbf7f8f030676d608da122c (diff) |
[PATCH] powerpc: Merge asm-ppc*/posix_types.h
Merge asm-ppc/posix_types.h and asm-ppc64/posix_types.h.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | include/asm-powerpc/posix_types.h (renamed from include/asm-ppc64/posix_types.h) | 40 | ||||
-rw-r--r-- | include/asm-ppc/posix_types.h | 111 |
2 files changed, 25 insertions, 126 deletions
diff --git a/include/asm-ppc64/posix_types.h b/include/asm-powerpc/posix_types.h index 516de7201b5d..c6391077224f 100644 --- a/include/asm-ppc64/posix_types.h +++ b/include/asm-powerpc/posix_types.h | |||
@@ -1,44 +1,54 @@ | |||
1 | #ifndef _PPC64_POSIX_TYPES_H | 1 | #ifndef _ASM_POWERPC_POSIX_TYPES_H |
2 | #define _PPC64_POSIX_TYPES_H | 2 | #define _ASM_POWERPC_POSIX_TYPES_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * This file is generally used by user-level software, so you need to | 5 | * This file is generally used by user-level software, so you need to |
6 | * be a little careful about namespace pollution etc. Also, we cannot | 6 | * be a little careful about namespace pollution etc. Also, we cannot |
7 | * assume GCC is being used. | 7 | * assume GCC is being used. |
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | */ | 8 | */ |
14 | 9 | ||
15 | typedef unsigned long __kernel_ino_t; | 10 | typedef unsigned long __kernel_ino_t; |
16 | typedef unsigned long __kernel_nlink_t; | ||
17 | typedef unsigned int __kernel_mode_t; | 11 | typedef unsigned int __kernel_mode_t; |
18 | typedef long __kernel_off_t; | 12 | typedef long __kernel_off_t; |
19 | typedef long long __kernel_loff_t; | ||
20 | typedef int __kernel_pid_t; | 13 | typedef int __kernel_pid_t; |
21 | typedef int __kernel_ipc_pid_t; | ||
22 | typedef unsigned int __kernel_uid_t; | 14 | typedef unsigned int __kernel_uid_t; |
23 | typedef unsigned int __kernel_gid_t; | 15 | typedef unsigned int __kernel_gid_t; |
24 | typedef unsigned long __kernel_size_t; | ||
25 | typedef long __kernel_ssize_t; | ||
26 | typedef long __kernel_ptrdiff_t; | 16 | typedef long __kernel_ptrdiff_t; |
27 | typedef long __kernel_time_t; | 17 | typedef long __kernel_time_t; |
18 | typedef long __kernel_clock_t; | ||
28 | typedef int __kernel_timer_t; | 19 | typedef int __kernel_timer_t; |
29 | typedef int __kernel_clockid_t; | 20 | typedef int __kernel_clockid_t; |
30 | typedef long __kernel_suseconds_t; | 21 | typedef long __kernel_suseconds_t; |
31 | typedef long __kernel_clock_t; | ||
32 | typedef int __kernel_daddr_t; | 22 | typedef int __kernel_daddr_t; |
33 | typedef char * __kernel_caddr_t; | 23 | typedef char * __kernel_caddr_t; |
34 | typedef unsigned short __kernel_uid16_t; | 24 | typedef unsigned short __kernel_uid16_t; |
35 | typedef unsigned short __kernel_gid16_t; | 25 | typedef unsigned short __kernel_gid16_t; |
36 | typedef unsigned int __kernel_uid32_t; | 26 | typedef unsigned int __kernel_uid32_t; |
37 | typedef unsigned int __kernel_gid32_t; | 27 | typedef unsigned int __kernel_gid32_t; |
38 | |||
39 | typedef unsigned int __kernel_old_uid_t; | 28 | typedef unsigned int __kernel_old_uid_t; |
40 | typedef unsigned int __kernel_old_gid_t; | 29 | typedef unsigned int __kernel_old_gid_t; |
30 | |||
31 | #ifdef __powerpc64__ | ||
32 | typedef unsigned long __kernel_nlink_t; | ||
33 | typedef int __kernel_ipc_pid_t; | ||
34 | typedef unsigned long __kernel_size_t; | ||
35 | typedef long __kernel_ssize_t; | ||
41 | typedef unsigned long __kernel_old_dev_t; | 36 | typedef unsigned long __kernel_old_dev_t; |
37 | #else | ||
38 | typedef unsigned short __kernel_nlink_t; | ||
39 | typedef short __kernel_ipc_pid_t; | ||
40 | typedef unsigned int __kernel_size_t; | ||
41 | typedef int __kernel_ssize_t; | ||
42 | typedef unsigned int __kernel_old_dev_t; | ||
43 | #endif | ||
44 | |||
45 | #ifdef __powerpc64__ | ||
46 | typedef long long __kernel_loff_t; | ||
47 | #else | ||
48 | #ifdef __GNUC__ | ||
49 | typedef long long __kernel_loff_t; | ||
50 | #endif | ||
51 | #endif | ||
42 | 52 | ||
43 | typedef struct { | 53 | typedef struct { |
44 | int val[2]; | 54 | int val[2]; |
@@ -116,4 +126,4 @@ static __inline__ void __FD_ZERO(__kernel_fd_set *p) | |||
116 | 126 | ||
117 | #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ | 127 | #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ |
118 | #endif /* __GNUC__ */ | 128 | #endif /* __GNUC__ */ |
119 | #endif /* _PPC64_POSIX_TYPES_H */ | 129 | #endif /* _ASM_POWERPC_POSIX_TYPES_H */ |
diff --git a/include/asm-ppc/posix_types.h b/include/asm-ppc/posix_types.h deleted file mode 100644 index a14a82abe8d2..000000000000 --- a/include/asm-ppc/posix_types.h +++ /dev/null | |||
@@ -1,111 +0,0 @@ | |||
1 | #ifndef _PPC_POSIX_TYPES_H | ||
2 | #define _PPC_POSIX_TYPES_H | ||
3 | |||
4 | /* | ||
5 | * This file is generally used by user-level software, so you need to | ||
6 | * be a little careful about namespace pollution etc. Also, we cannot | ||
7 | * assume GCC is being used. | ||
8 | */ | ||
9 | |||
10 | typedef unsigned long __kernel_ino_t; | ||
11 | typedef unsigned int __kernel_mode_t; | ||
12 | typedef unsigned short __kernel_nlink_t; | ||
13 | typedef long __kernel_off_t; | ||
14 | typedef int __kernel_pid_t; | ||
15 | typedef unsigned int __kernel_uid_t; | ||
16 | typedef unsigned int __kernel_gid_t; | ||
17 | typedef unsigned int __kernel_size_t; | ||
18 | typedef int __kernel_ssize_t; | ||
19 | typedef long __kernel_ptrdiff_t; | ||
20 | typedef long __kernel_time_t; | ||
21 | typedef long __kernel_suseconds_t; | ||
22 | typedef long __kernel_clock_t; | ||
23 | typedef int __kernel_timer_t; | ||
24 | typedef int __kernel_clockid_t; | ||
25 | typedef int __kernel_daddr_t; | ||
26 | typedef char * __kernel_caddr_t; | ||
27 | typedef short __kernel_ipc_pid_t; | ||
28 | typedef unsigned short __kernel_uid16_t; | ||
29 | typedef unsigned short __kernel_gid16_t; | ||
30 | typedef unsigned int __kernel_uid32_t; | ||
31 | typedef unsigned int __kernel_gid32_t; | ||
32 | |||
33 | typedef unsigned int __kernel_old_uid_t; | ||
34 | typedef unsigned int __kernel_old_gid_t; | ||
35 | typedef unsigned int __kernel_old_dev_t; | ||
36 | |||
37 | #ifdef __GNUC__ | ||
38 | typedef long long __kernel_loff_t; | ||
39 | #endif | ||
40 | |||
41 | typedef struct { | ||
42 | int val[2]; | ||
43 | } __kernel_fsid_t; | ||
44 | |||
45 | #ifndef __GNUC__ | ||
46 | |||
47 | #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) | ||
48 | #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) | ||
49 | #define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) | ||
50 | #define __FD_ZERO(set) \ | ||
51 | ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set))) | ||
52 | |||
53 | #else /* __GNUC__ */ | ||
54 | |||
55 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) \ | ||
56 | || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0) | ||
57 | /* With GNU C, use inline functions instead so args are evaluated only once: */ | ||
58 | |||
59 | #undef __FD_SET | ||
60 | static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) | ||
61 | { | ||
62 | unsigned long _tmp = fd / __NFDBITS; | ||
63 | unsigned long _rem = fd % __NFDBITS; | ||
64 | fdsetp->fds_bits[_tmp] |= (1UL<<_rem); | ||
65 | } | ||
66 | |||
67 | #undef __FD_CLR | ||
68 | static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) | ||
69 | { | ||
70 | unsigned long _tmp = fd / __NFDBITS; | ||
71 | unsigned long _rem = fd % __NFDBITS; | ||
72 | fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem); | ||
73 | } | ||
74 | |||
75 | #undef __FD_ISSET | ||
76 | static __inline__ int __FD_ISSET(unsigned long fd, __kernel_fd_set *p) | ||
77 | { | ||
78 | unsigned long _tmp = fd / __NFDBITS; | ||
79 | unsigned long _rem = fd % __NFDBITS; | ||
80 | return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0; | ||
81 | } | ||
82 | |||
83 | /* | ||
84 | * This will unroll the loop for the normal constant case (8 ints, | ||
85 | * for a 256-bit fd_set) | ||
86 | */ | ||
87 | #undef __FD_ZERO | ||
88 | static __inline__ void __FD_ZERO(__kernel_fd_set *p) | ||
89 | { | ||
90 | unsigned int *tmp = (unsigned int *)p->fds_bits; | ||
91 | int i; | ||
92 | |||
93 | if (__builtin_constant_p(__FDSET_LONGS)) { | ||
94 | switch (__FDSET_LONGS) { | ||
95 | case 8: | ||
96 | tmp[0] = 0; tmp[1] = 0; tmp[2] = 0; tmp[3] = 0; | ||
97 | tmp[4] = 0; tmp[5] = 0; tmp[6] = 0; tmp[7] = 0; | ||
98 | return; | ||
99 | } | ||
100 | } | ||
101 | i = __FDSET_LONGS; | ||
102 | while (i) { | ||
103 | i--; | ||
104 | *tmp = 0; | ||
105 | tmp++; | ||
106 | } | ||
107 | } | ||
108 | |||
109 | #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ | ||
110 | #endif /* __GNUC__ */ | ||
111 | #endif /* _PPC_POSIX_TYPES_H */ | ||