nexmon – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* |
2 | * Copyright (C) 1999-2013, Broadcom Corporation |
||
3 | * |
||
4 | * Unless you and Broadcom execute a separate written software license |
||
5 | * agreement governing use of this software, this software is licensed to you |
||
6 | * under the terms of the GNU General Public License version 2 (the "GPL"), |
||
7 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the |
||
8 | * following added to such license: |
||
9 | * |
||
10 | * As a special exception, the copyright holders of this software give you |
||
11 | * permission to link this software with independent modules, and to copy and |
||
12 | * distribute the resulting executable under terms of your choice, provided that |
||
13 | * you also meet, for each linked independent module, the terms and conditions of |
||
14 | * the license of that module. An independent module is a module which is not |
||
15 | * derived from this software. The special exception does not apply to any |
||
16 | * modifications of the software. |
||
17 | * |
||
18 | * Notwithstanding the above, under no circumstances may you combine this |
||
19 | * software in any way with any other Broadcom software provided under a license |
||
20 | * other than the GPL, without Broadcom's express prior written consent. |
||
21 | * $Id: typedefs.h 397286 2013-04-18 01:42:19Z $ |
||
22 | */ |
||
23 | |||
24 | #ifndef _TYPEDEFS_H_ |
||
25 | #define _TYPEDEFS_H_ |
||
26 | |||
27 | #ifdef SITE_TYPEDEFS |
||
28 | |||
29 | /* |
||
30 | * Define SITE_TYPEDEFS in the compile to include a site-specific |
||
31 | * typedef file "site_typedefs.h". |
||
32 | * |
||
33 | * If SITE_TYPEDEFS is not defined, then the code section below makes |
||
34 | * inferences about the compile environment based on defined symbols and |
||
35 | * possibly compiler pragmas. |
||
36 | * |
||
37 | * Following these two sections is the Default Typedefs section. |
||
38 | * This section is only processed if USE_TYPEDEF_DEFAULTS is |
||
39 | * defined. This section has a default set of typedefs and a few |
||
40 | * preprocessor symbols (TRUE, FALSE, NULL, ...). |
||
41 | */ |
||
42 | |||
43 | #include "site_typedefs.h" |
||
44 | |||
45 | #else |
||
46 | |||
47 | /* |
||
48 | * Infer the compile environment based on preprocessor symbols and pragmas. |
||
49 | * Override type definitions as needed, and include configuration-dependent |
||
50 | * header files to define types. |
||
51 | */ |
||
52 | |||
53 | #ifdef __cplusplus |
||
54 | |||
55 | #define TYPEDEF_BOOL |
||
56 | #ifndef FALSE |
||
57 | #define FALSE false |
||
58 | #endif |
||
59 | #ifndef TRUE |
||
60 | #define TRUE true |
||
61 | #endif |
||
62 | |||
63 | #else /* ! __cplusplus */ |
||
64 | |||
65 | |||
66 | #endif /* ! __cplusplus */ |
||
67 | |||
68 | #if defined(__x86_64__) |
||
69 | #define TYPEDEF_UINTPTR |
||
70 | typedef unsigned long long int uintptr; |
||
71 | #endif |
||
72 | |||
73 | |||
74 | |||
75 | |||
76 | |||
77 | #if defined(_NEED_SIZE_T_) |
||
78 | typedef long unsigned int size_t; |
||
79 | #endif |
||
80 | |||
81 | |||
82 | |||
83 | |||
84 | |||
85 | #if defined(__sparc__) |
||
86 | #define TYPEDEF_ULONG |
||
87 | #endif |
||
88 | |||
89 | |||
90 | /* |
||
91 | * If this is either a Linux hybrid build or the per-port code of a hybrid build |
||
92 | * then use the Linux header files to get some of the typedefs. Otherwise, define |
||
93 | * them entirely in this file. We can't always define the types because we get |
||
94 | * a duplicate typedef error; there is no way to "undefine" a typedef. |
||
95 | * We know when it's per-port code because each file defines LINUX_PORT at the top. |
||
96 | */ |
||
97 | #if !defined(LINUX_HYBRID) || defined(LINUX_PORT) |
||
98 | #define TYPEDEF_UINT |
||
99 | #ifndef TARGETENV_android |
||
100 | #define TYPEDEF_USHORT |
||
101 | #define TYPEDEF_ULONG |
||
102 | #endif /* TARGETENV_android */ |
||
103 | #ifdef __KERNEL__ |
||
104 | #include <linux/version.h> |
||
105 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)) |
||
106 | #define TYPEDEF_BOOL |
||
107 | #endif /* >= 2.6.19 */ |
||
108 | /* special detection for 2.6.18-128.7.1.0.1.el5 */ |
||
109 | #if (LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 18)) |
||
110 | #include <linux/compiler.h> |
||
111 | #ifdef noinline_for_stack |
||
112 | #define TYPEDEF_BOOL |
||
113 | #endif |
||
114 | #endif /* == 2.6.18 */ |
||
115 | #endif /* __KERNEL__ */ |
||
116 | #endif /* !defined(LINUX_HYBRID) || defined(LINUX_PORT) */ |
||
117 | |||
118 | |||
119 | |||
120 | |||
121 | /* Do not support the (u)int64 types with strict ansi for GNU C */ |
||
122 | #if defined(__GNUC__) && defined(__STRICT_ANSI__) |
||
123 | #define TYPEDEF_INT64 |
||
124 | #define TYPEDEF_UINT64 |
||
125 | #endif /* defined(__GNUC__) && defined(__STRICT_ANSI__) */ |
||
126 | |||
127 | /* ICL accepts unsigned 64 bit type only, and complains in ANSI mode |
||
128 | * for signed or unsigned |
||
129 | */ |
||
130 | #if defined(__ICL) |
||
131 | |||
132 | #define TYPEDEF_INT64 |
||
133 | |||
134 | #if defined(__STDC__) |
||
135 | #define TYPEDEF_UINT64 |
||
136 | #endif |
||
137 | |||
138 | #endif /* __ICL */ |
||
139 | |||
140 | #if !defined(__DJGPP__) |
||
141 | |||
142 | /* pick up ushort & uint from standard types.h */ |
||
143 | #if defined(__KERNEL__) |
||
144 | |||
145 | /* See note above */ |
||
146 | #if !defined(LINUX_HYBRID) || defined(LINUX_PORT) |
||
147 | #include <linux/types.h> /* sys/types.h and linux/types.h are oil and water */ |
||
148 | #endif /* !defined(LINUX_HYBRID) || defined(LINUX_PORT) */ |
||
149 | |||
150 | #else |
||
151 | |||
152 | |||
153 | #include <sys/types.h> |
||
154 | |||
155 | #endif /* linux && __KERNEL__ */ |
||
156 | |||
157 | #endif |
||
158 | |||
159 | |||
160 | |||
161 | /* use the default typedefs in the next section of this file */ |
||
162 | #define USE_TYPEDEF_DEFAULTS |
||
163 | |||
164 | #endif /* SITE_TYPEDEFS */ |
||
165 | |||
166 | |||
167 | /* |
||
168 | * Default Typedefs |
||
169 | */ |
||
170 | |||
171 | #ifdef USE_TYPEDEF_DEFAULTS |
||
172 | #undef USE_TYPEDEF_DEFAULTS |
||
173 | |||
174 | #ifndef TYPEDEF_BOOL |
||
175 | typedef /* @abstract@ */ unsigned char bool; |
||
176 | #endif |
||
177 | |||
178 | /* define uchar, ushort, uint, ulong */ |
||
179 | |||
180 | #ifndef TYPEDEF_UCHAR |
||
181 | typedef unsigned char uchar; |
||
182 | #endif |
||
183 | |||
184 | #ifndef TYPEDEF_USHORT |
||
185 | typedef unsigned short ushort; |
||
186 | #endif |
||
187 | |||
188 | #ifndef TYPEDEF_UINT |
||
189 | typedef unsigned int uint; |
||
190 | #endif |
||
191 | |||
192 | #ifndef TYPEDEF_ULONG |
||
193 | typedef unsigned long ulong; |
||
194 | #endif |
||
195 | |||
196 | /* define [u]int8/16/32/64, uintptr */ |
||
197 | |||
198 | #ifndef TYPEDEF_UINT8 |
||
199 | typedef unsigned char uint8; |
||
200 | #endif |
||
201 | |||
202 | #ifndef TYPEDEF_UINT16 |
||
203 | typedef unsigned short uint16; |
||
204 | #endif |
||
205 | |||
206 | #ifndef TYPEDEF_UINT32 |
||
207 | typedef unsigned int uint32; |
||
208 | #endif |
||
209 | |||
210 | #ifndef TYPEDEF_UINT64 |
||
211 | typedef unsigned long long uint64; |
||
212 | #endif |
||
213 | |||
214 | #ifndef TYPEDEF_UINTPTR |
||
215 | typedef unsigned int uintptr; |
||
216 | #endif |
||
217 | |||
218 | #ifndef TYPEDEF_INT8 |
||
219 | typedef signed char int8; |
||
220 | #endif |
||
221 | |||
222 | #ifndef TYPEDEF_INT16 |
||
223 | typedef signed short int16; |
||
224 | #endif |
||
225 | |||
226 | #ifndef TYPEDEF_INT32 |
||
227 | typedef signed int int32; |
||
228 | #endif |
||
229 | |||
230 | #ifndef TYPEDEF_INT64 |
||
231 | typedef signed long long int64; |
||
232 | #endif |
||
233 | |||
234 | /* define float32/64, float_t */ |
||
235 | |||
236 | #ifndef TYPEDEF_FLOAT32 |
||
237 | typedef float float32; |
||
238 | #endif |
||
239 | |||
240 | #ifndef TYPEDEF_FLOAT64 |
||
241 | typedef double float64; |
||
242 | #endif |
||
243 | |||
244 | /* |
||
245 | * abstracted floating point type allows for compile time selection of |
||
246 | * single or double precision arithmetic. Compiling with -DFLOAT32 |
||
247 | * selects single precision; the default is double precision. |
||
248 | */ |
||
249 | |||
250 | #ifndef TYPEDEF_FLOAT_T |
||
251 | |||
252 | #if defined(FLOAT32) |
||
253 | typedef float32 float_t; |
||
254 | #else /* default to double precision floating point */ |
||
255 | typedef float64 float_t; |
||
256 | #endif |
||
257 | |||
258 | #endif /* TYPEDEF_FLOAT_T */ |
||
259 | |||
260 | /* define macro values */ |
||
261 | |||
262 | #ifndef FALSE |
||
263 | #define FALSE 0 |
||
264 | #endif |
||
265 | |||
266 | #ifndef TRUE |
||
267 | #define TRUE 1 /* TRUE */ |
||
268 | #endif |
||
269 | |||
270 | #ifndef NULL |
||
271 | #define NULL 0 |
||
272 | #endif |
||
273 | |||
274 | #ifndef OFF |
||
275 | #define OFF 0 |
||
276 | #endif |
||
277 | |||
278 | #ifndef ON |
||
279 | #define ON 1 /* ON = 1 */ |
||
280 | #endif |
||
281 | |||
282 | #define AUTO (-1) /* Auto = -1 */ |
||
283 | |||
284 | /* define PTRSZ, INLINE */ |
||
285 | |||
286 | #ifndef PTRSZ |
||
287 | #define PTRSZ sizeof(char*) |
||
288 | #endif |
||
289 | |||
290 | |||
291 | /* Detect compiler type. */ |
||
292 | #if defined(__GNUC__) || defined(__lint) |
||
293 | #define BWL_COMPILER_GNU |
||
294 | #elif defined(__CC_ARM) && __CC_ARM |
||
295 | #define BWL_COMPILER_ARMCC |
||
296 | #else |
||
297 | #error "Unknown compiler!" |
||
298 | #endif |
||
299 | |||
300 | |||
301 | #ifndef INLINE |
||
302 | #if defined(BWL_COMPILER_MICROSOFT) |
||
303 | #define INLINE __inline |
||
304 | #elif defined(BWL_COMPILER_GNU) |
||
305 | #define INLINE __inline__ |
||
306 | #elif defined(BWL_COMPILER_ARMCC) |
||
307 | #define INLINE __inline |
||
308 | #else |
||
309 | #define INLINE |
||
310 | #endif |
||
311 | #endif /* INLINE */ |
||
312 | |||
313 | #undef TYPEDEF_BOOL |
||
314 | #undef TYPEDEF_UCHAR |
||
315 | #undef TYPEDEF_USHORT |
||
316 | #undef TYPEDEF_UINT |
||
317 | #undef TYPEDEF_ULONG |
||
318 | #undef TYPEDEF_UINT8 |
||
319 | #undef TYPEDEF_UINT16 |
||
320 | #undef TYPEDEF_UINT32 |
||
321 | #undef TYPEDEF_UINT64 |
||
322 | #undef TYPEDEF_UINTPTR |
||
323 | #undef TYPEDEF_INT8 |
||
324 | #undef TYPEDEF_INT16 |
||
325 | #undef TYPEDEF_INT32 |
||
326 | #undef TYPEDEF_INT64 |
||
327 | #undef TYPEDEF_FLOAT32 |
||
328 | #undef TYPEDEF_FLOAT64 |
||
329 | #undef TYPEDEF_FLOAT_T |
||
330 | |||
331 | #endif /* USE_TYPEDEF_DEFAULTS */ |
||
332 | |||
333 | /* Suppress unused parameter warning */ |
||
334 | #define UNUSED_PARAMETER(x) (void)(x) |
||
335 | |||
336 | /* Avoid warning for discarded const or volatile qualifier in special cases (-Wcast-qual) */ |
||
337 | #define DISCARD_QUAL(ptr, type) ((type *)(uintptr)(ptr)) |
||
338 | |||
339 | /* |
||
340 | * Including the bcmdefs.h here, to make sure everyone including typedefs.h |
||
341 | * gets this automatically |
||
342 | */ |
||
343 | #include <bcmdefs.h> |
||
344 | #endif /* _TYPEDEFS_H_ */ |